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
c78503e5
Unverified
Commit
c78503e5
authored
Dec 06, 2019
by
Sébastien Eustace
Committed by
GitHub
Dec 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the error message displayed on Python requirements conflict (#1681)
parent
2fa4678d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
9 deletions
+20
-9
poetry/mixology/failure.py
+17
-8
tests/mixology/version_solver/test_python_constraint.py
+3
-1
No files found.
poetry/mixology/failure.py
View file @
c78503e5
...
@@ -31,18 +31,27 @@ class _Writer:
...
@@ -31,18 +31,27 @@ class _Writer:
def
write
(
self
):
def
write
(
self
):
buffer
=
[]
buffer
=
[]
required_python_version
=
Non
e
required_python_version
_notification
=
Fals
e
for
incompatibility
in
self
.
_root
.
external_incompatibilities
:
for
incompatibility
in
self
.
_root
.
external_incompatibilities
:
if
isinstance
(
incompatibility
.
cause
,
PythonCause
):
if
isinstance
(
incompatibility
.
cause
,
PythonCause
):
required_python_version
=
incompatibility
.
cause
.
root_python_version
if
not
required_python_version_notification
:
break
buffer
.
append
(
"The current project's Python requirement ({}) "
"is not compatible with some of the required "
"packages Python requirement:"
.
format
(
incompatibility
.
cause
.
root_python_version
)
)
required_python_version_notification
=
True
if
required_python_version
is
not
None
:
buffer
.
append
(
buffer
.
append
(
" - {} requires Python {}"
.
format
(
"The current project must support the following Python versions: {}"
.
format
(
incompatibility
.
terms
[
0
]
.
dependency
.
name
,
required_python_version
incompatibility
.
cause
.
python_version
,
)
)
)
)
if
required_python_version_notification
:
buffer
.
append
(
""
)
buffer
.
append
(
""
)
if
isinstance
(
self
.
_root
.
cause
,
ConflictCause
):
if
isinstance
(
self
.
_root
.
cause
,
ConflictCause
):
...
...
tests/mixology/version_solver/test_python_constraint.py
View file @
c78503e5
...
@@ -8,7 +8,9 @@ def test_dependency_does_not_match_root_python_constraint(root, provider, repo):
...
@@ -8,7 +8,9 @@ def test_dependency_does_not_match_root_python_constraint(root, provider, repo):
add_to_repo
(
repo
,
"foo"
,
"1.0.0"
,
python
=
"<3.5"
)
add_to_repo
(
repo
,
"foo"
,
"1.0.0"
,
python
=
"<3.5"
)
error
=
"""The current project must support the following Python versions: ^3.6
error
=
"""The current project's Python requirement (^3.6)
\
is not compatible with some of the required packages Python requirement:
- foo requires Python <3.5
Because no versions of foo match !=1.0.0
Because no versions of foo match !=1.0.0
and foo (1.0.0) requires Python <3.5, foo is forbidden.
and foo (1.0.0) requires Python <3.5, foo is forbidden.
...
...
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