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

Monkeypatch pkg_resources to always use _markerlib #285

Merged
merged 1 commit into from
Jul 26, 2016

Conversation

jayvdb
Copy link
Contributor

@jayvdb jayvdb commented Jul 22, 2016

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

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
@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 22, 2016

Also fixes #280 as an alternative to #284

@codecov-io
Copy link

codecov-io commented Jul 22, 2016

Current coverage is 90.47% (diff: 100%)

Merging #285 into master will not change coverage

@@             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          

Powered by Codecov. Last update 14d4851...6cd93c8

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 22, 2016

@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)

@gsnedders
Copy link
Member

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.

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 26, 2016

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 )
I'll start setting that up, and rather randomly mix setuptools and pip versions.

Do you want the commit to be on this PR, so that the record is part of this projects travis builds?

@jayvdb
Copy link
Contributor Author

jayvdb commented Jul 26, 2016

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.
https://travis-ci.org/jayvdb/html5lib-python/builds/147372074
https://travis-ci.org/jayvdb/html5lib-python/builds/147372330

@gsnedders gsnedders merged commit 43aeaef into html5lib:master Jul 26, 2016
@gsnedders
Copy link
Member

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

3 participants