Commit bfbb147b authored by Jason Madden's avatar Jason Madden

Don't even attempt to build the C modules on PyPy

parent a920e380
......@@ -19,6 +19,8 @@
"""Setup for zope.container package
"""
import os
import platform
import sys
from setuptools import setup, find_packages, Extension
def read(*rnames):
......@@ -39,6 +41,22 @@ def alltests():
suites = list(zope.testrunner.find.find_suites(options))
return unittest.TestSuite(suites)
# PyPy cannot correctly build the C optimizations, and even if it
# could they would be anti-optimizations (the C extension
# compatibility layer is known-slow, and defeats JIT opportunities).
py_impl = getattr(platform, 'python_implementation', lambda: None)
pure_python = os.environ.get('PURE_PYTHON', False)
is_pypy = py_impl() == 'PyPy'
if pure_python or is_pypy:
ext_modules = []
else:
ext_modules = [Extension("zope.container._zope_container_contained",
[os.path.join("src", "zope", "container",
"_zope_container_contained.c")
], include_dirs=['include']),
]
setup(name='zope.container',
version='4.0.0a4.dev0',
author='Zope Foundation and Contributors',
......@@ -77,11 +95,7 @@ setup(name='zope.container',
packages=find_packages('src'),
package_dir = {'': 'src'},
namespace_packages=['zope'],
ext_modules=[Extension("zope.container._zope_container_contained",
[os.path.join("src", "zope", "container",
"_zope_container_contained.c")
], include_dirs=['include']),
],
ext_modules=ext_modules,
extras_require=dict(
test=['zope.testing', 'zope.testrunner'
],
......
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