Skip to main content

pre-commit hook to keep requirements.txt updated

Project description

pre-commit-poetry-export

pre-commit hook to keep requirements.txt updated

Why?

Your life is easier and the build is faster if you use requirements.txt file to install dependencies inside a docker image. But, it's not hard to forget to update the requirements file using poetry export and remember only when CI can't build the image.

How it Works

In every commit this hook runs the following steps:

  • If requirements.txt doesn't exist

    • It will be created and hook fails
  • If requirements.txt exists

    • The hook will copy it's content to a file named old.requirements.txt
    • Then it will generate another requirements.txt using poetry export and compare the content of the two files
    • If they match you're good to go, if not the hook fails with 'requirements updated' message

If the hook has updated or created your requirements file, you can now git add requirements.txt and finish your commit.

Found any issues or want to suggest an improvement in the code? Please contribute, open an issue /here

Thanks! :)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pre-commit-poetry-export-0.1.2.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file pre-commit-poetry-export-0.1.2.tar.gz.

File metadata

  • Download URL: pre-commit-poetry-export-0.1.2.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.5 CPython/3.8.5 Linux/5.11.0-7614-generic

File hashes

Hashes for pre-commit-poetry-export-0.1.2.tar.gz
Algorithm Hash digest
SHA256 800d57df5ff96c6dcff1caf6f8f88bb08bd04f5017a125e94ce9e05ea27e60b8
MD5 786b2b8b75b7c6bbb0bf8b32e2e7d66c
BLAKE2b-256 4dbe96592c63df2e55df6940067ed03aa6db3b7c6e43db22b74d731edb7baa78

See more details on using hashes here.

File details

Details for the file pre_commit_poetry_export-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pre_commit_poetry_export-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4bdc5217f492083911fe6afe47a3532b2ab34108ed6cd7e159b603851f7b0357
MD5 2b2bdddee52237e4e313faa1b027efa5
BLAKE2b-256 ae7b73ef076725ada225217a8a5abb41d8ce7c1c1d3c75bf2ce5a87c50275a23

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page