-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
90 lines (79 loc) · 2.68 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
#!/usr/bin/env python
from setuptools import setup
from numpy.distutils.core import Extension
import os
def get_version():
with open("dynamix/__init__.py", "r") as fid:
lines = fid.readlines()
version = None
for line in lines:
if "version" in line:
version = line.rstrip().split("=")[-1].lstrip()
if version is None:
raise RuntimeError("Could not find version from __init__.py")
version = version.strip("'").strip('"')
return version
def setup_package():
version = get_version()
packages_folders = [
"correlator",
"resources",
"io",
"plot",
"tools",
"cli",
]
ext = [Extension(name='dynamix.correlator.WXPCS',
sources=['dynamix/correlator/WXPCS/fecorr.f',
'dynamix/correlator/WXPCS/fecorrt.f',
'dynamix/correlator/WXPCS/droplet3.f',
'dynamix/correlator/WXPCS/dropimgood.f',
'dynamix/correlator/WXPCS/eigerpix.f'],
# f2py_options=['--verbose'])
)]
packages = ["dynamix", "dynamix.test"]
package_dir = {"dynamix": "dynamix",
"dynamix.test": "dynamix/test"}
for f in packages_folders:
modulename = f"dynamix.{f}"
packages.append(modulename)
package_dir[modulename] = os.path.join("dynamix", f)
module_test_dirname = os.path.join(package_dir[modulename], "test")
if os.path.isdir(module_test_dirname):
modulename_test = str("%s.test" % modulename)
packages.append(modulename_test)
package_dir[modulename_test] = module_test_dirname
setup(
name='dynamix',
author='Pierre Paleo, Jerome Kieffer',
maintainer='Pierre Paleo, Jerome Kieffer',
version=version,
author_email = "pierre.paleo@esrf.fr",
maintainer_email = "pierre.paleo@esrf.fr",
url='https://github.com/silx-kit/dynamix',
packages=packages,
package_dir = package_dir,
package_data = {
'dynamix.resources': [
'opencl/*.cl',
]
},
ext_modules=ext,
install_requires = [
'numpy',
'pyopencl',
],
long_description = """
dynamix - software for X-ray photon correlation spectroscopy
""",
entry_points = {
'console_scripts': [
"xpcs=dynamix.cli.xpcs_ini:main",
"beam_center=dynamix.cli.beam_center:main",
"qmask=dynamix.cli.qmask_ini:main",
],
},
zip_safe=True
)
if __name__ == "__main__":
setup_package()