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
435739a4
Commit
435739a4
authored
Jul 24, 2020
by
Sébastien Eustace
Committed by
Arun Babu Neelicattu
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the lock content hash not being updated with the add/remove commands
parent
6880fd6f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
4 deletions
+19
-4
poetry/console/commands/installer_command.py
+8
-1
poetry/console/commands/remove.py
+0
-1
poetry/installation/installer.py
+5
-0
tests/console/commands/test_add.py
+2
-0
tests/console/conftest.py
+4
-2
No files found.
poetry/console/commands/installer_command.py
View file @
435739a4
...
@@ -5,14 +5,21 @@ from .env_command import EnvCommand
...
@@ -5,14 +5,21 @@ from .env_command import EnvCommand
if
TYPE_CHECKING
:
if
TYPE_CHECKING
:
from
poetry.installation.installer
import
Installer
from
poetry.installation.installer
import
Installer
from
poetry.installation.installer
import
Optional
class
InstallerCommand
(
EnvCommand
):
class
InstallerCommand
(
EnvCommand
):
def
__init__
(
self
):
def
__init__
(
self
):
self
.
_installer
=
None
self
.
_installer
=
None
# type: Optional[Installer]
super
(
InstallerCommand
,
self
)
.
__init__
()
super
(
InstallerCommand
,
self
)
.
__init__
()
def
reset_poetry
(
self
):
super
(
InstallerCommand
,
self
)
.
reset_poetry
()
self
.
_installer
.
set_package
(
self
.
poetry
.
package
)
self
.
_installer
.
set_locker
(
self
.
poetry
.
locker
)
@property
@property
def
installer
(
self
):
# type: () -> Installer
def
installer
(
self
):
# type: () -> Installer
return
self
.
_installer
return
self
.
_installer
...
...
poetry/console/commands/remove.py
View file @
435739a4
...
@@ -60,7 +60,6 @@ list of installed packages
...
@@ -60,7 +60,6 @@ list of installed packages
# Update packages
# Update packages
self
.
reset_poetry
()
self
.
reset_poetry
()
self
.
_installer
.
set_package
(
self
.
poetry
.
package
)
self
.
_installer
.
use_executor
(
self
.
_installer
.
use_executor
(
self
.
poetry
.
config
.
get
(
"experimental.new-installer"
,
False
)
self
.
poetry
.
config
.
get
(
"experimental.new-installer"
,
False
)
)
)
...
...
poetry/installation/installer.py
View file @
435739a4
...
@@ -79,6 +79,11 @@ class Installer:
...
@@ -79,6 +79,11 @@ class Installer:
return
self
return
self
def
set_locker
(
self
,
locker
):
# type: (Locker) -> Installer
self
.
_locker
=
locker
return
self
def
run
(
self
):
def
run
(
self
):
# Force update if there is no lock file present
# Force update if there is no lock file present
if
not
self
.
_update
and
not
self
.
_locker
.
is_locked
():
if
not
self
.
_update
and
not
self
.
_locker
.
is_locked
():
...
...
tests/console/commands/test_add.py
View file @
435739a4
...
@@ -792,6 +792,7 @@ Package operations: 1 install, 0 updates, 0 removals
...
@@ -792,6 +792,7 @@ Package operations: 1 install, 0 updates, 0 removals
def
test_add_with_lock
(
app
,
repo
,
tester
):
def
test_add_with_lock
(
app
,
repo
,
tester
):
content_hash
=
app
.
poetry
.
locker
.
_get_content_hash
()
repo
.
add_package
(
get_package
(
"cachy"
,
"0.2.0"
))
repo
.
add_package
(
get_package
(
"cachy"
,
"0.2.0"
))
tester
.
execute
(
"cachy --lock"
)
tester
.
execute
(
"cachy --lock"
)
...
@@ -806,6 +807,7 @@ Writing lock file
...
@@ -806,6 +807,7 @@ Writing lock file
"""
"""
assert
expected
==
tester
.
io
.
fetch_output
()
assert
expected
==
tester
.
io
.
fetch_output
()
assert
content_hash
!=
app
.
poetry
.
locker
.
lock_data
[
"metadata"
][
"content-hash"
]
def
test_add_no_constraint_old_installer
(
app
,
repo
,
installer
,
old_tester
):
def
test_add_no_constraint_old_installer
(
app
,
repo
,
installer
,
old_tester
):
...
...
tests/console/conftest.py
View file @
435739a4
...
@@ -125,7 +125,9 @@ class Application(BaseApplication):
...
@@ -125,7 +125,9 @@ class Application(BaseApplication):
self
.
_poetry
=
Factory
()
.
create_poetry
(
self
.
_poetry
.
file
.
path
.
parent
)
self
.
_poetry
=
Factory
()
.
create_poetry
(
self
.
_poetry
.
file
.
path
.
parent
)
self
.
_poetry
.
set_pool
(
poetry
.
pool
)
self
.
_poetry
.
set_pool
(
poetry
.
pool
)
self
.
_poetry
.
set_config
(
poetry
.
config
)
self
.
_poetry
.
set_config
(
poetry
.
config
)
self
.
_poetry
.
set_locker
(
poetry
.
locker
)
self
.
_poetry
.
set_locker
(
Locker
(
poetry
.
locker
.
lock
.
path
,
self
.
_poetry
.
local_config
)
)
class
Locker
(
BaseLocker
):
class
Locker
(
BaseLocker
):
...
@@ -163,7 +165,7 @@ class Locker(BaseLocker):
...
@@ -163,7 +165,7 @@ class Locker(BaseLocker):
self
.
_locked
=
True
self
.
_locked
=
True
return
return
self
.
_lock_data
=
None
self
.
_lock_data
=
data
class
Poetry
(
BasePoetry
):
class
Poetry
(
BasePoetry
):
...
...
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