-
Notifications
You must be signed in to change notification settings - Fork 290
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
Monkeypatch pkg_resources to always use _markerlib #285
Conversation
Prior to setuptools 20.10.0 there is patchy support for environment markers, and setup.py fails while parsing them. html5lib requires at least setuptools 18.5 for its environment markers. However, @gsnedders developed a way to monkey patch pkg_resources so that it always uses _markerlib, which allows all environment markers to be used for any version of setuptools. Some patching of _markerlib is also required so that it works on Python 3 also. On removing the dependency for setuptools>=18.5, pip partially fails on Python 2.6 with an error `Double requirement given: ordereddict` and does not install the requirements.txt. Fixed by removing ordereddict from requirements-test.txt
Current coverage is 90.47% (diff: 100%)@@ master #285 diff @@
==========================================
Files 50 50
Lines 6930 6930
Methods 0 0
Messages 0 0
Branches 1336 1336
==========================================
Hits 6270 6270
Misses 500 500
Partials 160 160
|
@gsnedders and I had a discussion about this general problem at pypa/packaging#72 The long and short of it is that it works on a very large array of Python & setuptools versions (https://travis-ci.org/jayvdb/tox-travis/builds/145144692) |
Hey, thanks for this. Can you add a (temporary) commit that tests (on Travis) loads of different pip and setuptools versions? (Let's try down to setuptools 3.3 and pip 6.0?) I'd much rather test this with all of our relatively complex usage of markers directly. |
Sure. Are you happy with the selection of versions being roughly the latest patch release of each minor release? (that is what I did with https://travis-ci.org/jayvdb/tox-travis/builds/145144692 ) Do you want the commit to be on this PR, so that the record is part of this projects travis builds? |
no problems with normal setuptools use; pip 6.0 is definitely the minimum for the environment markers, but otherwise works ok. Doing a large matrix build now with and without optional. Will be a while before they are done. |
Awesome, thanks! |
Prior to setuptools 20.10.0 there is patchy support for environment markers,
and setup.py fails while parsing them.
html5lib requires at least setuptools 18.5 for its environment markers.
However, @gsnedders developed a way to monkey patch pkg_resources
so that it always uses _markerlib, which allows all environment markers
to be used for any version of setuptools. Some patching of _markerlib
is also required so that it works on Python 3 also.
On removing the dependency for setuptools>=18.5, pip partially fails on
Python 2.6 with an error
Double requirement given: ordereddict
and does not install the requirements.txt.
Fixed by removing ordereddict from requirements-test.txt