forked from MITHaystack/digital_rf
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py.in
111 lines (97 loc) · 3.61 KB
/
setup.py.in
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
# ----------------------------------------------------------------------------
# Copyright (c) 2017 Massachusetts Institute of Technology (MIT)
# All rights reserved.
#
# Distributed under the terms of the BSD 3-clause license.
#
# The full license is in the LICENSE file, distributed with this software.
# ----------------------------------------------------------------------------
"""Setup file for the digital_rf package."""
from setuptools import setup, Extension
from setuptools.command.build_py import build_py
import os
import numpy
# to use a consistent encoding
from codecs import open
# Get the long description from the README file
with open(
os.path.join('${CMAKE_CURRENT_SOURCE_DIR}', 'README.rst'),
encoding='utf-8',
) as f:
long_description = f.read()
def write_version_py(path):
with open(os.path.join(path, '_version.py'), 'w') as f:
# write version substituted from CMake
f.write("__version__ = '${digital_rf_VERSION}'\n")
class build_py_with_version(build_py):
def run(self):
# call parent method (distutils uses old-style classes, so no super())
build_py.run(self)
# honor the --dry-run flag
if not self.dry_run:
pkg_build_path = os.path.join(self.build_lib, 'digital_rf')
# mkpath is a distutils helper to create directories
self.mkpath(pkg_build_path)
write_version_py(pkg_build_path)
setup(
name='digital_rf',
version='${digital_rf_VERSION}',
description='Python tools to read and write Digital RF data in HDF5 format',
long_description=long_description,
# url='http://www.haystack.mit.edu/digital_rf/',
author='MIT Haystack Observatory',
# author_email='digital_rf@haystack.mit.edu',
license='BSD-3-Clause',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python',
'Topic :: Scientific/Engineering',
],
keywords='hdf5 radio rf',
install_requires=['h5py', 'numpy'],
extras_require={
'watchdog': ['watchdog'],
},
package_dir={
'digital_rf': '${CMAKE_CURRENT_SOURCE_DIR}/python',
},
packages=['digital_rf'],
ext_modules=[
Extension(
'digital_rf._py_rf_write_hdf5',
['${CMAKE_CURRENT_SOURCE_DIR}/lib/py_rf_write_hdf5.c'],
include_dirs=filter(None, [
'${CMAKE_CURRENT_BINARY_DIR}/include',
'${HDF5_INCLUDE_DIRS}',
numpy.get_include(),
]),
library_dirs=filter(None, [
'${CMAKE_CURRENT_BINARY_DIR}/lib',
'${HDF5_LIBRARY_DIR}',
]),
libraries=[
'digital_rf',
'hdf5',
],
),
],
entry_points= {
'console_scripts': ['drf=digital_rf.drf_command:main'],
},
scripts=[
'${CMAKE_CURRENT_SOURCE_DIR}/tools/digital_metadata_archive.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/digital_rf_archive.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/digital_rf_upconvert.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/drf_cross_sti.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/drf_plot.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/drf_sti.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/drf_sound.py',
'${CMAKE_CURRENT_SOURCE_DIR}/tools/verify_digital_rf_upconvert.py',
],
cmdclass={'build_py': build_py_with_version},
)