-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
executable file
·54 lines (40 loc) · 1.5 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
#!/usr/bin/env python
# For ciao installed using ciao-install:
#
# python setup.py build -e "/usr/bin/env python" install --prefix "$ASCDS_INSTALL/contrib"
#
# For ciao installed using conda
#
# python setup.py install
import os
import sys
assert "ASCDS_INSTALL" in os.environ, "Please setup for CIAO before installing"
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='color_color',
version='4.13.0',
description='CIAO color color (hardness ratio) diagram',
author='Kenny Glotfelty',
author_email='glotfeltyk@si.edu',
url='https://github.com/kglotfelty/ColorColor/',
py_modules=["color_color",],
scripts = ["color_color",],
data_files = [ ("param", ["color_color.par",]),
('share/doc/xml',['color_color.xml',])
],
cmdclass={'install': InstallAhelpWrapper},
)