-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·74 lines (70 loc) · 3.44 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
from distutils.core import setup
import glob,subprocess
Version = "0.6.0"
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:
Version = "0.9.pre-release"
descr = Version
p = subprocess.Popen(("git","log","-n1","--pretty=short"),stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
try:
commit = p.stdout.readlines()[0].split()[1]
except:
commit = ""
f = open("src/python/version.py","w")
print >>f, "__version__ = '%s'" % Version
print >>f, "__git_tag_describe__ = '%s'" % descr
print >>f, "__git_sha1__ = '%s'" % commit
f.close()
portrait_files = ["src/python/graphics/share/portraits.scr",]
cmip5_amip_json = glob.glob("data/CMIP_metrics_results/CMIP5/amip/*.json")
cmip5_historical_json = glob.glob("data/CMIP_metrics_results/CMIP5/historical/*.json")
cmip5_piControl_json = glob.glob("data/CMIP_metrics_results/CMIP5/piControl/*.json")
demo_ACME_files = glob.glob("demo/ACME/*.py")
demo_CSIRO_files = glob.glob("demo/CSIRO/*.py")
demo_CSIRO_files += glob.glob("demo/CSIRO/*.png")
demo_CSIRO_files += glob.glob("demo/CSIRO/*.sh")
demo_GFDL_files = glob.glob("demo/GFDL/*.py")
demo_GFDL_files += glob.glob("demo/GFDL/*.png")
demo_NCAR_files = glob.glob("demo/NCAR/*.py")
param_files = glob.glob("doc/parameter_files/*.py")
setup (name = 'pcmdi_metrics',
version = descr,
author = 'PCMDI',
description = 'model metrics tools',
url = 'http://github.com/PCMDI/pcmdi_metrics',
packages = ['pcmdi_metrics','pcmdi_metrics.io','pcmdi_metrics.pcmdi','pcmdi_metrics.graphics', 'pcmdi_metrics.ipsl'],
package_dir = {'pcmdi_metrics': 'src/python',
'pcmdi_metrics.io': 'src/python/io',
'pcmdi_metrics.ipsl': 'src/python/ipsl',
'pcmdi_metrics.pcmdi': 'src/python/pcmdi',
'pcmdi_metrics.graphics': 'src/python/graphics',
},
scripts = ['src/python/pcmdi/scripts/pcmdi_metrics_driver.py'],
data_files = [('demo/ACME',demo_ACME_files),
('demo/CSIRO',demo_CSIRO_files),
('demo/GFDL',demo_GFDL_files),
('demo/NCAR',demo_NCAR_files),
('doc/parameter_files',param_files),
('doc',('doc/parameter_files/pcmdi_input_parameters_sample.py','doc/simple_json_test.py',)),
('share/CMIP_metrics_results/CMIP5/amip',cmip5_amip_json),
('share/CMIP_metrics_results/CMIP5/historical',cmip5_historical_json),
('share/CMIP_metrics_results/CMIP5/piControl',cmip5_piControl_json),
('share/graphics/vcs',portrait_files),
('share/pcmdi',('doc/obs_info_dictionary.json',)),
]
#include_dirs = [numpy.lib.utils.get_include()],
#ext_modules = [
# Extension('pcmdi_metrics.exts',
# ['src/C/add.c',],
# library_dirs = [],
# libraries = [],
# define_macros = [],
# extra_compile_args = [],
# extra_link_args = [],
# ]
)