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
f464c4b8
Commit
f464c4b8
authored
Jul 23, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract a function for removing extras and marker from a requirement.
parent
00a738d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
9 deletions
+15
-9
setuptools/dist.py
setuptools/dist.py
+15
-9
No files found.
setuptools/dist.py
View file @
f464c4b8
...
...
@@ -372,7 +372,6 @@ class Distribution(Distribution_parse_config_files, _Distribution):
for r in pkg_resources.parse_requirements(v):
if r.marker:
section += '
:
' + str(r.marker)
r.marker = None
self._tmp_extras_require[section].append(r)
def _move_install_requirements_markers(self):
...
...
@@ -393,19 +392,26 @@ class Distribution(Distribution_parse_config_files, _Distribution):
if req.marker or req.extras
)
for r in markers_or_extras_reqs:
marker = r.marker
extras = r.extras
r.extras = ()
r.marker = None
for section in extras or ('',):
if marker:
section += '
:
' + str(marker)
suffix = '
:
' + str(r.marker) if r.marker else ''
sections = [
section + suffix
for section in r.extras or ('',)
]
for section in sections:
self._tmp_extras_require[section].append(r)
self.extras_require = dict(
(k, [str(r) for r in
v
])
(k, [str(r) for r in
map(self._clean_req, v)
])
for k, v in self._tmp_extras_require.items()
)
def _clean_req(self, req):
"""
Given a Requirement, remove extras and markers and return it.
"""
req.extras = ()
req.marker = None
return req
def parse_config_files(self, filenames=None):
"""Parses configuration files from various levels
and loads configuration.
...
...
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