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

Use Py_LIMITED_API wheel tags #3307

Closed
reaperhulk opened this issue Dec 11, 2016 · 3 comments
Closed

Use Py_LIMITED_API wheel tags #3307

reaperhulk opened this issue Dec 11, 2016 · 3 comments

Comments

@reaperhulk
Copy link
Member

reaperhulk commented Dec 11, 2016

cffi uses the Py_LIMITED_API when compiling shared objects as of cffi 1.8.1. This means we can potentially reduce our mac py3 wheels from 3 (py34, py35, py36) to 1 and our manylinux1 py3 wheels from 6 to 2.

@reaperhulk reaperhulk added this to the Twentieth release milestone May 30, 2017
@reaperhulk
Copy link
Member Author

The advantages this offers aren't very large given our existing test infra can easily build all the wheels. Plus we'd have to rename the files until the next wheel comes out. Bumping out of release twenty. We can revisit in the future.

@reaperhulk reaperhulk removed this from the Twentieth release milestone Jun 8, 2017
@reaperhulk
Copy link
Member Author

Update: wheel 0.30 is out so we could potentially do this now. I'm not sure what pip added support for abi3 tags, but it's probably not going to be a newer version than we already effectively require to get a wheel.

@reaperhulk reaperhulk added this to the Twenty second release milestone Sep 12, 2017
@reaperhulk
Copy link
Member Author

reaperhulk commented Feb 1, 2018

If we want to do this we'll have to switch from pip wheel to pip download && tar zxf && cd && python setup.py bdist_wheel --py-limited-api=cp34. Right now the pip wheel command has no way to pass the py-limited-api argument to wheel. For the Darwin builder here's roughly what it would look like

Old:

                        CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" LDFLAGS="/usr/local/opt/openssl@1.1/lib/libcrypto.a /usr/local/opt/openssl@1.1/lib/libssl.a" CFLAGS="-I/usr/local/opt/openssl@1.1/include -mmacosx-version-min=10.9" pip wheel cryptography==$BUILD_VERSION --wheel-dir=wheelhouse --no-binary cryptography

New:

pip download cryptography==$BUILD_VERSION --no-binary cryptography
tar zxf cryptography*.tar.gz
cd cryptography*
CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS="1" LDFLAGS="/usr/local/opt/openssl@1.1/lib/libcrypto.a /usr/local/opt/openssl@1.1/lib/libssl.a" CFLAGS="-I/usr/local/opt/openssl@1.1/include -mmacosx-version-min=10.9" python setup.py bdist_wheel --py-limited-api=cp34

Additionally the wheels will now go into the dist dir under the new cryptography dir so we'll have to change the archive pattern match (unless we use something like --dist-dir=../wheelhouse).

For now this is mostly notes to myself. If we do this switch before Python 3.7 comes out we'll save ourselves the trouble of needing to do a 3.7 specific set of wheels though (albeit only on macOS and linux, not windows)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants