Skip to content

Fail if poetry.lock has fallen out of sync with pyproject.toml#2

Merged
squahtx merged 1 commit into
mainfrom
squah/check_lockfile_up_to_date
Mar 29, 2022
Merged

Fail if poetry.lock has fallen out of sync with pyproject.toml#2
squahtx merged 1 commit into
mainfrom
squah/check_lockfile_up_to_date

Conversation

@squahtx
Copy link
Copy Markdown
Contributor

@squahtx squahtx commented Mar 28, 2022

Signed-off-by: Sean Quah <seanq@element.io>
@squahtx squahtx requested a review from a team as a code owner March 28, 2022 12:45
Copy link
Copy Markdown

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, LGTM!

Comment thread action.yml
# https://github.com/python-poetry/poetry/issues/1406
run: >-
poetry export --without-hashes | (! grep "The lock file is not up to date") ||
(echo pyproject.toml was updated without running \`poetry lock --no-update\`. && false)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you were feeling particularly fancy, you could make this set an error annotation on poetry.lock: see https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message

(But I don't think we need to be fancy)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh, I didn't know you could do that with GHA. I'll leave the fanciness alone for now.

@squahtx squahtx merged commit 1a7066c into main Mar 29, 2022
@squahtx squahtx deleted the squah/check_lockfile_up_to_date branch March 29, 2022 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants