Skip to content

Instantly share code, notes, and snippets.

@SamDudley
Created April 23, 2023 17:24
Show Gist options
  • Select an option

  • Save SamDudley/7ac7959de8141546fe14b13ae01e1585 to your computer and use it in GitHub Desktop.

Select an option

Save SamDudley/7ac7959de8141546fe14b13ae01e1585 to your computer and use it in GitHub Desktop.
Check requirements.txt is up to date with Poetry export.
# `poetry export --without-hashes` output requirements to stdout
# `--without-hashes` is optional
# `git diff --exit-code -- requirements.txt -`
# `--exit-code` exit with 1 if there is a difference
# `requirements.txt -` diff the requirements file with stdin (output from poetry export)
poetry export --without-hashes | git diff --exit-code -- requirements.txt -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment