Merge pull request #2254 from shimwell/cython_is_build_requirment

assume cython is installed
This commit is contained in:
Paul Romano 2022-10-12 18:28:29 +02:00 committed by GitHub
commit 98322dfeb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5,11 +5,7 @@ import sys
import numpy as np
from setuptools import setup, find_packages
try:
from Cython.Build import cythonize
have_cython = True
except ImportError:
have_cython = False
from Cython.Build import cythonize
# Determine shared library suffix
@ -76,13 +72,9 @@ kwargs = {
'test': ['pytest', 'pytest-cov', 'colorama'],
'vtk': ['vtk'],
},
# Cython is used to add resonance reconstruction and fast float_endf
'ext_modules': cythonize('openmc/data/*.pyx'),
'include_dirs': [np.get_include()]
}
# If Cython is present, add resonance reconstruction and fast float_endf
if have_cython:
kwargs.update({
'ext_modules': cythonize('openmc/data/*.pyx'),
'include_dirs': [np.get_include()]
})
setup(**kwargs)