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
77044955
Commit
77044955
authored
Jul 23, 2017
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor a bit for clarity
parent
b8129358
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
setuptools/dist.py
setuptools/dist.py
+12
-9
No files found.
setuptools/dist.py
View file @
77044955
...
...
@@ -379,23 +379,26 @@ class Distribution(Distribution_parse_config_files, _Distribution):
Move requirements in `install_requires` that are using environment
markers or extras to `extras_require`.
"""
# divide the install_requires into two sets, simple ones still
# handled by install_requires and more complex ones handled
# by extras_require.
def is_simple_req(req):
return not req.marker and not req.extras
spec_inst_reqs = getattr(self, '
install_requires
', None) or ()
self.install_requires = list(
str(req)
for req in filter(
is_simple_req,
pkg_resources.parse_requirements(spec_inst_reqs),
)
simple_reqs = filter(
is_simple_req,
pkg_resources.parse_requirements(spec_inst_reqs),
)
markers_or_extras_reqs = filterfalse(
complex_reqs = filterfalse(
is_simple_req,
pkg_resources.parse_requirements(spec_inst_reqs),
)
for r in markers_or_extras_reqs:
self.install_requires = list(map(str, simple_reqs))
for r in complex_reqs:
suffix = '
:
' + str(r.marker) if r.marker else ''
sections = [
section + suffix
...
...
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