Skip to content

Commit

Permalink
Merge c50feb0 into f527577
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jan 20, 2020
2 parents f527577 + c50feb0 commit 81d08f1
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from setuptools import setup
from setuptools import find_packages
from setuptools import Extension
from setuptools import Feature

from setuptools.command.build_ext import build_ext

Expand Down Expand Up @@ -64,26 +63,22 @@ def read(*rnames):
return f.read()


codeoptimization = Feature(
"Optional code optimizations",
standard=True,
ext_modules=[
codeoptimization = [
Extension(
"zope.hookable._zope_hookable",
[os.path.join('src', 'zope', 'hookable', "_zope_hookable.c")],
),
],
)
]

is_pypy_or_jython = platform.python_implementation() in ('PyPy', 'Jython')

# 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_jython:
features = {}
ext_modules = {}
else:
features = {'codeoptimization': codeoptimization}
ext_modules = codeoptimization

TESTS_REQUIRE = [
'zope.testing',
Expand Down Expand Up @@ -117,7 +112,7 @@ def read(*rnames):
"Framework :: Zope :: 3",
"Topic :: Software Development :: Libraries :: Python Modules",
],
features=features,
ext_modules=ext_modules,
cmdclass={
'build_ext': optional_build_ext,
},
Expand Down

0 comments on commit 81d08f1

Please sign in to comment.