summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Stufft <donald@stufft.io>2015-08-13 14:57:53 -0400
committerDonald Stufft <donald@stufft.io>2015-08-13 14:57:53 -0400
commit39517d10466eecb1411b2b3bd6569ae22a9ded0e (patch)
tree0bc8346ce375044927be222081bb3e1dbc67c5f2
parent44420423de34c54486c0210076c233e5b9f57ee2 (diff)
downloadsqlalchemy-pr/194.tar.gz
Tell Wheel to generate platform and interpreter specific wheelspr/194
By telling wheel that we have extension modules, even though we have none, wheel will create a Wheel which is platform and interpreter specific. This will ensure that the pure Python wheels on PyPy do not trigger installs on CPython without the C speedups.
-rw-r--r--setup.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 8f9ba4dd8..5b97cb9fe 100644
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ from distutils.command.build_ext import build_ext
from distutils.errors import CCompilerError
from distutils.errors import DistutilsExecError
from distutils.errors import DistutilsPlatformError
-from setuptools import Extension
+from setuptools import Distribution as _Distribution, Extension
from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
@@ -62,6 +62,18 @@ class ve_build_ext(build_ext):
cmdclass['build_ext'] = ve_build_ext
+class Distribution(_Distribution):
+
+ def has_ext_modules(self):
+ # We want to always claim that we have ext_modules. This will be fine
+ # if we don't actually have them (such as on PyPy) because nothing
+ # will get built, however we don't want to provide an overally broad
+ # Wheel package when building a wheel without C support. This will
+ # ensure that Wheel knows to treat us as if the build output is
+ # platform specific.
+ return True
+
+
class PyTest(TestCommand):
# from https://pytest.org/latest/goodpractises.html\
# #integration-with-setuptools-test-commands
@@ -111,6 +123,8 @@ def run_setup(with_cext):
kwargs = {}
if with_cext:
kwargs['ext_modules'] = ext_modules
+ else:
+ kwargs['ext_modules'] = []
setup(
name="SQLAlchemy",
@@ -137,6 +151,7 @@ def run_setup(with_cext):
"Topic :: Database :: Front-Ends",
"Operating System :: OS Independent",
],
+ distclass=Distribution,
**kwargs
)