Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
4ae1def3
Unverified
Commit
4ae1def3
authored
Nov 03, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix handling of dependencies with a not in marker operator
parent
0faa0133
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
CHANGELOG.md
+1
-0
poetry/packages/__init__.py
+6
-5
tests/packages/test_main.py
+17
-0
No files found.
CHANGELOG.md
View file @
4ae1def3
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
### Fixed
### Fixed
-
Fixed installation of directory dependencies.
-
Fixed installation of directory dependencies.
-
Fixed handling of dependencies with a
`not in`
marker operator.
## [0.12.5] - 2018-10-26
## [0.12.5] - 2018-10-26
...
...
poetry/packages/__init__.py
View file @
4ae1def3
...
@@ -105,20 +105,21 @@ def dependency_from_pep_508(name):
...
@@ -105,20 +105,21 @@ def dependency_from_pep_508(name):
op
=
""
op
=
""
elif
op
==
"!="
:
elif
op
==
"!="
:
version
+=
".*"
version
+=
".*"
elif
op
==
"in"
:
elif
op
in
(
"in"
,
"not in"
)
:
versions
=
[]
versions
=
[]
for
v
in
re
.
split
(
"[ ,]+"
,
version
):
for
v
in
re
.
split
(
"[ ,]+"
,
version
):
split
=
v
.
split
(
"."
)
split
=
v
.
split
(
"."
)
if
len
(
split
)
in
[
1
,
2
]:
if
len
(
split
)
in
[
1
,
2
]:
split
.
append
(
"*"
)
split
.
append
(
"*"
)
op
=
"
"
op
_
=
""
if
op
==
"in"
else
"!=
"
else
:
else
:
op
=
"=
="
op
_
=
"=="
if
op
==
"in"
else
"!
="
versions
.
append
(
op
+
"."
.
join
(
split
))
versions
.
append
(
op
_
+
"."
.
join
(
split
))
glue
=
" || "
if
op
==
"in"
else
", "
if
versions
:
if
versions
:
ands
.
append
(
" || "
.
join
(
versions
))
ands
.
append
(
glue
.
join
(
versions
))
continue
continue
...
...
tests/packages/test_main.py
View file @
4ae1def3
...
@@ -152,3 +152,20 @@ def test_dependency_from_pep_508_with_python_version_union_of_multi():
...
@@ -152,3 +152,20 @@ def test_dependency_from_pep_508_with_python_version_union_of_multi():
'python_version >= "2.7" and python_version < "2.8" '
'python_version >= "2.7" and python_version < "2.8" '
'or python_version >= "3.4" and python_version < "3.5"'
'or python_version >= "3.4" and python_version < "3.5"'
)
)
def
test_dependency_from_pep_508_with_not_in_op_marker
():
name
=
(
"jinja2 (>=2.7,<2.8)"
'; python_version not in "3.0,3.1,3.2" and extra == "export"'
)
dep
=
dependency_from_pep_508
(
name
)
assert
dep
.
name
==
"jinja2"
assert
str
(
dep
.
constraint
)
==
">=2.7,<2.8"
assert
dep
.
in_extras
==
[
"export"
]
assert
dep
.
python_versions
==
"!=3.0.*, !=3.1.*, !=3.2.*"
assert
(
str
(
dep
.
marker
)
==
'python_version not in "3.0,3.1,3.2" and extra == "export"'
)
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