-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
49 lines (34 loc) · 1.43 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
import os
import sys
assert "ASCDS_INSTALL" in os.environ, "Please run this after CIAO has been setup"
scripts = ["contour_map","dragon_scales","vtbin","hexgrid","mkregmap","pathfinder",
"centroid_map", "merge_too_small", "map2reg"]
params = [ x+".par" for x in scripts]
docs = [ x+".xml" for x in scripts if os.path.exists(x+".xml")]
from setuptools import setup
from setuptools.command.install import install
class InstallAhelpWrapper(install):
'A simple wrapper to run ahelp -r after install to update ahelp index'
@staticmethod
def update_ahelp_database():
print("Update ahelp database ...")
from subprocess import check_output
sout = check_output(["ahelp","-r"])
for line in sout.decode().split("\n"):
for summary in ["Processed", "Succeeded", "Failed", "Purged"]:
if line.startswith(summary):
print(" "+line)
def run(self):
install.run(self)
self.update_ahelp_database()
setup( name='AdaptiveBin',
version='4.13.1',
description='Adaptive binning scripts',
author='Kenny Glotfelty',
author_email='glotfeltyk@si.edu',
url='https://github.com/kglotfelty/AdaptiveBin/',
scripts = scripts,
data_files = [ ("param", params ), ("share/doc/xml", docs ) ],
packages=["crates_contrib",],
cmdclass={'install': InstallAhelpWrapper},
)