forked from ubccr/supremm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
82 lines (75 loc) · 3.26 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
75
76
77
78
79
80
81
82
#!/usr/bin/env python
""" setup script for SUPReMM job summarization utilities """
from setuptools import setup, find_packages, Extension
import sys
import os
import numpy
from Cython.Build import cythonize
# For rpm-based builds want the configuration files to
# go in the standard location. Also need to rewrite the file list so that
# the config filesa are listed as %config(noreplace)
IS_RPM_BUILD = False
if 'bdist_rpm' in sys.argv or 'RPM_BUILD_ROOT' in os.environ:
IS_RPM_BUILD = True
confpath = '/etc/supremm'
with open('.rpm_install_script.txt', 'w') as fp:
fp.write('%s %s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES\n' % (sys.executable, os.path.basename(sys.argv[0])))
fp.write('sed -i \'s#^\\(%s\\)#%%config(noreplace) \\1#\' INSTALLED_FILES\n' % (confpath, ))
else:
confpath = 'etc/supremm'
setup(
name='supremm',
version='1.4.1',
description='SUPReMM Job Summarization Utilities',
long_description='Utilities for generating job-level summary data from host level PCP archives.\nAlso includes template configuration files for running PCP on an HPC system.',
license='LGPLv3',
author='Joseph P White',
author_email='jpwhite4@buffalo.edu',
url='https://github.com/ubccr/supremm',
zip_safe=False,
package_dir={'': 'src'},
packages=find_packages(where='src'),
package_data={
'supremm': ['assets/modw_supremm.sql', 'assets/mongo_setup.js', '*.pxd', '*.pyx'],
'supremm.pcpcinterface': ['*.pxd', '*.pyx'],
'supremm.pypmlogextract': ['*.pxd', '*.pyx']
},
data_files=[
(confpath, ['config/config.json']),
('share/supremm/templates/slurm', ['config/templates/slurm/slurm-epilog', 'config/templates/slurm/slurm-prolog']),
('share/supremm/templates/pcp-4.3.x/hotproc', ['config/templates/pcp-4.3.x/hotproc/hotproc.conf']),
('share/supremm/templates/pcp-4.3.x/pmlogger', ['config/templates/pcp-4.3.x/pmlogger/control', 'config/templates/pcp-4.3.x/pmlogger/pmlogger-supremm.config'])
],
scripts=[
'src/supremm/supremm_update'
],
entry_points={
'console_scripts': [
'gen-pmlogger-control.py = supremm.gen_pmlogger_control:main',
'summarize_jobs.py = supremm.summarize_jobs:main',
'summarize_mpi.py = supremm.summarize_mpi:main',
'indexarchives.py = supremm.indexarchives:runindexing',
'account.py = supremm.account:runingest',
'supremmconf.py = supremm.supremmconf:main',
'supremm-setup = supremm.supremm_setup:main',
'supremm-upgrade = supremm.supremm_upgrade:main',
'ingest_jobscripts.py = supremm.ingest_jobscripts:main'
]
},
install_requires=[
'numpy',
'MySQL-python',
'pcp',
'Cython',
'scipy',
'pymongo',
'pytz',
'tzlocal'
],
ext_modules=cythonize([
Extension("supremm.pcpcinterface.pcpcinterface", ["src/supremm/pcpcinterface/pcpcinterface.pyx"], libraries=["pcp"], include_dirs=[numpy.get_include()]),
Extension("supremm.pypmlogextract.pypmlogextract", ["src/supremm/pypmlogextract/pypmlogextract.pyx"])
])
)
if IS_RPM_BUILD:
os.unlink('.rpm_install_script.txt')