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

poetry lock --check has no output #5038

Closed
3 tasks done
DetachHead opened this issue Jan 14, 2022 · 4 comments · Fixed by #5081
Closed
3 tasks done

poetry lock --check has no output #5038

DetachHead opened this issue Jan 14, 2022 · 4 comments · Fixed by #5081
Labels
area/cli Related to the command line area/ux Features and improvements related to the user experience

Comments

@DetachHead
Copy link
Contributor

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: windows 10
  • Poetry version: 1.2.0a2

Issue

it would be nice if there was some sort of output other than just the exit code

> poetry lock --check

> echo %errorlevel%
1

perhaps an error message like

Error: poetry.lock is out of date. run `poetry update` to fix it
@DetachHead DetachHead added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 14, 2022
@finswimmer finswimmer added area/cli Related to the command line Good First Issue area/ux Features and improvements related to the user experience and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jan 16, 2022
@radoering
Copy link
Member

Sounds good. I am just wondering if poetry update is the most suitable recommendation or if poetry lock [--no-update] is better suited? It seemed natural to me to call lock if lock --check failed. That way you can decide if you only want to bring pyproject.toml and poetry.lock in line (without updating already locked dependencies) or if you want to update these, too. As far as I understand, poetry lock is the same as poetry update --lock. Probably, the advantage of poetry update over poetry lock is that you don't have to call poetry install separately.

@artemrys
Copy link
Contributor

@radoering I can take this one, it seems to be an easy change. Do we just need to add some a log here

if self.option("check"):
return (
0
if self.poetry.locker.is_locked() and self.poetry.locker.is_fresh()
else 1
)
and update / create tests?

@radoering
Copy link
Member

@artemrys: Yes, that seems to be the correct part of the code. Tests are in test_lock.py. There are also tests for other commands that already check output. You can use these tests as a guide.

Further, I think in case of success (if poetry.lock is consistent with pyproject.toml, exit code 0) there should be a message, too.

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/cli Related to the command line area/ux Features and improvements related to the user experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants