-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (56 loc) · 1.83 KB
/
Copy pathsetup.py
File metadata and controls
61 lines (56 loc) · 1.83 KB
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
import os
import numpy
from setuptools import find_packages, setup
from distutils.extension import Extension
from Cython.Build import cythonize
# Get README
with open("README.md", "r") as fh:
long_description = fh.read()
# Execute version.py and recover globals
version_globals = {}
with open("stateye/version.py") as fp:
exec(fp.read(), version_globals)
with open("requirements.txt") as fr:
requirements = fr.read().splitlines()
cython_files = [
("xiaolin_wu", ("stateye", "xiaolin_wu.pyx")),
("ideal_cdr", ("stateye", "ideal_cdr.pyx")),
("measurements.utilities", ("stateye", "measurements", "utilities.pyx")),
]
extensions = []
for name, source in cython_files:
extensions.append(
Extension(
f"stateye.{name}",
[os.path.join(*source)],
include_dirs=[numpy.get_include()],
language="c++",
extra_compile_args=["-ffast-math"],
)
)
# Package data
setup(
name="stateye",
version=version_globals["__version__"],
packages=find_packages(),
include_package_data=True,
author="Ayar Labs",
description="Project for analyzing time-series data from link models or "
"measurements. Generates eye diagrams, extracts statistics, "
"and contains useful plotting utilities.",
long_description=long_description,
long_description_content_type="text/markdown",
url="http://noether.ayarlabs.com/link-model/stateye",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
install_requires=requirements,
python_requires=">=3.6",
ext_modules=cythonize(
extensions, annotate=True
), # annotate can be set to False to suppress cython HTMLs
include_dirs=[numpy.get_include()],
zip_safe=False,
)