-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add output for poetry lock --check #5081
Add output for poetry lock --check #5081
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use <error>...</error>
as in
self.line(f"<error>Error: {error}</error>") |
for coloring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we wait on an opinion from triage team on this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would add a punctuation mark at the end of the message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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 :) |
@@ -57,12 +57,11 @@ def handle(self) -> None: | |||
self.call("lock", " ".join(options)) | |||
|
|||
if not locker.is_fresh(): | |||
self.line_error( | |||
self._io.write_line( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should start with "Warning: "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should also start with "Warning: "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Sorry, it should have taken less time to figure this out for me :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be poetry lock [--no-update]
instead of poetry update
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same in installer.py
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
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