forked from DiamondLightSource/Savu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
126 lines (108 loc) · 4.58 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import os
import sys
import shutil
from setuptools import setup, find_packages
__version__ = None
__install__ = None
# loading the above parameters into the namespace from version.py
savu_path = os.path.abspath(os.path.dirname(__file__))
with open(savu_path + '/savu/version.py') as f:
exec(f.read())
install_pkg = '.'.join(__install__.split('/'))
def readme():
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'README.rst')) as f:
return f.read()
facility = 'dls'
facility_path = 'mpi/dls'
def _create_new_facility(facility_path):
# if the folder doesn't exist then create it and add two template scripts
path = os.path.join(os.path.dirname(os.path.realpath(__file__)))
facility_path = path+'/'+facility_path
print "the facility path is", facility_path
if not os.path.exists(facility_path):
template_path = path+'/mpi/templates'
print "Creating the directory...", facility_path
os.makedirs(facility_path)
print "Adding templates to the new directory..."
shutil.copy(template_path+'/savu_launcher.sh', facility_path)
shutil.copy(template_path+'/savu_mpijob.sh', facility_path)
if '--facility' in sys.argv:
index = sys.argv.index('--facility')
sys.argv.pop(index)
facility = sys.argv.pop(index)
facility_path = 'mpi/'+facility
_create_new_facility(facility_path)
if '--help' in sys.argv:
print('To package for a facility use "--facility <facilityname> eg: python'
'setup.py install --facility dls [Default facilityname is dls]')
def _get_packages():
others = ['scripts',
'scripts.config_generator',
'scripts.log_evaluation',
'scripts.citation_extractor',
'install',
install_pkg,
install_pkg + '.conda-recipes',
'test_data',
'lib',
'mpi',
'plugin_examples']
return find_packages() + others
setup(name='savu',
version=__version__,
description='Savu Python Tomography Pipeline',
long_description=readme(),
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 2.7',
'Topic :: Scientific/Engineering'
'Operating System :: POSIX :: Linux'
],
author='Mark Basham',
author_email='scientificsoftware@diamond.ac.uk',
license='Apache License, Version 2.0',
packages=_get_packages(),
# the line below breaks the build of the docs and it is not sufficient
# to install Savu anyway... Nic
#install_requires=['pyreadline','colorama','h5py','mpi4py'],
scripts=[facility_path+'/savu_launcher.sh',
facility_path+'/savu_mpijob.sh',
facility_path+'/savu_mpijob_local.sh',
__install__ + '/tests/test_setup.sh',
__install__ + '/tests/mpi_cpu_test.sh',
__install__ + '/tests/mpi_gpu_test.sh',
__install__ + '/tests/local_mpi_cpu_test.sh',
__install__ + '/tests/local_mpi_gpu_test.sh'],
entry_points={'console_scripts': [
'savu_config=scripts.config_generator.savu_config:main',
'savu=savu.tomo_recon:main',
'savu_quick_tests=savu:run_tests',
'savu_full_tests=savu:run_full_tests',
'savu_citations=scripts.citation_extractor.citation_extractor:main',
'savu_profile=scripts.log_evaluation.GraphicalThreadProfiler:main',],},
package_data={'test_data': [
'data/*',
'process_lists/*',
'test_process_lists/*',
'test_process_lists/vo_centering_test/*',
'data/i12_test_data/*',
'data/I18_test_data/*',
'data/image_test/*',
'data/image_test/tiffs/*'],
'lib': ['*.so'],
'mpi': ['dls/*.sh'],
'install': ['*.txt'],
__install__: ['*.txt'],
install_pkg + '.conda-recipes': [
'hdf5/*',
'h5py/*',
'savu/*',
'xraylib/*',
'astra/*',
'mpi4py/*']},
include_package_data=True,
zip_safe=False)