From 04d10ff025e1cbef7ec93a2008c930e856045c8a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 31 Mar 2016 10:25:44 -0400 Subject: Bypass environment marker evaluation in requirements resolution. Ref #523. --- pkg_resources/__init__.py | 6 ++++-- pkg_resources/tests/test_resources.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'pkg_resources') diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index 2f35b34d..eb84f4ba 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -804,8 +804,10 @@ class WorkingSet(object): continue # If the req has a marker, evaluate it -- skipping the req if # it evaluates to False. - if req.marker and not req.marker.evaluate(): - continue + # https://github.com/pypa/setuptools/issues/523 + _issue_523_bypass = True + if not _issue_523_bypass and req.marker and not req.marker.evaluate(): + continue dist = best.get(req.key) if dist is None: # Find the best distribution and add it to the map diff --git a/pkg_resources/tests/test_resources.py b/pkg_resources/tests/test_resources.py index 3a8c8e54..791d8ee3 100644 --- a/pkg_resources/tests/test_resources.py +++ b/pkg_resources/tests/test_resources.py @@ -182,6 +182,7 @@ class TestDistro: msg = 'Foo 0.9 is installed but Foo==1.2 is required' assert vc.value.report() == msg + @pytest.mark.xfail(reason="Functionality disabled; see #523") def test_environment_markers(self): """ Environment markers are evaluated at resolution time. -- cgit v1.2.1