-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor setup.py to compile cython extensions with NPY_NO_DEPRECATED…
…_API defined
- Loading branch information
Showing
1 changed file
with
27 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
import os | ||
|
||
import numpy as np | ||
from Cython.Build import cythonize | ||
from setuptools import setup | ||
|
||
build_sequences_module = cythonize( | ||
os.path.join("wholecell", "utils", "_build_sequences.pyx"), | ||
) | ||
|
||
setup( | ||
name = "Build sequences", | ||
ext_modules = build_sequences_module, | ||
include_dirs = [np.get_include()], | ||
) | ||
|
||
complexation_module = cythonize( | ||
os.path.join("wholecell", "utils", "mc_complexation.pyx"), | ||
) | ||
|
||
setup( | ||
name = "Monte-carlo complexation", | ||
ext_modules = complexation_module, | ||
include_dirs = [np.get_include()], | ||
) | ||
from setuptools import Extension, setup | ||
|
||
fast_polymerize_sums_module = cythonize( | ||
os.path.join("wholecell", "utils", "_fastsums.pyx"), | ||
) | ||
# List of your Cython extension modules | ||
extensions = [ | ||
Extension( | ||
"wholecell.utils._build_sequences", | ||
[os.path.join("wholecell", "utils", "_build_sequences.pyx")], | ||
include_dirs=[np.get_include()], | ||
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], | ||
), | ||
Extension( | ||
"wholecell.utils.mc_complexation", | ||
[os.path.join("wholecell", "utils", "mc_complexation.pyx")], | ||
include_dirs=[np.get_include()], | ||
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], | ||
), | ||
Extension( | ||
"wholecell.utils._fastsums", | ||
[os.path.join("wholecell", "utils", "_fastsums.pyx")], | ||
include_dirs=[np.get_include()], | ||
define_macros=[('NPY_NO_DEPRECATED_API', 'NPY_1_7_API_VERSION')], | ||
), | ||
] | ||
|
||
# Use cythonize on the extensions list | ||
setup( | ||
name = "Fast polymerize sums", | ||
ext_modules = fast_polymerize_sums_module, | ||
include_dirs = [np.get_include()], | ||
) | ||
name="Vivarium Ecoli Extensions", | ||
ext_modules=cythonize(extensions), | ||
include_dirs=[np.get_include()], | ||
) |