diff --git a/pyproject.toml b/pyproject.toml index c336af4da..29eb691d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,6 +59,9 @@ zip-safe = true [tool.setuptools.packages.find] where = ['src'] +[tool.setuptools.package-data] +'stcal.ramp_fitting.src' = ['*.c'] + [tool.pytest.ini_options] minversion = 4.6 doctest_plus = true diff --git a/setup.py b/setup.py index 5265a7231..9a2ebbd9d 100644 --- a/setup.py +++ b/setup.py @@ -1,38 +1,32 @@ from setuptools import setup, find_packages, Extension -# from Cython.Build import cythonize -# from Cython.Compiler import Options +from Cython.Build import cythonize +from Cython.Compiler import Options import numpy as np -''' Options.docstrings = True Options.annotate = False -extensions = [Extension('stcal.ramp_fitting.ols_cas22', - ['src/stcal/ramp_fitting/ols_cas22.pyx'], - include_dirs=[np.get_include()], - extra_compile_args=['-std=c99'])] - include_dirs=[np.get_include()])] -''' - -# package_data values are glob patterns relative to each specific subpackage. -package_data = { - "stcal.ramp_fitting.src": ["*.c"], -} - # Setup C module include directories include_dirs = [np.get_include()] # Setup C module macros define_macros = [("NUMPY", "1")] +extensions = [ + Extension( + 'stcal.ramp_fitting.ols_cas22', + ['src/stcal/ramp_fitting/ols_cas22.pyx'], + include_dirs=include_dirs, + extra_compile_args=['-std=c99'] + ), + Extension( + "stcal.ramp_fitting.slope_fitter", + ["src/stcal/ramp_fitting/src/slope_fitter.c"], + include_dirs=include_dirs, + define_macros=define_macros, + ), +] + setup( - ext_modules=[ - Extension( - "stcal.ramp_fitting.slope_fitter", - ["src/stcal/ramp_fitting/src/slope_fitter.c"], - include_dirs=include_dirs, - define_macros=define_macros, - ), - # cythonize(extensions), - ], + ext_modules=cythonize(extensions), )