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
32871e89
Commit
32871e89
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: access attribute _locked only via method _get_locked
parent
cc4d6899
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
src/poetry/mixology/version_solver.py
+5
-3
No files found.
src/poetry/mixology/version_solver.py
View file @
32871e89
...
...
@@ -413,7 +413,7 @@ class VersionSolver:
# prefer locked version of compatible (not exact same) dependency;
# required in order to not unnecessarily update dependencies with
# extras, e.g. "coverage" vs. "coverage[toml]"
locked
=
self
.
_
locked
.
get
(
dependency
.
name
,
Non
e
)
locked
=
self
.
_
get_locked
(
dependency
,
allow_similar
=
Tru
e
)
if
locked
is
not
None
:
package
=
next
(
(
p
for
p
in
packages
if
p
.
version
==
locked
.
version
),
None
...
...
@@ -487,7 +487,9 @@ class VersionSolver:
incompatibility
)
def
_get_locked
(
self
,
dependency
:
Dependency
)
->
Package
|
None
:
def
_get_locked
(
self
,
dependency
:
Dependency
,
*
,
allow_similar
:
bool
=
False
)
->
Package
|
None
:
if
dependency
.
name
in
self
.
_use_latest
:
return
None
...
...
@@ -495,7 +497,7 @@ class VersionSolver:
if
not
locked
:
return
None
if
not
dependency
.
is_same_package_as
(
locked
):
if
not
allow_similar
and
not
dependency
.
is_same_package_as
(
locked
):
return
None
return
locked
...
...
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