-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.py
136 lines (115 loc) · 3.88 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
126
127
128
129
130
131
132
133
134
135
136
from __future__ import absolute_import
import glob
import os.path
import sys
import setuptools
import setuptools.command.build_ext
import setuptools.command.test
import numpy
try:
import Cython.Build
__cython = True
except ImportError:
__cython = False
class Test(setuptools.command.test.test):
user_options = [("pytest-args=", "a", "Arguments to pass to py.test")]
def initialize_options(self):
setuptools.command.test.test.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
setuptools.command.test.test.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
if __cython:
__suffix = "pyx"
__extkwargs = {
"language": "c++",
# TODO: needed for cython 3.0
# "define_macros": [("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")]
}
else:
__suffix = "cpp"
__extkwargs = {}
__extensions = [
setuptools.Extension(
name="centrosome._propagate",
sources=[
"centrosome/_propagate.{}".format("c" if __suffix == "cpp" else __suffix)
],
# TODO: needed for cython 3.0
# define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")] if __suffix == "pyx" else None,
include_dirs=["centrosome/include", numpy.get_include()],
)
]
for pyxfile in glob.glob(os.path.join("centrosome", "*.pyx")):
name = os.path.splitext(os.path.basename(pyxfile))[0]
if name == "_propagate":
continue
__extensions += [
setuptools.Extension(
name="centrosome.{}".format(name),
sources=["centrosome/{}.{}".format(name, __suffix)],
include_dirs=["centrosome/include", numpy.get_include()],
**__extkwargs
)
]
if __suffix == "pyx":
__extensions = Cython.Build.cythonize(__extensions, compiler_directives={'language_level' : "3"})
setuptools.setup(
author="Nodar Gogoberidze",
author_email="[email protected]",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: C",
"Programming Language :: C++",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering",
],
cmdclass={"test": Test},
description="An open source image processing library",
ext_modules=__extensions,
extras_require={
"dev": ["black==19.10b0", "pre-commit==1.20.0"],
"test": ["pytest==5.2.2"],
},
install_requires=[
"deprecation",
"matplotlib>=3.1.3,<3.8",
# we don't depend on this directly but matplotlib does
# and does not put an upper pin on it
# if removing upper pin on scikit-image here,
# then delete contourpy as a dependency as well
"contourpy<1.2.0",
"numpy>=1.18.2,<2",
"scikit-image>=0.17.2,<0.22.0",
# we don't depend on this directly but scikit-image does
# and does not put an upper pin on it
# if removing upper pin on scikit-image here,
# then delete PyWavelets as a dependency as well
"PyWavelets<1.5",
"scipy>=1.4.1,<1.11",
],
tests_require=[
"pytest",
],
keywords="",
license="BSD",
long_description="",
name="centrosome",
packages=["centrosome"],
setup_requires=["cython", "numpy", "pytest",],
url="https://github.com/CellProfiler/centrosome",
version="1.2.3",
)