forked from sharppy/SHARPpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
111 lines (94 loc) · 4.62 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
105
106
107
108
109
110
111
import os, sys, shutil, glob, getpass, platform
from setuptools import setup, find_packages
import versioneer
pkgname = "SHARPpy"
### GET VERSION INFORMATION ###
setup_path = os.path.split(os.path.abspath(__file__))[0]
sys.path.append(os.path.join(setup_path, pkgname.lower()))
#import _sharppy_version as version
#version.write_git_version()
#ver = version.get_version().split("+")[0]
sys.path.pop()
### ACTUAL SETUP VALUES ###
name = pkgname
#version = ver
author = "Patrick Marsh, Kelton Halbert, Greg Blumberg, and Tim Supinie"
description = "Sounding/Hodograph Analysis and Research Program for Python"
long_description = "SHARPpy is a collection of open source sounding and hodograph analysis routines, a sounding plotting package, and an interactive, cross-platform application for analyzing real-time soundings all written in Python. It was developed to provide the atmospheric science community a free and consistent source of sounding analysis routines. SHARPpy is constantly updated and vetted by professional meteorologists and climatologists within the scientific community to help maintain a standard source of sounding routines."
license = "BSD"
keywords = "meteorology soundings analysis"
url = "https://github.com/sharppy/SHARPpy"
packages = ['sharppy', 'sharppy.databases', 'sharppy.io', 'sharppy.sharptab', 'sharppy.viz', 'sutils', 'datasources', 'sharppy.plot', 'runsharp']
package_data = {"": ["*.md", "*.txt", "*.png", "databases/sars/hail/*", "databases/sars/supercell/*",
"databases/shapefiles/*", "../rc/*", "../datasources/*.xml", "../datsources/*.csv", "*.csv", "*.xml"],}
include_package_data = True
#install_requires = []
install_requires = ['python-dateutil', 'requests', 'numpy>=1.15', 'qtpy']
# Because pip doesn't recognize it when PySide is installed by conda from conda-forge
# Try to import PySide. If it fails, add the PySide to the install_requires
# Because of this, the conda meta.yaml will require PySide to build SHARPpy
#try:
# import qtpy
# print("Success importing PySide")
#except:
# install_requires.append("PySide2==5.12.*")
entry_pts = {"console_scripts": ['sharppy = runsharp.full_gui:main'] }
# Create some directory variables to shorten the lines.
HOME_PATH = os.path.join(os.path.expanduser("~"), ".sharppy")
HOME_DSDIR = os.path.join(HOME_PATH, "datasources")
SRC_DSDIR = os.path.join(os.path.dirname(__file__), "datasources")
## if the settings directory does not exist, create it and copy the necessary resources
if not os.path.exists(HOME_PATH):
os.makedirs(HOME_PATH)
shutil.copytree(SRC_DSDIR, HOME_DSDIR)
## if a datasource XML file exits, we don't want to overwrite it, so copy it to a different file first
if os.path.exists(os.path.join(HOME_DSDIR, "standard.xml")):
shutil.copy(os.path.join(HOME_DSDIR, "standard.xml"),
os.path.join(HOME_DSDIR, "standard.xml.old"))
## copy over other XML files
XMLs = glob.glob(os.path.join(SRC_DSDIR, "*.xml"))
for xml in XMLs:
shutil.copy(xml, os.path.join(HOME_DSDIR, os.path.basename(xml)))
## copy over the standard CSV files
CSVs = glob.glob(os.path.join(SRC_DSDIR, "*.csv"))
for csv in CSVs:
shutil.copy(csv, os.path.join(HOME_DSDIR, os.path.basename(csv)))
if os.path.exists(os.path.join(HOME_DSDIR, "available.py")):
# Copy over available.py
shutil.copy(os.path.join(HOME_DSDIR, "available.py"),
os.path.join(HOME_DSDIR, "available.py.old"))
shutil.copy(os.path.join(SRC_DSDIR, "available.py"),
os.path.join(HOME_DSDIR, "available.py"))
if os.path.exists(os.path.join(HOME_DSDIR, "data_source.py")):
# Copy over data_source.py
shutil.copy(os.path.join(HOME_DSDIR, "data_source.py"),
os.path.join(HOME_DSDIR, "data_source.py.old"))
shutil.copy(os.path.join(SRC_DSDIR, "data_source.py"),
os.path.join(HOME_DSDIR, "data_source.py"))
ver = versioneer.get_version()
ver = ver.split('-')[0]
if 'a' in ver:
classifiers = ["Development Status :: 3 - Alpha"]
elif 'b' in ver:
classifiers = ["Development Status :: 4 - Beta"]
else:
classifiers = ["Development Status :: 5 - Production/Stable"]
setup(
name = name,
author = author,
author_email = author_email,
description = description,
long_description = long_description,
license = license,
keywords = keywords,
url = url,
packages = packages,
package_data = package_data,
include_package_data = include_package_data,
classifiers = classifiers,
version=ver,
cmdclass=versioneer.get_cmdclass(),
install_requires=install_requires,
entry_points = entry_pts
)