Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify message about an outdated lock file #8962

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/poetry/console/commands/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ 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"
" lock [--no-update]` to fix it."
"pyproject.toml changed significantly since poetry.lock was last generated. "
"Run `poetry lock [--no-update]` to fix the lock file."
]

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

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

locker_extras = {
Expand Down
4 changes: 2 additions & 2 deletions tests/console/commands/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ 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. "
"Run `poetry lock [--no-update]` to fix it.\n"
"Error: pyproject.toml changed significantly since poetry.lock was last generated. "
"Run `poetry lock [--no-update]` to fix the lock file.\n"
)

assert tester.io.fetch_error() == expected
Expand Down
4 changes: 2 additions & 2 deletions tests/console/commands/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ 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. "
"Run `poetry lock [--no-update]` to fix it.\n"
"Error: pyproject.toml changed significantly since poetry.lock was last generated. "
"Run `poetry lock [--no-update]` to fix the lock file.\n"
)

assert tester.io.fetch_error() == expected
Expand Down
4 changes: 2 additions & 2 deletions tests/installation/test_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ 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. "
"Run `poetry lock [--no-update]` to fix it."
"pyproject.toml changed significantly since poetry.lock was last generated. "
"Run `poetry lock [--no-update]` to fix the lock file."
),
):
installer.run()
Expand Down
Loading