diff options
| author | Jason Madden <jamadden@gmail.com> | 2020-01-21 07:59:31 -0600 |
|---|---|---|
| committer | Jason Madden <jamadden@gmail.com> | 2020-01-21 09:38:45 -0600 |
| commit | e76d03f51909c2b3f8cdad38eb91fa5f523b5e2e (patch) | |
| tree | ba6babf07a9512520d0c5fa885b983dc3188a4ef /setup.py | |
| parent | efc83ea76655733d56e8b5b4a6ad9971776a8611 (diff) | |
| download | zope-interface-e76d03f51909c2b3f8cdad38eb91fa5f523b5e2e.tar.gz | |
Test PURE_PYTHON at runtime.
Turns out that the C extensions build and work fine with PyPy, but don't use them by default. Let them
be forced, though.
Tests needed some refactoring to account for the various permutations.
Diffstat (limited to 'setup.py')
| -rw-r--r-- | setup.py | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -20,7 +20,6 @@ """ import os -import platform import sys from distutils.errors import CCompilerError @@ -68,14 +67,12 @@ codeoptimization = [ [os.path.normcase(codeoptimization_c)] ), ] -py_impl = getattr(platform, 'python_implementation', lambda: None) -is_pypy = py_impl() == 'PyPy' + is_jython = 'java' in sys.platform -# Jython cannot build the C optimizations, while on PyPy they are -# anti-optimizations (the C extension compatibility layer is known-slow, -# and defeats JIT opportunities). -if is_pypy or is_jython: +# Jython cannot build the C optimizations. Everywhere else, +# including PyPy, defer the decision to runtime. +if is_jython: ext_modules = [] else: ext_modules = codeoptimization |
