Skip to content

Commit

Permalink
Clarify message about inconsistent lock file
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Feb 10, 2024
1 parent 5f1d1a7 commit 319743d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/poetry/console/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def handle(self) -> int:
check_result["errors"] += ["poetry.lock was not found."]
if self.poetry.locker.is_locked() and not self.poetry.locker.is_fresh():
check_result["errors"] += [
"poetry.lock is not consistent with pyproject.toml. Run `poetry"
"pyproject.toml changes significantly since poetry.lock was generated. Run `poetry"
" lock [--no-update]` to fix it."
]

Expand Down
2 changes: 1 addition & 1 deletion src/poetry/console/commands/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def handle(self) -> int:
return 0
self.line_error(
"<error>"
"Error: poetry.lock is not consistent with pyproject.toml. "
"Error: pyproject.toml changes significantly since poetry.lock was generated. "
"Run `poetry lock [--no-update]` to fix it."
"</error>"
)
Expand Down
2 changes: 1 addition & 1 deletion src/poetry/installation/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _do_install(self) -> int:

if not self._locker.is_fresh():
raise ValueError(
"poetry.lock is not consistent with pyproject.toml. "
"pyproject.toml changes significantly since poetry.lock was generated. "
"Run `poetry lock [--no-update]` to fix it."
)

Expand Down
2 changes: 1 addition & 1 deletion tests/console/commands/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def test_check_lock_outdated(
tester = command_tester_factory("check", poetry=poetry_with_outdated_lockfile)
status_code = tester.execute(options)
expected = (
"Error: poetry.lock is not consistent with pyproject.toml. "
"Error: pyproject.toml changes significantly since poetry.lock was generated. "
"Run `poetry lock [--no-update]` to fix it.\n"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/console/commands/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_lock_check_outdated_legacy(
status_code = tester.execute("--check")
expected = (
"poetry lock --check is deprecated, use `poetry check --lock` instead.\n"
"Error: poetry.lock is not consistent with pyproject.toml. "
"Error: pyproject.toml changes significantly since poetry.lock was generated. "
"Run `poetry lock [--no-update]` to fix it.\n"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/installation/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def test_not_fresh_lock(installer: Installer, locker: Locker) -> None:
with pytest.raises(
ValueError,
match=re.escape(
"poetry.lock is not consistent with pyproject.toml. "
"pyproject.toml changes significantly since poetry.lock was generated. "
"Run `poetry lock [--no-update]` to fix it."
),
):
Expand Down

0 comments on commit 319743d

Please sign in to comment.