summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJason Madden <jamadden@gmail.com>2020-11-11 15:40:36 -0600
committerJason Madden <jamadden@gmail.com>2020-11-11 16:08:42 -0600
commitc80fab93073603289f41df8e32b7ecc25f37763e (patch)
tree7f52c3607d217c26c8098ce3b4bee69bb3b861f2 /setup.py
parentede3fa53574aa5829a34ad5c962c2d2d3fb54d27 (diff)
downloadgreenlet-c80fab93073603289f41df8e32b7ecc25f37763e.tar.gz
Remove custom my_build_ext and stop trying to build extensions at test time.
Building the extensions and getting them in the right place is the job of tox. This includes a temporary minor regression in that the test extensions are now also packaged in the binary distributions. This will be resolved with #189 and #184. Removes some (maybe all, didnt check yet) uses of distutils so partly addresses #185. Fixes #187 Specify an image for appveyor that works for Python 2.7 (the right visual studio is missing on other images) Add installation of missing python versions. Use PYTHON, not PYTHON_ROOT on appveyor. The former is more common in my experience. Use a newer image for 3.9 on appveyor
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py39
1 files changed, 28 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 1fb295d..459633f 100755
--- a/setup.py
+++ b/setup.py
@@ -9,10 +9,6 @@ import platform
from setuptools import setup
from setuptools import Extension
-# XXX: This uses distutils directly and is probably
-# unnecessary with setuptools.
-from my_build_ext import build_ext
-
# workaround segfaults on openbsd and RHEL 3 / CentOS 3 . see
# https://bitbucket.org/ambroff/greenlet/issue/11/segfault-on-openbsd-i386
# https://github.com/python-greenlet/greenlet/issues/4
@@ -53,12 +49,34 @@ else:
else:
extra_compile_args = []
- ext_modules = [Extension(
- name='greenlet',
- sources=['greenlet.c'],
- extra_objects=extra_objects,
- extra_compile_args=extra_compile_args,
- depends=['greenlet.h', 'slp_platformselect.h'] + _find_platform_headers())]
+ ext_modules = [
+ Extension(
+ name='greenlet',
+ sources=['greenlet.c'],
+ extra_objects=extra_objects,
+ extra_compile_args=extra_compile_args,
+ depends=['greenlet.h', 'slp_platformselect.h'] + _find_platform_headers()
+ ),
+ # Test extensions.
+ # XXX: We used to try hard to not include these in built
+ # distributions. That's really not important, at least not once we have a clean
+ # layout with the test directory nested inside a greenlet directory.
+ # See https://github.com/python-greenlet/greenlet/issues/184 and 189
+ Extension(
+ '_test_extension',
+ [os.path.join('tests', '_test_extension.c')],
+ include_dirs=[os.path.curdir]
+ ),
+ ]
+
+ if os.environ.get('GREENLET_TEST_CPP', 'yes').lower() not in ('0', 'no', 'false'):
+ ext_modules.append(
+ Extension(
+ '_test_extension_cpp',
+ [os.path.join('tests', '_test_extension_cpp.cpp')],
+ language="c++",
+ include_dirs=[os.path.curdir]),
+ )
setup(
name="greenlet",
@@ -75,7 +93,6 @@ setup(
platforms=['any'],
headers=headers,
ext_modules=ext_modules,
- cmdclass=dict(build_ext=build_ext),
classifiers=[
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',