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

Run pipenv verify before sync #2409

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

michaelkedar
Copy link
Member

Pipenv doesn't automatically check if the Pipfile matches the Pipfile.lock when running pipenv sync. Added pipenv verify commands in all the places to do the manifest/lockfile verification. This should prevent things like #2379 from passing our tests.

Poetry seems to automatically do this validation when you run poetry install (But there is a poetry check command as well?)

Copy link
Contributor

@andrewpollock andrewpollock left a comment

Choose a reason for hiding this comment

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

LGTM with uncertainty

@@ -40,7 +40,7 @@ jobs:
- name: Install pipenv
run: pip install pipenv==2023.12.1
- name: Set up pipenv
run: pipenv sync --dev
run: pipenv verify && pipenv sync --dev
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unsure if the && here will result in pipenv sync silently not being run if the verify fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not 100% sure, but I assumed if pipenv verify fails here the whole workflow will fail, similar to the Makefile.

@@ -16,7 +16,7 @@ ifeq "$(USE_POETRY)" "true"
install-cmd := poetry install
run-cmd := poetry run
else
install-cmd := pipenv sync
install-cmd := pipenv verify && pipenv sync
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unsure if the && here will result in pipenv sync silently not being run if the verify fails?

Copy link
Member Author

Choose a reason for hiding this comment

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

The make command prints and errors if the verify fails:

...
Pipfile.lock is out-of-date. Run $ pipenv lock to update.
make: *** [Makefile:64: run-api-server] Error 1

Which seems reasonable to me

@michaelkedar michaelkedar merged commit dbcd0a7 into google:master Jul 24, 2024
11 checks passed
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.

None yet

2 participants