Skip to content

Commit

Permalink
Merge pull request #15 from zopefoundation/issue11
Browse files Browse the repository at this point in the history
Drop the use of the deprecated setuptools Features
  • Loading branch information
jamadden committed Mar 10, 2020
2 parents 5585023 + 599e3de commit 043818e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -5,7 +5,9 @@
5.0.1 (unreleased)
==================

- Nothing changed yet.
- Stop using the setuptools ``Feature`` class, allowing this
project to be built from source with newer versions of setuptools
that remove that functionality.


5.0.0 (2019-11-12)
Expand Down
15 changes: 5 additions & 10 deletions setup.py
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 043818e

Please sign in to comment.