Skip to content

Commit 3295675

Browse files
committed
Merge pull request #126 from bastibe/wheel-fun
Wheels are now os-dependent but python-independent
2 parents b3d35f3 + cecbc6a commit 3295675

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

setup.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ def run_tests(self):
4343
sys.exit(errno)
4444

4545

46+
cmdclass = {'test': PyTest}
47+
try:
48+
from wheel.bdist_wheel import bdist_wheel
49+
except ImportError:
50+
pass
51+
else:
52+
# This will create OS-dependent, but Python-independent wheels
53+
class bdist_wheel_half_pure(bdist_wheel):
54+
def get_tag(self):
55+
pythons = 'py2.py3.cp26.cp27.cp32.cp33.cp34.cp35.pp27.pp32'
56+
if platform == 'darwin':
57+
oses = 'macosx_10_6_intel.macosx_10_9_intel.' \
58+
'macosx_10_9_x86_64.macosx_10_5_x86_64'
59+
elif platform == 'win32':
60+
if architecture0 == '32bit':
61+
oses = 'win32'
62+
else:
63+
oses = 'win_amd64'
64+
else:
65+
pythons = 'py2.py3'
66+
oses = 'any'
67+
return pythons, 'none', oses
68+
69+
cmdclass['bdist_wheel'] = bdist_wheel_half_pure
70+
4671
setup(
4772
name='PySoundFile',
4873
version='0.7.0',
@@ -74,5 +99,5 @@ def run_tests(self):
7499
],
75100
long_description=open('README.rst').read(),
76101
tests_require=['pytest'],
77-
cmdclass={'test': PyTest},
102+
cmdclass=cmdclass,
78103
)

0 commit comments

Comments
 (0)