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

Check in CI that poetry lockfile is up to date #131

Open
gjoseph92 opened this issue Feb 2, 2022 · 4 comments
Open

Check in CI that poetry lockfile is up to date #131

gjoseph92 opened this issue Feb 2, 2022 · 4 comments
Labels

Comments

@gjoseph92
Copy link
Owner

It's easy to forget to poetry lock after you make a change to pyproject.toml. But if you don't, CI will run with the wrong versions installed. Worst case, a bad change to pyproject.toml won't even be noticed until the PR is already merged and someone runs poetry lock in the future.

Add a CI step (or ideally pre-commit, if it's fast enough) to validate that the lockfile is up to date.

Ideally we'd use python-poetry/poetry#1954, but who knows when it'll be released. So other workarounds may be necessary.

@gjoseph92 gjoseph92 mentioned this issue Feb 2, 2022
@gjoseph92 gjoseph92 added the ci label Feb 2, 2022
@stonelazy
Copy link

@gjoseph92 I'm having a similar requirement, have you found any workaround to handling this ? Am in poetry 1.1.13 and still the option isn't available.

@freelanceadm
Copy link

The same question from my side. I am on poetry 1.1.13 and it is a pain for team of 5 developers multiplied to 9 microservices to keep in sync pyproject.toml and poetry.lock.

I see that PR was merged for "poetry lock --check" but there is no such command in 1.1.13.

@stonelazy
Copy link

Exactly my confusion too, the PR is merged but still i get an error no such command

@gjoseph92
Copy link
Owner Author

Exactly my confusion too, the PR is merged but still i get an error no such command

Poetry doesn't release directly off the tip of the master branch. Until they decide to release at least 1.2.0, this won't be released AFAIU python-poetry/poetry#1954 (comment).

have you found any workaround to handling this?

I did once a while ago, but that was on a private repo I no longer have access to, and I forget how I did it. Probably some variant of just running poetry lock and seeing if the lockfile changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants