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
24f3e103
Commit
24f3e103
authored
Jul 25, 2017
by
Jason R. Coombs
Committed by
GitHub
Jul 25, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1103 from benoit-pierre/allow_empty_extras
do not strip empty sections in `extras_require`
parents
da396e49
a82fd99f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
setuptools/dist.py
setuptools/dist.py
+2
-0
setuptools/tests/test_egg_info.py
setuptools/tests/test_egg_info.py
+18
-0
No files found.
setuptools/dist.py
View file @
24f3e103
...
...
@@ -369,6 +369,8 @@ class Distribution(Distribution_parse_config_files, _Distribution):
spec_ext_reqs = getattr(self, '
extras_require
', None) or {}
self._tmp_extras_require = defaultdict(list)
for section, v in spec_ext_reqs.items():
# Do not strip empty sections.
self._tmp_extras_require[section]
for r in pkg_resources.parse_requirements(v):
suffix = self._suffix_for(r)
self._tmp_extras_require[section + suffix].append(r)
...
...
setuptools/tests/test_egg_info.py
View file @
24f3e103
...
...
@@ -274,6 +274,8 @@ class TestEggInfo(object):
with
open
(
requires_txt
)
as
fp
:
install_requires
=
fp
.
read
()
expected_requires
=
DALS
(
'''
[extra]
[extra:{marker}]
barbazquux[test]
'''
).
format
(
marker
=
self
.
mismatch_marker_alternate
)
...
...
@@ -306,6 +308,8 @@ class TestEggInfo(object):
with
open
(
requires_txt
)
as
fp
:
install_requires
=
fp
.
read
()
expected_requires
=
DALS
(
'''
[extra]
[extra:{marker}]
barbazquux
'''
).
format
(
marker
=
self
.
mismatch_marker_alternate
)
...
...
@@ -328,6 +332,20 @@ class TestEggInfo(object):
self
.
_run_install_command
(
tmpdir_cwd
,
env
)
assert
glob
.
glob
(
os
.
path
.
join
(
env
.
paths
[
'lib'
],
'barbazquux*'
))
==
[]
def
test_extras_require_with_empty_section
(
self
,
tmpdir_cwd
,
env
):
tmpl
=
'extras_require={{"empty": []}},'
req
=
tmpl
.
format
(
marker
=
self
.
invalid_marker
)
self
.
_setup_script_with_requires
(
req
)
self
.
_run_install_command
(
tmpdir_cwd
,
env
)
egg_info_dir
=
self
.
_find_egg_info_files
(
env
.
paths
[
'lib'
]).
base
requires_txt
=
os
.
path
.
join
(
egg_info_dir
,
'requires.txt'
)
with
open
(
requires_txt
)
as
fp
:
install_requires
=
fp
.
read
()
expected_requires
=
DALS
(
'''
[empty]
'''
).
format
(
marker
=
self
.
mismatch_marker_alternate
)
assert
install_requires
.
lstrip
()
==
expected_requires
def
test_python_requires_egg_info
(
self
,
tmpdir_cwd
,
env
):
self
.
_setup_script_with_requires
(
"""python_requires='>=2.7.12',"""
)
...
...
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