Skip to content

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

Open

Description

@gjoseph92

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.

Activity

  1. stonelazy commented on Apr 5, 2022

    @stonelazy

    @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.

  2. freelanceadm commented on Apr 6, 2022

    @freelanceadm

    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.

  3. stonelazy commented on Apr 6, 2022

    @stonelazy

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

  4. gjoseph92 commented on Apr 6, 2022

    @gjoseph92
    OwnerAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions