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
d34dba71
Commit
d34dba71
authored
Apr 09, 2022
by
Randy Döring
Committed by
Arun Babu Neelicattu
Apr 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: move logic to get suitable locked package inside _get_locked
parent
32871e89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
src/poetry/mixology/version_solver.py
+9
-6
No files found.
src/poetry/mixology/version_solver.py
View file @
d34dba71
...
@@ -368,11 +368,7 @@ class VersionSolver:
...
@@ -368,11 +368,7 @@ class VersionSolver:
return
not
dependency
.
marker
.
is_any
(),
1
return
not
dependency
.
marker
.
is_any
(),
1
locked
=
self
.
_get_locked
(
dependency
)
locked
=
self
.
_get_locked
(
dependency
)
if
locked
and
(
if
locked
:
dependency
.
constraint
.
allows
(
locked
.
version
)
or
locked
.
is_prerelease
()
and
dependency
.
constraint
.
allows
(
locked
.
version
.
next_patch
())
):
return
not
dependency
.
marker
.
is_any
(),
1
return
not
dependency
.
marker
.
is_any
(),
1
# VCS, URL, File or Directory dependencies
# VCS, URL, File or Directory dependencies
...
@@ -399,7 +395,7 @@ class VersionSolver:
...
@@ -399,7 +395,7 @@ class VersionSolver:
dependency
=
min
(
*
unsatisfied
,
key
=
_get_min
)
dependency
=
min
(
*
unsatisfied
,
key
=
_get_min
)
locked
=
self
.
_get_locked
(
dependency
)
locked
=
self
.
_get_locked
(
dependency
)
if
locked
is
None
or
not
dependency
.
constraint
.
allows
(
locked
.
version
)
:
if
locked
is
None
:
try
:
try
:
packages
=
self
.
_dependency_cache
.
search_for
(
dependency
)
packages
=
self
.
_dependency_cache
.
search_for
(
dependency
)
except
ValueError
as
e
:
except
ValueError
as
e
:
...
@@ -500,6 +496,13 @@ class VersionSolver:
...
@@ -500,6 +496,13 @@ class VersionSolver:
if
not
allow_similar
and
not
dependency
.
is_same_package_as
(
locked
):
if
not
allow_similar
and
not
dependency
.
is_same_package_as
(
locked
):
return
None
return
None
if
not
(
dependency
.
constraint
.
allows
(
locked
.
version
)
or
locked
.
is_prerelease
()
and
dependency
.
constraint
.
allows
(
locked
.
version
.
next_patch
())
):
return
None
return
locked
return
locked
def
_log
(
self
,
text
:
str
)
->
None
:
def
_log
(
self
,
text
:
str
)
->
None
:
...
...
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