Skip to content
New issue

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

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

Already on GitHub? # to your account

Compatibility with Python 2.7 (feature request) #46

Closed
flo-compbio opened this issue Jul 15, 2016 · 14 comments
Closed

Compatibility with Python 2.7 (feature request) #46

flo-compbio opened this issue Jul 15, 2016 · 14 comments

Comments

@flo-compbio
Copy link

Is there a specific reason why auditwheel does not support Python 2.7 (besides it requiring more work to make the code Python2/3 portable)?

I got a simple error from a print call in main_addtag.py, line 49.

@rmcgibbo
Copy link
Member

IIRC, the code uses a fair number of py3-only features, like type
annotations and yield from.

-Robert

On Fri, Jul 15, 2016 at 1:50 PM, Florian Wagner notifications@github.com
wrote:

Is there a specific reason why auditwheel does not support Python 2.7
(besides it requiring more work to make the code Python2/3 portable)?

I got a simple error from a print call in main_addtag.py, line 49.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#46, or mute the thread
https://github.com/notifications/unsubscribe-auth/AAnI_tNFmmH3L727lBBetWA2tIBCYxQCks5qV8hQgaJpZM4JNona
.

-Robert

@flo-compbio
Copy link
Author

Ah I see. I just searched the code, didn't find any "yield from", but type annotations are indeed there (although I thought this is Python 3.5 feature and the Readme says Python 3.3+?)

From what I understand about Pep 513, the manylinux1 spec is not Python 3-specifc, so that's why I thought that it would be nice to make auditwheel 2.7-compatible. Please correct me if I'm wrong. I'm currently trying to use auditwheel to create 2.7 and 3.5 binaries.

@flo-compbio
Copy link
Author

The type hints could be changed to the Python 2-compatible format, and the rest could be made portable using the "future" library. I have a bit of experience writing Python2/3 portable code so I could help with that.

@rmcgibbo
Copy link
Member

Auditwheel works just fine to create python2 binaries. You just have to run
it from a Python3 interpreter. This is already done in the manylinux docker
container.

-Robert

On Fri, Jul 15, 2016 at 2:01 PM, Florian Wagner notifications@github.com
wrote:

The type hints could be changed to the Python 2-compatible format, and the
rest could be made portable using the "future" library. I have a bit of
experience writing Python2/3 portable code so I could help with that.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#46 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAnI_iWp7ZmVzikW6G4lt6-NV4KSOK4pks5qV8sWgaJpZM4JNona
.

-Robert

@flo-compbio
Copy link
Author

That makes sense. I got a little confused while trying to deploy manylinux wheels with Travis-CI. Seems like Travis isn't supporting that anyway right now, so there's no need to have Python 2.7 compatibility at this point.

@pombredanne
Copy link

@flo-compbio what do you mean with "Travis isn't supporting that anyway right now" ?

@flo-compbio
Copy link
Author

I thought it would be impossible to tell Travis to upload (deploy) a wheel built using the manylinux1 docker container. However, I've figured out how to do that now using some bash commands, and it works like a charm. Something like:

# (build 32-bit and 64-bit wheels using the manylinux1 docker container)
# ...
find dist/ -name "*.whl" -exec auditwheel repair {} \;
rm dist/*
mv wheelhouse/*.whl dist/

Then I set distributions: sdist (building only the source distribution) and skip_cleanup: true and in the .travis.yml deploy section. Based on the Travis docs, I think that the skip_cleanup prevent Travis from deleting/overwriting the dist/ directory, so that all wheels previously built with the docker container are uploaded to PyPI. You can take a look at the code here (the relevant scripts are in the tools/ directory).

@flo-compbio
Copy link
Author

I think it would still be nice to have Python2/3 portability, because right now I have to sometimes install Python 3 inside the docker container just so that I can run auditwheel on my Python 2 wheel. But I think it's a relatively minor issue.

@rmcgibbo
Copy link
Member

Are you talking about the manylinux1 docker container, or your own? The
manylinux1 docker container comes with auditwheel, and many versions of
python preinstalled.

-Robert

On Tue, Aug 16, 2016 at 5:04 PM, Florian Wagner notifications@github.com
wrote:

I think it would still be nice to have Python2/3 portability, because
right now I have to sometimes install Python 3 inside the docker container
just so that I can run auditwheel on my Python 2 wheel. But I think it's a
relatively minor issue.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#46 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAnI_tS_sfBN2IoRtDWylbhp4loSDUK1ks5qgiX0gaJpZM4JNona
.

-Robert

@flo-compbio
Copy link
Author

Yes, I was referring to the manylinux docker container. Thanks for the information, I might try to use the pre-installed auditwheel version then.

@pombreda
Copy link

@flo-compbio Yesterday I did setup this travis build loop for Python 2.7 natives https://github.com/pombreda/thirdparty-manylinux/ using the manylinux containers yesterday and this is based on/derived from the https://github.com/pypa/python-manylinux-demo .... This is auditwheel'in alright. This may help.

FWIW and for context I build several natives for vendoring in https://github.com/nexB/scancode-toolkit/ and I also build Windows and Mac wheels (and also some non-manylinux wheels) for the same packages here: https://github.com/pombreda/thirdparty using travis and appeveyor. And this pushes all built wheels there: https://dl.bintray.com/pombreda/thirdparty/
I will also set this up for pyahocorasick (where I also commit) so we can push the manylinux/mac and windows wheels to Pypi.

The quirks/changes from the: https://github.com/pypa/python-manylinux-demo are:

  1. I do not care for older 2.6, 3.3 and 3.4 versions: only 2.7 and 3.5. I mostly care about 2.7 for now. I bravely deleted these Pythons from the containers in my script for the sake of simplicity for now.
  2. I did hit auditwheel repair should not fail on pure Python wheels #47 when using and updated the build script in https://github.com/pombreda/thirdparty-manylinux/blob/3c35a8fa5eee12dec76993a90632e22cc6dbbe01/travis/build-wheels.sh to delete any pure wheel before running auditwheel

@pombreda
Copy link

@flo-compbio so I agree with you that 2.7 support would be nice, but I do not see this as a blocker for now.... and the use-auditwheel-in-a-old-linux-distro-container is IMHO the main use case.

@ogrisel
Copy link
Contributor

ogrisel commented Jan 9, 2017

As auditwheel is pre-installed in the manylinux1 docker container and can repair wheels both for Python 2 and Python 3, I am in favor of closing this issue. I like being able to use latest Python 3 features in this project and it's not a project that is meant to be use as library so there is no point in making it importable in a python 2 program.

As a side note, auditwheel should probably never be used outside the manylinux1 docker containers to repair Linux wheels (unless you really know what you do and read the PEP 513 spec).

@flo-compbio
Copy link
Author

I agree with Olivier, as I said I've managed to get things to work for my Python 2/3 project without auditwheel supporting Python 2.7 directly.

@rmcgibbo rmcgibbo closed this as completed Jan 9, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants