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
a2e883e1
Commit
a2e883e1
authored
Dec 01, 2019
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract function to strip the marker for concise code in the long function.
parent
2292718a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
setuptools/installer.py
setuptools/installer.py
+14
-5
No files found.
setuptools/installer.py
View file @
a2e883e1
...
...
@@ -64,11 +64,8 @@ def fetch_build_egg(dist, req):
pkg_resources
.
get_distribution
(
'wheel'
)
except
pkg_resources
.
DistributionNotFound
:
dist
.
announce
(
'WARNING: The wheel package is not available.'
,
log
.
WARN
)
# Ignore environment markers: if we're here, it's needed. This ensure
# we don't try to ask pip for something like `babel; extra == "i18n"`,
# which would always be ignored.
req
=
pkg_resources
.
Requirement
.
parse
(
str
(
req
))
req
.
marker
=
None
# Ignore environment markers; if supplied, it is required.
req
=
strip_marker
(
req
)
# Take easy_install options into account, but do not override relevant
# pip environment variables (like PIP_INDEX_URL or PIP_QUIET); they'll
# take precedence.
...
...
@@ -130,3 +127,15 @@ def fetch_build_egg(dist, req):
dist
=
pkg_resources
.
Distribution
.
from_filename
(
dist_location
,
metadata
=
dist_metadata
)
return
dist
def
strip_marker
(
req
):
"""
Return a new requirement without the environment marker to avoid
calling pip with something like `babel; extra == "i18n"`, which
would always be ignored.
"""
# create a copy to avoid mutating the input
req
=
pkg_resources
.
Requirement
.
parse
(
str
(
req
))
req
.
marker
=
None
return
req
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