File tree 4 files changed +23
-12
lines changed
4 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -59,10 +59,9 @@ def handle(self) -> None:
59
59
if not locker .is_fresh ():
60
60
self .line_error (
61
61
"<warning>"
62
- "Warning: The lock file is not up to date with "
63
- "the latest changes in pyproject.toml. "
64
- "You may be getting outdated dependencies. "
65
- "Run update to update them."
62
+ "Warning: poetry.lock is not consistent with pyproject.toml. "
63
+ "You may be getting improper dependencies. "
64
+ "Run `poetry lock [--no-update]` to fix it."
66
65
"</warning>"
67
66
)
68
67
Original file line number Diff line number Diff line change @@ -37,11 +37,16 @@ def handle(self) -> int:
37
37
)
38
38
39
39
if self .option ("check" ):
40
- return (
41
- 0
42
- if self .poetry .locker .is_locked () and self .poetry .locker .is_fresh ()
43
- else 1
40
+ if self .poetry .locker .is_locked () and self .poetry .locker .is_fresh ():
41
+ self .line ("poetry.lock is consistent with pyproject.toml." )
42
+ return 0
43
+ self .line (
44
+ "<error>"
45
+ "Error: poetry.lock is not consistent with pyproject.toml. "
46
+ "Run `poetry lock [--no-update]` to fix it."
47
+ "</error>"
44
48
)
49
+ return 1
45
50
46
51
self ._installer .lock (update = not self .option ("no-update" ))
47
52
Original file line number Diff line number Diff line change @@ -258,10 +258,9 @@ def _do_install(self, local_repo: Repository) -> int:
258
258
if not self ._locker .is_fresh ():
259
259
self ._io .write_line (
260
260
"<warning>"
261
- "Warning: The lock file is not up to date with "
262
- "the latest changes in pyproject.toml. "
263
- "You may be getting outdated dependencies. "
264
- "Run update to update them."
261
+ "Warning: poetry.lock is not consistent with pyproject.toml. "
262
+ "You may be getting improper dependencies. "
263
+ "Run `poetry lock [--no-update]` to fix it."
265
264
"</warning>"
266
265
)
267
266
Original file line number Diff line number Diff line change @@ -81,6 +81,12 @@ def test_lock_check_outdated(
81
81
82
82
tester = command_tester_factory ("lock" , poetry = poetry_with_outdated_lockfile )
83
83
status_code = tester .execute ("--check" )
84
+ expected = (
85
+ "Error: poetry.lock is not consistent with pyproject.toml. "
86
+ "Run `poetry lock [--no-update]` to fix it.\n "
87
+ )
88
+
89
+ assert tester .io .fetch_output () == expected
84
90
85
91
# exit with an error
86
92
assert status_code == 1
@@ -101,6 +107,8 @@ def test_lock_check_up_to_date(
101
107
102
108
tester = command_tester_factory ("lock" , poetry = poetry_with_up_to_date_lockfile )
103
109
status_code = tester .execute ("--check" )
110
+ expected = "poetry.lock is consistent with pyproject.toml.\n "
111
+ assert tester .io .fetch_output () == expected
104
112
105
113
# exit with an error
106
114
assert status_code == 0
You can’t perform that action at this time.
0 commit comments