Commit 4bd7e1a2 authored by Markus Holzer's avatar Markus Holzer
Browse files

Generalise setup.py

parent 0981f209
Pipeline #30868 passed with stage
in 7 minutes and 39 seconds
......@@ -61,13 +61,13 @@ def cython_extensions(*extensions):
from distutils.extension import Extension
if USE_CYTHON:
ext = '.pyx'
result = [Extension(e, [e.replace('.', '/') + ext]) for e in extensions]
result = [Extension(e, [os.path.join(*e.split(".")) + ext]) for e in extensions]
from Cython.Build import cythonize
result = cythonize(result, language_level=3)
return result
elif all([os.path.exists(e.replace('.', '/') + '.c') for e in extensions]):
elif all([os.path.exists(os.path.join(*e.split(".")) + '.c') for e in extensions]):
ext = '.c'
result = [Extension(e, [e.replace('.', '/') + ext]) for e in extensions]
result = [Extension(e, [os.path.join(*e.split(".")) + ext]) for e in extensions]
return result
else:
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment