Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
3d8c2245
Commit
3d8c2245
authored
Apr 06, 2016
by
Steve Kowalik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reinstate the or guard in WorkingSet._markers_pass
parent
a31716f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
pkg_resources/__init__.py
pkg_resources/__init__.py
+1
-1
pkg_resources/tests/test_resources.py
pkg_resources/tests/test_resources.py
+6
-0
No files found.
pkg_resources/__init__.py
View file @
3d8c2245
...
@@ -861,7 +861,7 @@ class WorkingSet(object):
...
@@ -861,7 +861,7 @@ class WorkingSet(object):
result = []
result = []
if req in extra_req_mapping:
if req in extra_req_mapping:
for extra in extra_req_mapping[req]:
for extra in extra_req_mapping[req]
or ['']
:
result.append(req.marker.evaluate({'
extra
': extra}))
result.append(req.marker.evaluate({'
extra
': extra}))
else:
else:
result.append(req.marker.evaluate())
result.append(req.marker.evaluate())
...
...
pkg_resources/tests/test_resources.py
View file @
3d8c2245
...
@@ -186,6 +186,12 @@ class TestDistro:
...
@@ -186,6 +186,12 @@ class TestDistro:
res
=
ws
.
resolve
(
parse_requirements
(
"Foo;python_version>='2'"
),
ad
)
res
=
ws
.
resolve
(
parse_requirements
(
"Foo;python_version>='2'"
),
ad
)
assert
list
(
res
)
==
[
Foo
]
assert
list
(
res
)
==
[
Foo
]
def
test_environment_marker_evaluation_called
(
self
):
ws
=
WorkingSet
([])
req
,
=
parse_requirements
(
"bar;python_version<'4'"
)
extra_req_mapping
=
{
req
:
()}
assert
ws
.
_markers_pass
(
req
,
extra_req_mapping
)
==
True
def
test_marker_evaluation_with_extras
(
self
):
def
test_marker_evaluation_with_extras
(
self
):
"""Extras are also evaluated as markers at resolution time."""
"""Extras are also evaluated as markers at resolution time."""
ad
=
pkg_resources
.
Environment
([])
ad
=
pkg_resources
.
Environment
([])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment