Add output for poetry lock --check#5081
Add output for poetry lock --check#5081finswimmer merged 7 commits intopython-poetry:masterfrom artemrys:poetry-lock-messages
Conversation
|
I don't like the wording "up to date" resp. "out of date" because it is kind of ambiguous. The command does not check if some dependencies in the lock file are not up to date (as long as they comply with the constraints from Further, I would say the minimum fix is running I am aware that the warning when running All in all, I think the wording should be harmonized. Either consistent with But that is only my opinion. Any strong opinions from @python-poetry/triage ? |
src/poetry/console/commands/lock.py
Outdated
| self.line("poetry.lock is up to date") | ||
| return 0 | ||
| self.line( | ||
| "Error: poetry.lock is out of date. Run `poetry update` to fix it" |
There was a problem hiding this comment.
You should use <error>...</error> as in
for coloring.
There was a problem hiding this comment.
Should we wait on an opinion from triage team on this one?
There was a problem hiding this comment.
I think adding <error>...</error> is safe.
Considering the wording: Since there are no replies yet, either nobody had time to think about it or has no strong opinion or is just fine with the proposal. 😉 If you want to speed up the process (and are not afraid from some more iterations of changes) we can push this PR until I will approve it. Before merging, a core member will look at the changes anyway and may (or may not) request further changes.
Thus, if you want to proceed, I propose to stick with the wording from the documentation (poetry.lock is (not) consistent with pyproject.toml) and recommend running poetry lock [--no-update]. Otherwise, you can also just wait some more days for additional opinions.
There was a problem hiding this comment.
I propose to stick with the wording from the documentation (poetry.lock is (not) consistent with pyproject.toml) and recommend running poetry lock [--no-update]
I like this one 👍
There was a problem hiding this comment.
Updated messages
|
Can you adapt the warnings in poetry/src/poetry/installation/installer.py Lines 261 to 264 in 08ed8ed poetry/src/poetry/console/commands/export.py Lines 62 to 65 in 08ed8ed I'd say we replace the first and the last sentence with the sentences from the error message and replace "outdated" in the second sentence by "improper" (or similar). |
src/poetry/console/commands/lock.py
Outdated
| if self.poetry.locker.is_locked() and self.poetry.locker.is_fresh() | ||
| else 1 | ||
| if self.poetry.locker.is_locked() and self.poetry.locker.is_fresh(): | ||
| self.line("poetry.lock is consistent with pyproject.toml") |
There was a problem hiding this comment.
I would add a punctuation mark at the end of the message.
|
I've updated |
|
Sorry, for nitpicking again, but hopefully the last request for change from me. 😉 I didn't meant to change the warnings in Just to be clear: The error for |
Done :) |
|
|
||
| if not locker.is_fresh(): | ||
| self.line_error( | ||
| self._io.write_line( |
There was a problem hiding this comment.
Probably, line_error() is correct here, because warnings should go to stderr instead of stdout. I know, in installer.py the warning is written to stdout... Maybe, something that can be harmonized for all warnings in a separate PR...
| "the latest changes in pyproject.toml. " | ||
| "You may be getting outdated dependencies. " | ||
| "Run update to update them." | ||
| "Error: poetry.lock is not consistent with pyproject.toml. " |
There was a problem hiding this comment.
This should start with "Warning: "
src/poetry/installation/installer.py
Outdated
| "the latest changes in pyproject.toml. " | ||
| "You may be getting outdated dependencies. " | ||
| "Run update to update them." | ||
| "Error: poetry.lock is not consistent with pyproject.toml. " |
There was a problem hiding this comment.
This should also start with "Warning: "
|
Sorry, it should have taken less time to figure this out for me :) |
radoering
left a comment
There was a problem hiding this comment.
Sorry, I missed this before.
| "Run update to update them." | ||
| "Warning: poetry.lock is not consistent with pyproject.toml. " | ||
| "You may be getting improper dependencies. " | ||
| "Run `poetry update` to fix it." |
There was a problem hiding this comment.
Should be poetry lock [--no-update] instead of poetry update.
|
Finally looks good to me. @finswimmer : Can you approve running the workflows and consider merging if the tests pass? |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Pull Request Check List
Resolves: #5038