forked from sharppy/SHARPpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
80 lines (66 loc) · 2.86 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
import os, sys, shutil, glob, getpass, platform
from setuptools import setup, find_packages
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 = ""
license = "BSD"
keywords = "meteorology soundings analysis"
url = "https://github.com/sharppy/SHARPpy"
packages = ['sharppy', 'sharppy.databases', 'sharppy.io', 'sharppy.sharptab', 'sharppy.viz', 'utils', 'datasources']
package_data = {"": ["*.md", "*.txt", "*.png", "databases/sars/hail/*", "databases/sars/supercell/*",
"databases/shapefiles/*"],}
include_package_data = True
classifiers = ["Development Status :: 4 - Beta"]
# 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 and data_source.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"))
setup(
name = name,
version = version,
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
)