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
cdc7aa41
Unverified
Commit
cdc7aa41
authored
Jul 18, 2023
by
trag1c
Committed by
GitHub
Jul 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added downgrading note when updating to an older version (#8176)
parent
01657dde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
src/poetry/installation/executor.py
+9
-4
tests/installation/test_executor.py
+6
-4
No files found.
src/poetry/installation/executor.py
View file @
cdc7aa41
...
...
@@ -461,13 +461,18 @@ class Executor:
)
if
isinstance
(
operation
,
Update
):
initial_version
=
(
initial_pkg
:
=
operation
.
initial_package
)
.
version
target_version
=
(
target_pkg
:
=
operation
.
target_package
)
.
version
update_kind
=
(
"Updating"
if
target_version
>=
initial_version
else
"Downgrading"
)
return
(
f
"<{base_tag}>
Updating
"
f
" <{package_color}>{
operation.initial_package
.name}</{package_color}> "
f
"<{base_tag}>
{update_kind}
"
f
" <{package_color}>{
initial_pkg
.name}</{package_color}> "
f
"(<{source_operation_color}>"
f
"{
operation.initial_package
.full_pretty_version}"
f
"{
initial_pkg
.full_pretty_version}"
f
"</{source_operation_color}> -> <{operation_color}>"
f
"{
operation.target_package
.full_pretty_version}</>)</>"
f
"{
target_pkg
.full_pretty_version}</>)</>"
)
return
""
...
...
tests/installation/test_executor.py
View file @
cdc7aa41
...
...
@@ -246,6 +246,7 @@ def test_execute_executes_a_batch_of_operations(
Install
(
Package
(
"pytest"
,
"3.5.1"
)),
Uninstall
(
Package
(
"attrs"
,
"17.4.0"
)),
Update
(
Package
(
"requests"
,
"2.18.3"
),
Package
(
"requests"
,
"2.18.4"
)),
Update
(
Package
(
"pytest"
,
"3.5.1"
),
Package
(
"pytest"
,
"3.5.0"
)),
Uninstall
(
Package
(
"clikit"
,
"0.2.3"
))
.
skip
(
"Not currently installed"
),
Install
(
file_package
),
Install
(
directory_package
),
...
...
@@ -254,11 +255,12 @@ def test_execute_executes_a_batch_of_operations(
)
expected
=
f
"""
Package operations: 4 installs,
1 update
, 1 removal
Package operations: 4 installs,
2 updates
, 1 removal
• Installing pytest (3.5.1)
• Removing attrs (17.4.0)
• Updating requests (2.18.3 -> 2.18.4)
• Downgrading pytest (3.5.1 -> 3.5.0)
• Installing demo (0.1.0 {file_package.source_url})
• Installing simple-project (1.2.3 {directory_package.source_url})
• Installing demo (0.1.0 master)
...
...
@@ -267,9 +269,9 @@ Package operations: 4 installs, 1 update, 1 removal
expected_lines
=
set
(
expected
.
splitlines
())
output_lines
=
set
(
io
.
fetch_output
()
.
splitlines
())
assert
output_lines
==
expected_lines
assert
wheel_install
.
call_count
==
5
#
Two pip uninstalls: one for the remove operation one for the update operation
assert
len
(
env
.
executed
)
==
2
assert
wheel_install
.
call_count
==
6
#
3 pip uninstalls: one for the remove operation and two for the update operations
assert
len
(
env
.
executed
)
==
3
assert
return_code
==
0
assert
prepare_spy
.
call_count
==
2
...
...
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