Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py: build 'universal' py2.py3 wheels #595

Merged
merged 2 commits into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[bdist_wheel]
universal=0

[metadata]
license_file = LICENSE.md
14 changes: 8 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
import setuptools.command.install
from setuptools import setup

"""
We need a customized version of the 'bdist_wheel' command, because otherwise
the wheel is identified as being non-platform specific. This is because the
afdko has no Python extensions and the command line tools are installed as
data files.
"""
try:
from wheel.bdist_wheel import bdist_wheel

class CustomBDistWheel(bdist_wheel):
"""Mark the wheel as "universal" (both python 2 and 3), yet
platform-specific, since it contains native C executables.
"""

def finalize_options(self):
bdist_wheel.finalize_options(self)
self.root_is_pure = False

def get_tag(self):
return ('py2.py3', 'none',) + bdist_wheel.get_tag(self)[2:]

except ImportError:
print("afdko: setup.py requires that the Python package 'wheel' be "
"installed. Try the command 'pip install wheel'.")
Expand Down