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
a5567b76
Commit
a5567b76
authored
Dec 04, 2016
by
idle sign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented proper dangling option values support.
parent
810eb439
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
15 deletions
+100
-15
setuptools/config.py
setuptools/config.py
+2
-2
setuptools/tests/test_config.py
setuptools/tests/test_config.py
+98
-13
No files found.
setuptools/config.py
View file @
a5567b76
...
...
@@ -70,7 +70,7 @@ class ConfigHandler(object):
def
_parse_list
(
cls
,
value
,
separator
=
','
):
"""Represents value as a list.
Value is split either by
comma
or by lines.
Value is split either by
separator (defaults to comma)
or by lines.
:param value:
:param separator: List items separator character.
...
...
@@ -84,7 +84,7 @@ class ConfigHandler(object):
else
:
value
=
value
.
split
(
separator
)
return
[
chunk
.
strip
()
for
chunk
in
value
]
return
[
chunk
.
strip
()
for
chunk
in
value
if
chunk
.
strip
()
]
@
classmethod
def
_parse_dict
(
cls
,
value
):
...
...
setuptools/tests/test_config.py
View file @
a5567b76
...
...
@@ -86,6 +86,27 @@ class TestMetadata:
assert
metadata
.
name
==
'fake_name'
assert
metadata
.
keywords
==
[
'one'
,
'two'
]
def
test_multiline
(
self
,
tmpdir
):
fake_env
(
tmpdir
,
'[metadata]
\
n
'
'name = fake_name
\
n
'
'keywords =
\
n
'
' one
\
n
'
' two
\
n
'
'classifiers =
\
n
'
' Framework :: Django
\
n
'
' Programming Language :: Python :: 3.5
\
n
'
)
with
get_dist
(
tmpdir
)
as
dist
:
metadata
=
dist
.
metadata
assert
metadata
.
keywords
==
[
'one'
,
'two'
]
assert
metadata
.
classifiers
==
[
'Framework :: Django'
,
'Programming Language :: Python :: 3.5'
,
]
def
test_version
(
self
,
tmpdir
):
fake_env
(
...
...
@@ -204,32 +225,96 @@ class TestOptions:
assert
dist
.
use_2to3
assert
dist
.
include_package_data
assert
dist
.
package_dir
==
{
''
:
'src'
,
'b'
:
'c'
}
assert
set
(
dist
.
packages
)
==
set
([
'pack_a'
,
'pack_b.subpack'
])
assert
set
(
dist
.
namespace_packages
)
==
set
([
'pack1'
,
'pack2'
])
assert
set
(
dist
.
use_2to3_fixers
)
==
set
([
'your.fixers'
,
'or.here'
])
assert
set
(
dist
.
use_2to3_exclude_fixers
)
==
set
([
'one.here'
,
'two.there'
])
assert
set
(
dist
.
convert_2to3_doctests
)
==
set
([
assert
dist
.
packages
==
[
'pack_a'
,
'pack_b.subpack'
]
assert
dist
.
namespace_packages
==
[
'pack1'
,
'pack2'
]
assert
dist
.
use_2to3_fixers
==
[
'your.fixers'
,
'or.here'
]
assert
dist
.
use_2to3_exclude_fixers
==
[
'one.here'
,
'two.there'
]
assert
dist
.
convert_2to3_doctests
==
([
'src/tests/one.txt'
,
'src/two.txt'
])
assert
set
(
dist
.
scripts
)
==
set
([
'bin/one.py'
,
'bin/two.py'
])
assert
set
(
dist
.
dependency_links
)
==
set
([
assert
dist
.
scripts
==
[
'bin/one.py'
,
'bin/two.py'
]
assert
dist
.
dependency_links
==
([
'http://some.com/here/1'
,
'http://some.com/there/2'
])
assert
set
(
dist
.
install_requires
)
==
set
([
assert
dist
.
install_requires
==
([
'docutils>=0.3'
,
'pack ==1.1, ==1.3'
,
'hey'
])
assert
set
(
dist
.
setup_requires
)
==
set
([
assert
dist
.
setup_requires
==
([
'docutils>=0.3'
,
'spack ==1.1, ==1.3'
,
'there'
])
assert
set
(
dist
.
tests_require
)
==
set
([
'mock==0.7.2'
,
'pytest'
assert
dist
.
tests_require
==
[
'mock==0.7.2'
,
'pytest'
]
def
test_multiline
(
self
,
tmpdir
):
fake_env
(
tmpdir
,
'[options]
\
n
'
'package_dir =
\
n
'
' b=c
\
n
'
' =src
\
n
'
'packages =
\
n
'
' pack_a
\
n
'
' pack_b.subpack
\
n
'
'namespace_packages =
\
n
'
' pack1
\
n
'
' pack2
\
n
'
'use_2to3_fixers =
\
n
'
' your.fixers
\
n
'
' or.here
\
n
'
'use_2to3_exclude_fixers =
\
n
'
' one.here
\
n
'
' two.there
\
n
'
'convert_2to3_doctests =
\
n
'
' src/tests/one.txt
\
n
'
' src/two.txt
\
n
'
'scripts =
\
n
'
' bin/one.py
\
n
'
' bin/two.py
\
n
'
'eager_resources =
\
n
'
' bin/one.py
\
n
'
' bin/two.py
\
n
'
'install_requires =
\
n
'
' docutils>=0.3
\
n
'
' pack ==1.1, ==1.3
\
n
'
' hey
\
n
'
'tests_require =
\
n
'
' mock==0.7.2
\
n
'
' pytest
\
n
'
'setup_requires =
\
n
'
' docutils>=0.3
\
n
'
' spack ==1.1, ==1.3
\
n
'
' there
\
n
'
'dependency_links =
\
n
'
' http://some.com/here/1
\
n
'
' http://some.com/there/2
\
n
'
)
with
get_dist
(
tmpdir
)
as
dist
:
assert
dist
.
package_dir
==
{
''
:
'src'
,
'b'
:
'c'
}
assert
dist
.
packages
==
[
'pack_a'
,
'pack_b.subpack'
]
assert
dist
.
namespace_packages
==
[
'pack1'
,
'pack2'
]
assert
dist
.
use_2to3_fixers
==
[
'your.fixers'
,
'or.here'
]
assert
dist
.
use_2to3_exclude_fixers
==
[
'one.here'
,
'two.there'
]
assert
dist
.
convert_2to3_doctests
==
(
[
'src/tests/one.txt'
,
'src/two.txt'
])
assert
dist
.
scripts
==
[
'bin/one.py'
,
'bin/two.py'
]
assert
dist
.
dependency_links
==
([
'http://some.com/here/1'
,
'http://some.com/there/2'
])
assert
dist
.
install_requires
==
([
'docutils>=0.3'
,
'pack ==1.1, ==1.3'
,
'hey'
])
assert
dist
.
setup_requires
==
([
'docutils>=0.3'
,
'spack ==1.1, ==1.3'
,
'there'
])
assert
dist
.
tests_require
==
[
'mock==0.7.2'
,
'pytest'
]
def
test_package_dir_fail
(
self
,
tmpdir
):
fake_env
(
...
...
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