Skip to content

d-ryzhykau/pipenv-lock-pre-commit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pipenv lock pre-commit hooks

Freeze Pipenv dependency versions with pre-commit hooks.

Installation

Install Pipenv and pre-commit:

pip install pipenv pre-commit

Add a pre-commit configuration:

-   repo: https://github.com/d-ryzhykau/pipenv-lock-pre-commit
    rev: 0.5.0
    hooks:
    - id: pipenv-lock              # generate a Pipfile.lock
    - id: pipenv-verify            # verify the hash in Pipfile.lock
    - id: pipenv-requirements      # generate a requirements.txt
    - id: pipenv-requirements-dev  # generate a requirements-dev.txt

To pass additional parameters to Pipenv commands, overwrite args property of the hook. Note: overwriting args property removes default arguments passed to the hook script.

-   repo: https://github.com/d-ryzhykau/pipenv-lock-pre-commit
    rev: 0.5.0
    hooks:
    - id: pipenv-requirements-dev
      # pass new --hash param and preserve default --requirements-file option
      args: [--hash, --requirements-file=requirements-dev.txt]

About

Hooks for pre-commit that freeze dependency versions.

Resources

License

Stars

Watchers

Forks

Languages