@@ -42,35 +42,28 @@ def build_extension(self, ext):
42
42
if not isinstance (ext , IsalExtension ):
43
43
super ().build_extension (ext )
44
44
return
45
- # Import cython here because it should be installed by setup requires.
46
- from Cython .Build import cythonize
47
- cythonized_ext = cythonize (ext )[0 ]
48
- # _needs_stub is apparently not set elsewhere. It is not needed for
49
- # a functional isal extension.
50
- setattr (cythonized_ext , "_needs_stub" , False )
51
-
52
45
# Check for isa-l include directories. This is useful when installing
53
46
# in a conda environment.
54
47
possible_prefixes = [sys .exec_prefix , sys .base_exec_prefix ]
55
48
for prefix in possible_prefixes :
56
49
if os .path .exists (os .path .join (prefix , "include" , "isa-l" )):
57
- cythonized_ext .include_dirs = [
50
+ ext .include_dirs = [
58
51
os .path .join (prefix , "include" )]
59
52
break # Only one include directory is needed.
60
- cythonized_ext .libraries = ["isal" ]
53
+ ext .libraries = ["isal" ]
61
54
try : # First try to link dynamically
62
- super ().build_extension (cythonized_ext )
55
+ super ().build_extension (ext )
63
56
except CompileError :
64
57
# Dynamic linking failed, build ISA-L and link statically.
65
- cythonized_ext .libraries = [] # Make sure libraries are empty
58
+ ext .libraries = [] # Make sure libraries are empty
66
59
isa_l_prefix_dir = build_isa_l ()
67
- cythonized_ext .include_dirs = [os .path .join (isa_l_prefix_dir ,
60
+ ext .include_dirs = [os .path .join (isa_l_prefix_dir ,
68
61
"include" )]
69
62
# -fPIC needed for proper static linking
70
- cythonized_ext .extra_compile_args = ["-fPIC" ]
71
- cythonized_ext .extra_objects = [
63
+ ext .extra_compile_args = ["-fPIC" ]
64
+ ext .extra_objects = [
72
65
os .path .join (isa_l_prefix_dir , "lib" , "libisal.a" )]
73
- super ().build_extension (cythonized_ext )
66
+ super ().build_extension (ext )
74
67
75
68
76
69
# Use a cache to prevent isa-l from being build twice. According to the
@@ -132,7 +125,6 @@ def build_isa_l():
132
125
"License :: OSI Approved :: MIT License" ,
133
126
],
134
127
python_requires = ">=3.6" ,
135
- setup_requires = ["cython" ],
136
128
ext_modules = [
137
129
IsalExtension ("isal.isal_zlib" , ["src/isal/isal_zlib.pyx" ]),
138
130
IsalExtension ("isal._isal" , ["src/isal/_isal.pyx" ]),
0 commit comments