File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 21
21
CFLAGS = ''
22
22
LFLAGS = ''
23
23
24
+ allow_extensions = True
25
+ if '__pypy__' in sys .builtin_module_names :
26
+ print ('NOTICE: C extensions disabled on PyPy (would be broken)!' )
27
+ allow_extensions = False
28
+ if os .environ .get ('SETUPPY_FORCE_PURE' ):
29
+ print ('NOTICE: C extensions disabled (SETUPPY_FORCE_PURE)!' )
30
+ allow_extensions = False
31
+
24
32
25
33
class OptionalBuildExt (build_ext ):
26
34
"""
@@ -29,10 +37,6 @@ class OptionalBuildExt(build_ext):
29
37
30
38
def run (self ):
31
39
try :
32
- if '__pypy__' in sys .builtin_module_names :
33
- raise Exception ('C extensions are broken on PyPy!' )
34
- if os .environ .get ('SETUPPY_FORCE_PURE' ):
35
- raise Exception ('C extensions disabled (SETUPPY_FORCE_PURE)!' )
36
40
super ().run ()
37
41
except Exception as e :
38
42
self ._unavailable (e )
@@ -144,6 +148,8 @@ def read(*names, **kwargs):
144
148
include_dirs = [str (path .parent )],
145
149
)
146
150
for path in Path ('src' ).glob ('**/*.c' )
147
- ],
151
+ ]
152
+ if allow_extensions
153
+ else [],
148
154
distclass = BinaryDistribution ,
149
155
)
You can’t perform that action at this time.
0 commit comments