forked from jmozmoz/cloudmap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
124 lines (109 loc) · 3.85 KB
/
setup.py
File metadata and controls
124 lines (109 loc) · 3.85 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
from __future__ import print_function
# from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
from setuptools import setup
from setuptools.command.install import install as _install
import os
import versioneer
import sys
import datetime
versioneer.VCS = 'git'
versioneer.versionfile_source = 'cloudmap/_version.py'
versioneer.versionfile_build = 'cloudmap/_version.py'
versioneer.tag_prefix = '' # tags are like 1.2.0
versioneer.parentdir_prefix = 'CreateCloudMap-'
def mkdir_p(path):
import errno
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
pass
else:
raise
def copy_config():
from shutil import copyfile, move
srcfiles = [
'CreateCloudMap.ini',
]
srcfiles_overwrite = [
'satellites.json'
]
dstdir = os.path.expanduser('~/.CreateCloudMap')
mkdir_p(dstdir)
for src in srcfiles:
dstfile = os.path.join(dstdir, src)
srcpath = os.path.join('cfg', src)
if not os.path.exists(dstfile):
copyfile(srcpath, dstfile)
else:
copyfile(srcpath, dstfile + '.new')
bak_date = datetime.datetime.now().strftime(
"%Y%m%d%H%M%S")
for src in srcfiles_overwrite:
dstfile = os.path.join(dstdir, src)
srcpath = os.path.join('cfg', src)
if not os.path.exists(dstfile):
copyfile(srcpath, dstfile)
else:
move(dstfile, dstfile + '.bak.' + bak_date)
copyfile(srcpath, dstfile)
class Install(_install):
def run(self):
_install.run(self)
copy_config()
cmdclass = versioneer.get_cmdclass()
cmdclass['install'] = Install
if sys.version_info >= (3, 2):
install_requires = ['pyresample', 'numpy', 'scipy', 'requests', 'datetime',
'pillow>=3.0.0', 'setuptools>=0.7.2',
'configparser>=3.5.0b1']
else:
install_requires = ['pyresample', 'numpy', 'scipy', 'requests', 'datetime',
'pillow>=3.0.0', 'setuptools>=0.7.2', 'configparser']
setup(
name='CreateCloudMap',
version=versioneer.get_version(),
packages=['cloudmap', ],
cmdclass=cmdclass,
license='GPL3',
description='Create a cloud map for xplanet using satellite images ' +
'from the Dundee Satellite Receiving Station',
long_description=open('README.rst').read(),
author='Joachim Herb',
author_email='Joachim.Herb@gmx.de',
url='https://github.com/jmozmoz/cloudmap',
install_requires=install_requires,
extras_require={
'cartopy': ["cartopy", "shapely", "pyshp"],
'debug_pyresample': ["basemap", "matplotlib"],
'debug_cartopy': ["cartopy", "shapely", "pyshp", "matplotlib"]
},
entry_points={
'console_scripts': [
'create_map = cloudmap.create_map:main',
]
},
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Topic :: Desktop Environment",
"Topic :: Multimedia :: Graphics",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering :: GIS",
"Topic :: Scientific/Engineering :: Visualization",
"Topic :: Utilities",
],
)