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
0db1ebe7
Unverified
Commit
0db1ebe7
authored
Jul 25, 2018
by
Sébastien Eustace
Committed by
Sébastien Eustace
Jul 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve dependency resolution debug info
parent
b7efecd8
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
9 deletions
+52
-9
poetry/console/commands/command.py
+6
-1
poetry/console/styles/poetry.py
+1
-0
poetry/mixology/version_solver.py
+5
-7
poetry/puzzle/provider.py
+40
-1
No files found.
poetry/console/commands/command.py
View file @
0db1ebe7
...
...
@@ -7,7 +7,12 @@ from ..styles.poetry import PoetryStyle
class
CommandFormatter
(
logging
.
Formatter
):
_colors
=
{
"error"
:
"fg=red"
,
"warning"
:
"fg=yellow"
,
"debug"
:
"fg=blue"
}
_colors
=
{
"error"
:
"fg=red"
,
"warning"
:
"fg=yellow"
,
"debug"
:
"debug"
,
"info"
:
"fg=blue"
,
}
def
format
(
self
,
record
):
if
not
record
.
exc_info
:
...
...
poetry/console/styles/poetry.py
View file @
0db1ebe7
...
...
@@ -10,6 +10,7 @@ class PoetryStyle(CleoStyle):
self
.
output
.
get_formatter
()
.
add_style
(
"warning"
,
"yellow"
)
self
.
output
.
get_formatter
()
.
add_style
(
"question"
,
"blue"
)
self
.
output
.
get_formatter
()
.
add_style
(
"comment"
,
"cyan"
)
self
.
output
.
get_formatter
()
.
add_style
(
"debug"
,
"black"
,
options
=
[
"bold"
])
def
writeln
(
self
,
...
...
poetry/mixology/version_solver.py
View file @
0db1ebe7
...
...
@@ -169,7 +169,7 @@ class VersionSolver:
return
_conflict
self
.
_log
(
"
<fg=blue>derived</>
: {}{}"
.
format
(
"
derived
: {}{}"
.
format
(
"not "
if
unsatisfied
.
is_positive
()
else
""
,
unsatisfied
.
dependency
)
)
...
...
@@ -193,7 +193,7 @@ class VersionSolver:
.. _conflict resolution: https://github.com/dart-lang/pub/tree/master/doc/solver.md#conflict-resolution
"""
self
.
_log
(
"
<fg=red;options=bold>conflict</>
: {}"
.
format
(
incompatibility
))
self
.
_log
(
"
conflict
: {}"
.
format
(
incompatibility
))
new_incompatibility
=
False
while
not
incompatibility
.
is_failure
():
...
...
@@ -302,7 +302,7 @@ class VersionSolver:
new_incompatibility
=
True
partially
=
""
if
difference
is
None
else
" partially"
bang
=
"
<fg=red>!</>
"
bang
=
"
!
"
self
.
_log
(
"{} {} is{} satisfied by {}"
.
format
(
bang
,
most_recent_term
,
partially
,
most_recent_satisfier
...
...
@@ -397,9 +397,7 @@ class VersionSolver:
if
not
conflict
:
self
.
_solution
.
decide
(
version
)
self
.
_log
(
"<fg=blue>selecting</> {} ({})"
.
format
(
version
.
name
,
version
.
full_pretty_version
)
"selecting {} ({})"
.
format
(
version
.
name
,
version
.
full_pretty_version
)
)
return
dependency
.
name
...
...
@@ -420,7 +418,7 @@ class VersionSolver:
)
def
_add_incompatibility
(
self
,
incompatibility
):
# type: (Incompatibility) -> None
self
.
_log
(
"
<fg=blue>fact</>
: {}"
.
format
(
incompatibility
))
self
.
_log
(
"
fact
: {}"
.
format
(
incompatibility
))
for
term
in
incompatibility
.
terms
:
if
term
.
dependency
.
name
not
in
self
.
_incompatibilities
:
...
...
poetry/puzzle/provider.py
View file @
0db1ebe7
import
logging
import
os
import
pkginfo
import
re
import
shutil
import
time
...
...
@@ -360,7 +361,9 @@ class Provider:
dependencies
.
append
(
deps
[
0
])
continue
self
.
debug
(
"Duplicate dependencies for {}"
.
format
(
dep_name
))
self
.
debug
(
"<debug>Duplicate dependencies for {}</debug>"
.
format
(
dep_name
)
)
# Regrouping by constraint
by_constraint
=
{}
...
...
@@ -465,6 +468,42 @@ class Provider:
return
self
.
_io
def
debug
(
self
,
message
,
depth
=
0
):
if
message
.
startswith
(
"fact:"
):
if
"depends on"
in
message
:
message
=
re
.
sub
(
"fact: (.+?)(?:(
\
()(.+?)(
\
)))? depends on (.+?)
\
((.+?)
\
)"
,
"<fg=blue>fact</>: <info>
\\
1</info>
\\
2<comment>
\\
3</comment>
\\
4 "
"depends on <info>
\\
5</info> (<comment>
\\
6</comment>)"
,
message
,
)
else
:
message
=
re
.
sub
(
"fact: (.+) is (.+)"
,
"<fg=blue>fact</>: <info>
\\
1</info> is <comment>
\\
2</comment>"
,
message
,
)
elif
message
.
startswith
(
"selecting "
):
message
=
re
.
sub
(
"selecting (.+?)
\
((.+?)
\
)"
,
"<fg=blue>selecting</> <info>
\\
1</info> (<comment>
\\
2</comment>)"
,
message
,
)
elif
message
.
startswith
(
"derived:"
):
message
=
re
.
sub
(
"derived: (.+?)(?:(
\
()(.+?)(
\
)))?$"
,
"<fg=blue>derived</>: <info>
\\
1</info>
\\
2<comment>
\\
3</comment>
\\
4"
,
message
,
)
elif
message
.
startswith
(
"conflict:"
):
message
=
re
.
sub
(
"conflict: (.+?)(?:(
\
()(.+?)(
\
)))? depends on (.+?)
\
((.+?)
\
)"
,
"<fg=red;options=bold>conflict</>: <info>
\\
1</info>
\\
2<comment>
\\
3</comment>
\\
4 "
"depends on <info>
\\
5</info> (<comment>
\\
6</comment>)"
,
message
,
)
message
=
message
.
replace
(
"! "
,
"<error>!</error> "
)
if
self
.
is_debugging
():
debug_info
=
str
(
message
)
debug_info
=
(
...
...
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