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

Allow forcing pure platform-specific wheel for pure Python package #128

Closed
agronholm opened this issue Nov 24, 2014 · 4 comments
Closed

Comments

@agronholm
Copy link
Contributor

Originally reported by: Almar Klein (Bitbucket: almarklein, GitHub: almarklein)


I am developing a package that is Pure Python, but uses 3d party (precompiled) dynamic libraries (via ctypes). I wish to create a wheel for this package for each common platform, which have the appropriate dynamic library included.

This all works well, except that the .whl that is created has platform "any". Is there a way to make it specific to the current platform? Or better yet, to a platform of my choice (which would allow me to build all wheels from a single platform)?

Thanks.


@agronholm
Copy link
Contributor Author

Original comment by janschulz (Bitbucket: janschulz, GitHub: janschulz):


Not sure if you still have the problem, ut here is a description of a workaround: JessicaTegner/pypandoc#84

@agronholm
Copy link
Contributor Author

Original comment by Almar Klein (Bitbucket: almarklein, GitHub: almarklein):


We found a solution, but yours seems much easier. I'm going to try that, thanks!

@agronholm
Copy link
Contributor Author

Original comment by Philip Semanchuk (Bitbucket: philip_semanchuk, GitHub: Unknown):


I have a problem similar to the OP's problem. We have a C++ binary with a Python wrapper (created by SWIG) that we've built with an in-house Makefile. We want to distribute it as a wheel.

Maybe I misunderstand how to use the referenced workaround (subclass BinaryDistribution to return False from is_pure()), but it doesn't work for me with wheel 0.26.0. AFAICT, wheel doesn't use distribution.is_pure() at all. Wheel's 0.26.0 implementation uses this to decide if a package is pure:

self.root_is_pure = not (self.distribution.has_ext_modules()
                         or self.distribution.has_c_libraries())

This workaround allows me to create a wheel for my precompiled binaries:
http://lepture.com/en/2014/python-on-a-hard-wheel

That workaround is doubly useful for me, because my 64-bit binary is built with -mmacosx-version-min=10.9. That means the appropriate platform tag is macosx_10_9_x86_64. But if I specify that by using setup.py's --plat-name= option, the assert at the end of wheel's get_tag() fails because the appropriate platform name isn't in pep425tags.get_supported(). Subclassing get_tag() allows me to set an accurate platform tag.

Edit: one disadvantage of overriding get_tag() is that the WHEEL file in the wheel's dist-info still says Root-Is-Purelib: true.

@agronholm
Copy link
Contributor Author

Original comment by Nate Coraor (Bitbucket: natefoo, GitHub: natefoo):


This is now implemented, please see issue #144 for details (tl;dr: use --plat-name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant