Skip to content

Commit

Permalink
Remove deprecated use of setuptools features
Browse files Browse the repository at this point in the history
The feature was used to optionally disable C extension modules used for
speed optimizations.

Nowadays we can disable this extension module by setting the PURE_PYTHON
environment variable.

Closes #30.
  • Loading branch information
mgedmin committed Jan 20, 2020
1 parent ef2617e commit 1de5550
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import platform
import sys

from setuptools import setup, Extension, Feature
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from setuptools import find_packages

Expand Down Expand Up @@ -62,15 +62,12 @@ def _unavailable(self, e):

codeoptimization_c = os.path.join('src', 'zope', 'interface',
'_zope_interface_coptimizations.c')
codeoptimization = Feature(
"Optional code optimizations",
standard=True,
ext_modules=[
Extension(
"zope.interface._zope_interface_coptimizations",
[os.path.normcase(codeoptimization_c)]
)
])
codeoptimization = [
Extension(
"zope.interface._zope_interface_coptimizations",
[os.path.normcase(codeoptimization_c)]
),
]
py_impl = getattr(platform, 'python_implementation', lambda: None)
is_pypy = py_impl() == 'PyPy'
is_jython = 'java' in sys.platform
Expand All @@ -80,9 +77,9 @@ def _unavailable(self, e):
# anti-optimizations (the C extension compatibility layer is known-slow,
# and defeats JIT opportunities).
if is_pypy or is_jython or is_pure:
features = {}
ext_modules = []
else:
features = {'codeoptimization': codeoptimization}
ext_modules = codeoptimization
tests_require = ['zope.event']
testing_extras = tests_require + ['nose', 'coverage']

Expand Down Expand Up @@ -148,6 +145,6 @@ def read(*rnames):
'test': tests_require,
'testing': testing_extras,
},
features=features,
ext_modules=ext_modules,
keywords=['interface', 'components', 'plugins'],
)

0 comments on commit 1de5550

Please sign in to comment.