summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-01-21 07:59:31 -0600
committerJason Madden <jamadden@gmail.com>2020-01-21 09:38:45 -0600
commite76d03f51909c2b3f8cdad38eb91fa5f523b5e2e (patch)
treeba6babf07a9512520d0c5fa885b983dc3188a4ef /setup.py
parentefc83ea76655733d56e8b5b4a6ad9971776a8611 (diff)
downloadzope-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.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/setup.py b/setup.py
index 0ffacaf..455fcc3 100644
--- a/setup.py
+++ b/setup.py
@@ -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