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
aac16afe
Unverified
Commit
aac16afe
authored
Mar 14, 2018
by
Sébastien Eustace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix platform specifications not being used when resolving dependencies
parent
0895aaa2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
2 deletions
+39
-2
CHANGELOG.md
+1
-0
poetry/packages/constraints/platform_constraint.py
+4
-1
poetry/puzzle/provider.py
+4
-1
tests/puzzle/test_solver.py
+30
-0
No files found.
CHANGELOG.md
View file @
aac16afe
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
-
Fixed python restricted dependencies not being checked agaisnt virtualenv version.
-
Fixed python restricted dependencies not being checked agaisnt virtualenv version.
-
Fixed python/platform constraint not being picked up for subdependencies.
-
Fixed python/platform constraint not being picked up for subdependencies.
-
Fixed skipped packages appearing as installing.
-
Fixed skipped packages appearing as installing.
-
Fixed platform specification not being used when resolving dependencies.
## [0.4.2] - 2018-03-10
## [0.4.2] - 2018-03-10
...
...
poetry/packages/constraints/platform_constraint.py
View file @
aac16afe
...
@@ -50,11 +50,14 @@ class PlatformConstraint(BaseConstraint):
...
@@ -50,11 +50,14 @@ class PlatformConstraint(BaseConstraint):
return
self
.
_platform
return
self
.
_platform
def
matches
(
self
,
provider
):
def
matches
(
self
,
provider
):
if
not
isinstance
(
provider
,
PlatformConstraint
):
if
not
isinstance
(
provider
,
(
PlatformConstraint
,
EmptyConstraint
)
):
raise
ValueError
(
raise
ValueError
(
'Platform constraints can only be compared with each other'
'Platform constraints can only be compared with each other'
)
)
if
isinstance
(
provider
,
EmptyConstraint
):
return
True
is_equal_op
=
self
.
OP_EQ
is
self
.
_operator
is_equal_op
=
self
.
OP_EQ
is
self
.
_operator
is_non_equal_op
=
self
.
OP_NE
is
self
.
_operator
is_non_equal_op
=
self
.
OP_NE
is
self
.
_operator
is_provider_equal_op
=
self
.
OP_EQ
is
provider
.
operator
is_provider_equal_op
=
self
.
OP_EQ
is
provider
.
operator
...
...
poetry/puzzle/provider.py
View file @
aac16afe
...
@@ -179,7 +179,10 @@ class Provider(SpecificationProvider):
...
@@ -179,7 +179,10 @@ class Provider(SpecificationProvider):
if
not
any
([
r
.
allows_prereleases
()
for
r
in
vertex
.
requirements
]):
if
not
any
([
r
.
allows_prereleases
()
for
r
in
vertex
.
requirements
]):
return
False
return
False
return
self
.
_package
.
python_constraint
.
matches
(
package
.
python_constraint
)
return
(
self
.
_package
.
python_constraint
.
matches
(
package
.
python_constraint
)
and
self
.
_package
.
platform_constraint
.
matches
(
package
.
platform_constraint
)
)
def
sort_dependencies
(
self
,
def
sort_dependencies
(
self
,
dependencies
:
List
[
Dependency
],
dependencies
:
List
[
Dependency
],
...
...
tests/puzzle/test_solver.py
View file @
aac16afe
...
@@ -326,6 +326,36 @@ def test_solver_solves_optional_and_compatible_packages(solver, repo, package):
...
@@ -326,6 +326,36 @@ def test_solver_solves_optional_and_compatible_packages(solver, repo, package):
])
])
def
test_solver_solves_while_respecting_root_platforms
(
solver
,
repo
,
package
):
package
.
platform
=
'darwin'
package_a
=
get_package
(
'A'
,
'1.0'
)
package_b
=
get_package
(
'B'
,
'1.0'
)
package_b
.
python_versions
=
'^3.6'
package_c12
=
get_package
(
'C'
,
'1.2'
)
package_c12
.
platform
=
'win32'
package_c10
=
get_package
(
'C'
,
'1.0'
)
package_c10
.
platform
=
'darwin'
package_b
.
add_dependency
(
'C'
,
'^1.0'
)
repo
.
add_package
(
package_a
)
repo
.
add_package
(
package_b
)
repo
.
add_package
(
package_c10
)
repo
.
add_package
(
package_c12
)
request
=
[
get_dependency
(
'A'
),
get_dependency
(
'B'
)
]
ops
=
solver
.
solve
(
request
)
check_solver_result
(
ops
,
[
{
'job'
:
'install'
,
'package'
:
package_c10
},
{
'job'
:
'install'
,
'package'
:
package_b
},
{
'job'
:
'install'
,
'package'
:
package_a
},
])
def
test_solver_does_not_return_extras_if_not_requested
(
solver
,
repo
):
def
test_solver_does_not_return_extras_if_not_requested
(
solver
,
repo
):
package_a
=
get_package
(
'A'
,
'1.0'
)
package_a
=
get_package
(
'A'
,
'1.0'
)
package_b
=
get_package
(
'B'
,
'1.0'
)
package_b
=
get_package
(
'B'
,
'1.0'
)
...
...
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