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
af3b46d7
Unverified
Commit
af3b46d7
authored
Mar 29, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed handling of markers with the in operator
parent
9ecb7579
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
53 additions
and
1 deletions
+53
-1
CHANGELOG.md
+4
-1
poetry/packages/__init__.py
+25
-0
tests/packages/test_main.py
+24
-0
No files found.
CHANGELOG.md
View file @
af3b46d7
...
@@ -6,12 +6,15 @@
...
@@ -6,12 +6,15 @@
-
Added compatibility with Python 3.4 and 3.5.
-
Added compatibility with Python 3.4 and 3.5.
### Changed
### Changed
-
Improved dependency resolution to avoid unnecessary operations.
-
Improved dependency resolution to avoid unnecessary operations.
-
Improved dependency resolution speed.
-
Improved dependency resolution speed.
### Fixed
-
Fixed handling of markers with the
`in`
operator.
## [0.6.5] - 2018-03-22
## [0.6.5] - 2018-03-22
...
...
poetry/packages/__init__.py
View file @
af3b46d7
...
@@ -98,6 +98,22 @@ def dependency_from_pep_508(name):
...
@@ -98,6 +98,22 @@ def dependency_from_pep_508(name):
op
=
''
op
=
''
elif
op
==
'!='
:
elif
op
==
'!='
:
version
+=
'.*'
version
+=
'.*'
elif
op
==
'in'
:
versions
=
[]
for
v
in
version
.
split
(
' '
):
split
=
v
.
split
(
'.'
)
if
len
(
split
)
in
[
1
,
2
]:
split
.
append
(
'*'
)
op
=
''
else
:
op
=
'=='
versions
.
append
(
op
+
'.'
.
join
(
split
))
if
versions
:
ands
.
append
(
' || '
.
join
(
versions
))
continue
ands
.
append
(
'{}{}'
.
format
(
op
,
version
))
ands
.
append
(
'{}{}'
.
format
(
op
,
version
))
...
@@ -112,6 +128,15 @@ def dependency_from_pep_508(name):
...
@@ -112,6 +128,15 @@ def dependency_from_pep_508(name):
for
op
,
platform
in
or_
:
for
op
,
platform
in
or_
:
if
op
==
'=='
:
if
op
==
'=='
:
op
=
''
op
=
''
elif
op
==
'in'
:
platforms
=
[]
for
v
in
platform
.
split
(
' '
):
platforms
.
append
(
v
)
if
platforms
:
ands
.
append
(
' || '
.
join
(
platforms
))
continue
ands
.
append
(
'{}{}'
.
format
(
op
,
platform
))
ands
.
append
(
'{}{}'
.
format
(
op
,
platform
))
...
...
tests/packages/test_main.py
View file @
af3b46d7
...
@@ -96,3 +96,27 @@ def test_dependency_from_pep_508_complex():
...
@@ -96,3 +96,27 @@ def test_dependency_from_pep_508_complex():
assert
dep
.
extras
==
[
'foo'
]
assert
dep
.
extras
==
[
'foo'
]
assert
dep
.
python_versions
==
'>=2.7 !=3.2.*'
assert
dep
.
python_versions
==
'>=2.7 !=3.2.*'
assert
dep
.
platform
==
'win32 || darwin'
assert
dep
.
platform
==
'win32 || darwin'
def
test_dependency_python_version_in
():
name
=
(
'requests (==2.18.0); '
'python_version in
\'
3.3 3.4 3.5
\'
'
)
dep
=
dependency_from_pep_508
(
name
)
assert
dep
.
name
==
'requests'
assert
str
(
dep
.
constraint
)
==
'== 2.18.0.0'
assert
dep
.
python_versions
==
'3.3.* || 3.4.* || 3.5.*'
def
test_dependency_platform_in
():
name
=
(
'requests (==2.18.0); '
'sys_platform in
\'
win32 darwin
\'
'
)
dep
=
dependency_from_pep_508
(
name
)
assert
dep
.
name
==
'requests'
assert
str
(
dep
.
constraint
)
==
'== 2.18.0.0'
assert
dep
.
platform
==
'win32 || darwin'
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