-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
62 lines (44 loc) · 1.47 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
"""
Create the CIAO contributed package. Options include:
--version=4.17.0
"""
import glob
import sys
import os
from setuptools import setup
def list_files(pattern):
"Return the giles in a directory, in a sorted list"
files = glob.glob(pattern)
# Remove *~ files (any other ones?) Could restrict to
# files stored in git?
#
files = [f for f in files if not (f.endswith('~') or f.startswith('flycheck_'))]
# Remove sub-directories
#
#
files = [f for f in files if not os.path.isdir(f)]
if files == []:
raise ValueError(f"No match for pattern: {pattern}")
return sorted(files)
VERSION = "4.17.0"
for val in sys.argv:
if val.startswith("--version="):
VERSION = val.split("=")[1]
sys.argv.remove(val)
break
scripts = list_files("bin/*")
# etc = list_files("etc/conda/activate.d/*")
data_files = [("param", list_files("param/*.par")),
("share/doc/xml", list_files("share/doc/xml/*.xml")),
("share/xspec/install", list_files("share/xspec/install/*cxx")),
("share/sherpa/notebooks", list_files("share/sherpa/notebooks/*ipynb")),
("config", list_files("config/*")),
("data", list_files("data/*")),
("data/ebounds-lut", list_files("data/ebounds-lut/*")),
(".", ["Changes.CIAO_scripts"])
]
setup(version=VERSION,
scripts=scripts,
# Note that data_files is deprecated
data_files=data_files,
)