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
77618678
Unverified
Commit
77618678
authored
Oct 19, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a possible error on some combinations of markers
parent
c9b73e7b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
8 deletions
+43
-8
CHANGELOG.md
+7
-0
poetry/packages/utils/utils.py
+13
-8
tests/packages/utils/__init__.py
+0
-0
tests/packages/utils/test_utils.py
+23
-0
No files found.
CHANGELOG.md
View file @
77618678
# Change Log
## [Unreleased]
### Fixed
-
Fixed possible error on some combinations of markers.
## [0.12.3] - 2018-10-18
### Fixed
...
...
poetry/packages/utils/utils.py
View file @
77618678
...
...
@@ -139,22 +139,27 @@ def convert_markers(marker):
requirements
=
{}
def
_group
(
_groups
,
or_
=
False
):
ors
=
{}
for
group
in
_groups
:
if
isinstance
(
group
,
tuple
):
if
isinstance
(
group
,
list
):
_group
(
group
,
or_
=
True
)
else
:
variable
,
op
,
value
=
group
group_name
=
str
(
variable
)
if
group_name
not
in
requirements
:
requirements
[
group_name
]
=
[[]]
elif
or_
:
requirements
[
group_name
]
.
append
([])
requirements
[
group_name
]
=
[]
if
group_name
not
in
ors
:
ors
[
group_name
]
=
or_
or_
=
False
if
ors
[
group_name
]
or
not
requirements
[
group_name
]:
requirements
[
group_name
]
.
append
([])
requirements
[
group_name
][
-
1
]
.
append
((
str
(
op
),
str
(
value
)))
else
:
_group
(
group
,
or_
=
True
)
_group
(
groups
)
ors
[
group_name
]
=
False
_group
(
groups
,
or_
=
True
)
return
requirements
...
...
tests/packages/utils/__init__.py
0 → 100644
View file @
77618678
tests/packages/utils/test_utils.py
0 → 100644
View file @
77618678
from
poetry.packages.utils.utils
import
convert_markers
from
poetry.version.markers
import
parse_marker
def
test_convert_markers
():
marker
=
parse_marker
(
'sys_platform == "win32" and python_version < "3.6" '
'or sys_platform == "win32" and python_version < "3.6" and python_version >= "3.3" '
'or sys_platform == "win32" and python_version < "3.3"'
)
converted
=
convert_markers
(
marker
)
assert
converted
[
"python_version"
]
==
[
[(
"<"
,
"3.6"
)],
[(
"<"
,
"3.6"
),
(
">="
,
"3.3"
)],
[(
"<"
,
"3.3"
)],
]
marker
=
parse_marker
(
'python_version == "2.7" or python_version == "2.6"'
)
converted
=
convert_markers
(
marker
)
assert
converted
[
"python_version"
]
==
[[(
"=="
,
"2.7"
)],
[(
"=="
,
"2.6"
)]]
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