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
b6d4b0ad
Commit
b6d4b0ad
authored
Apr 28, 2022
by
Arun Babu Neelicattu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chooser: improve link skip logging
parent
1b77dcf8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
src/poetry/installation/chooser.py
+15
-2
No files found.
src/poetry/installation/chooser.py
View file @
b6d4b0ad
from
__future__
import
annotations
from
__future__
import
annotations
import
logging
import
re
import
re
from
typing
import
TYPE_CHECKING
from
typing
import
TYPE_CHECKING
...
@@ -17,6 +18,9 @@ if TYPE_CHECKING:
...
@@ -17,6 +18,9 @@ if TYPE_CHECKING:
from
poetry.utils.env
import
Env
from
poetry.utils.env
import
Env
logger
=
logging
.
getLogger
(
__name__
)
class
InvalidWheelName
(
Exception
):
class
InvalidWheelName
(
Exception
):
pass
pass
...
@@ -66,9 +70,15 @@ class Chooser:
...
@@ -66,9 +70,15 @@ class Chooser:
if
link
.
is_wheel
and
not
Wheel
(
link
.
filename
)
.
is_supported_by_environment
(
if
link
.
is_wheel
and
not
Wheel
(
link
.
filename
)
.
is_supported_by_environment
(
self
.
_env
self
.
_env
):
):
logger
.
debug
(
"Skipping wheel
%
s as this is not supported by the current"
" environment"
,
link
.
filename
,
)
continue
continue
if
link
.
ext
in
{
".egg"
,
".exe"
,
".msi"
,
".rpm"
,
".srpm"
}:
if
link
.
ext
in
{
".egg"
,
".exe"
,
".msi"
,
".rpm"
,
".srpm"
}:
logger
.
debug
(
"Skipping unsupported distribution
%
s"
,
link
.
filename
)
continue
continue
links
.
append
(
link
)
links
.
append
(
link
)
...
@@ -78,8 +88,6 @@ class Chooser:
...
@@ -78,8 +88,6 @@ class Chooser:
# Get the best link
# Get the best link
chosen
=
max
(
links
,
key
=
lambda
link
:
self
.
_sort_key
(
package
,
link
))
chosen
=
max
(
links
,
key
=
lambda
link
:
self
.
_sort_key
(
package
,
link
))
if
not
chosen
:
raise
RuntimeError
(
f
"Unable to find installation candidates for {package}"
)
return
chosen
return
chosen
...
@@ -105,6 +113,11 @@ class Chooser:
...
@@ -105,6 +113,11 @@ class Chooser:
h
=
link
.
hash_name
+
":"
+
link
.
hash
h
=
link
.
hash_name
+
":"
+
link
.
hash
if
h
not
in
hashes
:
if
h
not
in
hashes
:
logger
.
debug
(
"Skipping
%
s as
%
s checksum does not match expected value"
,
link
.
filename
,
link
.
hash_name
,
)
continue
continue
selected_links
.
append
(
link
)
selected_links
.
append
(
link
)
...
...
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