-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·121 lines (105 loc) · 4.47 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
#!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import subprocess
from setuptools import Distribution, setup, find_packages
from setuptools.extension import Extension
# Fetch numpy and Cython as build dependencies.
Distribution().fetch_build_eggs(['numpy', 'Cython'])
# Safe to import here after line above.
import numpy
from Cython.Build import cythonize
def find_version():
try:
short_hash = subprocess.check_output(
['git', 'rev-parse', '--short', 'HEAD'],
stderr=subprocess.STDOUT
)
except (FileNotFoundError, subprocess.CalledProcessError):
return None
else:
if short_hash.startswith(b'fatal'):
return None
else:
return short_hash.decode('ascii').strip()
setup(
name='metro-sci',
version=find_version() or 'dev',
author='Philipp Schmidt',
author_email='[email protected]',
description='Framework for experimental control, data acquisition and '
'online analysis of scientific experiments',
package_dir={'': 'src'},
packages=find_packages('src'),
package_data={
'': ['*.ui', '*.qml'],
'metro.frontend': ['logo.png', 'Symbola.ttf']
},
entry_points={
'console_scripts': [
'metro = metro.main:start_regular',
'metro2hdf = metro.metro2hdf:main'
],
'metro.device': [
f'{entry_point} = metro.devices.{entry_point}:Device'
for entry_point
in [
'analyze.angular_integrate', 'analyze.fit1d',
'analyze.moving_avg', 'analyze.scan_matrix',
'analyze.seq_cov',
'display.fast_plot', 'display.hist1d', 'display.hist2d',
'display.image', 'display.ogl_plot', 'display.plot',
'display.polar_plot', 'display.sorted', 'display.value',
'display.waveform',
'project.generic2d', 'project.window',
'util.measure_blocks', 'util.memory',
'util.serial_scan_server', 'util.ui_web_proxy',
'util.debug.arguments', 'util.debug.dependencies',
'util.debug.exception', 'util.debug.fail',
'util.debug.simple_device',
'util.simulate.camera', 'util.simulate.indicators',
'util.simulate.logging', 'util.simulate.manual_operators',
'util.simulate.point_pos', 'util.simulate.random_vector',
'util.simulate.scalar_abstract', 'util.simulate.scalar_manual',
'util.simulate.simple_detector',
'util.simulate.static_waveform', 'util.simulate.vbeamline',
'util.simulate.vdetector_abstract',
'util.simulate.vdetector_manual'
]
],
'metro.display_device': [
f'display.{entry_point} = devices.display.{entry_point}:Device'
for entry_point
in [
'fast_plot', 'hist1d', 'hist2d', 'image', 'plot',
'polar_plot', 'sorted', 'value', 'waveform'
]
]
},
ext_modules=cythonize([
Extension('metro.devices.analyze._seq_cov_native',
['src/metro/devices/analyze/_seq_cov_native.pyx'],
include_dirs=[numpy.get_include()]),
Extension('metro.devices.display._fast_plot_native',
['src/metro/devices/display/_fast_plot_native.pyx'],
include_dirs=[numpy.get_include()]),
Extension('metro.devices.display._hist2d_native',
['src/metro/devices/display/_hist2d_native.pyx'],
include_dirs=[numpy.get_include()]),
], language_level=3, build_dir='build'),
python_requires='>=3.6',
install_requires=['typing', 'PyQt5', 'numpy', 'scipy', 'h5py', 'xarray'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Environment :: Console',
'Environment :: Win32 (MS Windows)'
'Environment :: X11 Applications :: Qt',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Scientific/Engineering :: Physics',
]
)