-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
executable file
·105 lines (91 loc) · 3.76 KB
/
setup.py
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
96
97
98
99
100
101
102
103
104
#!/usr/bin/env python
# from distutils.core import setup
from setuptools import setup, Command
import os
# Utility function to read the README file.
# Used for the long_description.
# Github and readthedocs can both handle relative image links,
# but the images don't get copied up to pypi, so instead,
# replace them with images from the latest readthedocs run.
def file_contents(fname):
with open(os.path.join(os.path.dirname(__file__), fname)) as fp:
return fp.read().replace(" images/",
" https://pytopo.readthedocs.io/en/latest/_images/")
def get_version():
'''Read the pytopo module versions from pytopo/__init__.py'''
with open("pytopo/__init__.py") as fp:
for line in fp:
line = line.strip()
if line.startswith("__version__"):
versionpart = line.split("=")[-1] \
.strip().replace('"', '').replace("'", '')
if versionpart.startswith('"') or versionpart.startswith("'"):
versionpart = versionpart[1:]
if versionpart.endswith('"') or versionpart.endswith("'"):
versionpart = versionpart[:-1]
return versionpart
long_description = file_contents("README.rst")
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system('rm -vrf ./build ./dist ./*.pyc ./*.tgz ./*.egg-info ./docs/sphinxdoc/_build')
setup(name='pytopo',
packages=['pytopo'],
version=get_version(),
description='Tiled map viewer and track editor',
long_description=long_description,
long_description_content_type="text/x-rst",
author='Akkana Peck',
author_email='[email protected]',
license="GPLv2+",
url='http://shallowsky.com/software/topo/',
zip_safe=False,
# Data files.
# This only works if the data files are inside the package directory,
# i.e. from here they have to be in pytopo/resources, not just resources.
include_package_data=True,
entry_points={
# This probably should be gui_scripts according to some
# pages I've found, but the official documentation
# discusses console_scripts and doesn't mention gui_scripts.
# On Linux they're the same, but on Windows, console_scripts
# bring up a terminal, gui_scripts don't.
'gui_scripts': [
'pytopo=pytopo.MapViewer:main',
],
'console_scripts': [
'ellie=pytopo.trackstats:main',
'degreeconv=pytopo.MapUtils:main'
],
},
project_urls={
'Source Code': 'https://github.com/akkana/pytopo/',
'Documentation': 'https://pytopo.readthedocs.io/',
'Bug Tracker': 'https://github.com/akkana/pytopo/issues',
},
install_requires=["PyGObject", "pycairo",
"requests-futures",
"simplejson"],
# numpy and matplotlib are optional dependencies for ellie,
# but there doesn't seem to be any way for a user to see this.
extras_require={
'elliplots': ["numpy", "matplotlib"],
},
keywords=['maps', 'map viewer', 'track files', 'track logs',
'GPX', 'KML', "GeoJSON"],
classifiers = [
'Programming Language :: Python :: 3',
'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Science/Research',
'Topic :: Scientific/Engineering :: GIS',
],
cmdclass={
'clean': CleanCommand,
}
)