-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
executable file
·69 lines (63 loc) · 2.25 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
from distutils.core import setup
import subprocess
import glob
Version = "1.1.4"
p = subprocess.Popen(
("git",
"describe",
"--tags"),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
descr = p.stdout.readlines()[0].strip()
Version = "-".join(descr.split("-")[:-2])
if Version == "":
Version = descr
except:
descr = Version
p = subprocess.Popen(
("git",
"log",
"-n1",
"--pretty=short"),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
commit = str(p.stdout.readlines()[0].split()[1])
except:
commit = "unknown"
f = open("lib/version.py", "w")
print("__version__ = '%s'" % Version, file=f)
print("__git_tag_describe__ = '%s'" % descr, file=f)
print("__git_sha1__ = %s" % commit, file=f)
f.close()
# data_files = (
# ('share/EnsoMetrics', ['share/EnsoMetrics/basin_generic_1x1deg.nc']),
# )
data_files = (
(
'share/EnsoMetrics',
[
'share/EnsoMetrics/basin_generic_1x1deg.nc',
'share/EnsoMetrics/cmip5_historical_ENSO_perf_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/cmip5_historical_ENSO_proc_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/cmip5_historical_ENSO_tel_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/cmip6_historical_ENSO_perf_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/cmip6_historical_ENSO_proc_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/cmip6_historical_ENSO_tel_v20200427_allModels_allRuns.json',
'share/EnsoMetrics/obs2obs_historical_ENSO_perf_v20201231_allObservations.json',
'share/EnsoMetrics/obs2obs_historical_ENSO_proc_v20201231_allObservations.json',
'share/EnsoMetrics/obs2obs_historical_ENSO_tel_v20201231_allObservations.json'],
),
)
setup(name="EnsoMetrics",
author="Eric Guilyardi",
version=Version,
description = "Library for ENSO Metrics",
url="https://github.com/CLIVAR-PRP/ENSO_metrics",
packages=['EnsoMetrics', 'EnsoPlots'],
package_dir={'EnsoMetrics': 'lib', 'EnsoPlots': 'plots'},
scripts=glob.glob("scripts/*.py"),
data_files=data_files, requires=['numpy'])