-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsetup.py
More file actions
95 lines (80 loc) · 3.26 KB
/
setup.py
File metadata and controls
95 lines (80 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright (c) 2021, Anders Lervik.
# Distributed under the LGPLv2.1+ License. See LICENSE for more info.
"""
gpxplotter - A library for reading gpx files and making some simple plots.
Copyright (C) 2021, Anders Lervik.
This file is part of gpxplotter.
gpxplotter is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.
gpxplotter is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with gpxplotter. If not, see <http://www.gnu.org/licenses/>
"""
import ast
import pathlib
from setuptools import setup, find_packages
GITHUB = 'https://github.com/andersle/gpxplotter'
DOCS = 'https://gpxplotter.readthedocs.io/en/latest'
FULL_VERSION = '0.2.12' # Automatically set by setup_version.py
def get_long_description():
"""Return the contents of the README.md file."""
# Get the long description from the README file
long_description = ''
here = pathlib.Path(__file__).absolute().parent
readme = here.joinpath('pypireadme.md')
with open(readme, 'r') as fileh:
long_description = fileh.read()
return long_description
def get_version():
"""Return the version from version.py as a string."""
here = pathlib.Path(__file__).absolute().parent
filename = here.joinpath('gpxplotter', 'version.py')
with open(filename, 'r') as fileh:
for lines in fileh:
if lines.startswith('FULL_VERSION ='):
version = ast.literal_eval(lines.split('=')[1].strip())
return version
return FULL_VERSION
def get_requirements():
"""Read requirements.txt and return a list of requirements."""
here = pathlib.Path(__file__).absolute().parent
requirements = []
filename = here.joinpath('requirements.txt')
with open(filename, 'r') as fileh:
for lines in fileh:
requirements.append(lines.strip())
return requirements
setup(
name='gpxplotter',
version=get_version(),
description='A package for reading gpx files and creating simple plots',
long_description=get_long_description(),
long_description_content_type='text/markdown',
url=GITHUB,
author='Anders Lervik',
author_email='andersle@gmail.com',
license='LGPLv2.1+',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: End Users/Desktop',
('License :: OSI Approved :: '
'GNU Lesser General Public License v2 or later (LGPLv2+)'),
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Other/Nonlisted Topic',
],
keywords='gpx gps',
packages=find_packages(),
install_requires=get_requirements(),
)