Skip to main content

hatch plugin to use pip-compile to manage project dependencies

Project description

hatch-pip-compile

hatch plugin to use pip-compile to manage project dependencies

PyPI PyPI - Python Version GitHub License Ruff pre-commit semantic-release Gitmoji

Installation

pip install hatch-pip-compile

pipx

Personally, I use pipx to install and use hatch. If you do too, you will need to inject the hatch-pip-compile plugin into the hatch environment.

pipx install hatch
pipx inject hatch hatch-pip-compile

Usage

The hatch-pip-compile plugin will automatically run pip-compile whenever your environment needs to be updated. Behind the scenes, this plugin creates a lockfile at .hatch/<ENV_NAME>.lock. Alongside pip-compile, this plugin also uses pip-sync to install the dependencies from the lockfile into your environment.

Configuration

The environment plugin name is pip-compile.

  • pyproject.toml

    [tool.hatch.envs.<ENV_NAME>]
    type = "pip-compile"
    
  • hatch.toml

    [envs.<ENV_NAME>]
    type = "pip-compile"
    

lock-directory

The directory where the lockfiles will be stored. Defaults to .hatch.

  • pyproject.toml

    [tool.hatch.envs.<ENV_NAME>]
    type = "pip-compile"
    lock-directory = "requirements"
    
  • hatch.toml

    [envs.<ENV_NAME>]
    type = "pip-compile"
    lock-directory = "requirements"
    

pip-compile-hashes

Whether or not to use hashes in the lockfile. Defaults to true.

  • pyproject.toml

    [tool.hatch.envs.<ENV_NAME>]
    type = "pip-compile"
    pip-compile-hashes = true
    
  • hatch.toml

    [envs.<ENV_NAME>]
    type = "pip-compile"
    pip-compile-hashes = true
    

pip-compile-args

Extra arguments to pass to pip-compile. Defaults to None.

  • pyproject.toml

    [tool.hatch.envs.<ENV_NAME>]
    type = "pip-compile"
    pip-compile-args = [
        "--index-url",
        "https://pypi.org/simple",
    ]
    
  • hatch.toml

    [envs.<ENV_NAME>]
    type = "pip-compile"
    pip-compile-args = [
        "--index-url",
        "https://pypi.org/simple",
    ]
    


Check Out the Docs

Looking to contribute? See the Contributing Guide

See the Changelog




logo

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

hatch_pip_compile-0.1.2.tar.gz (105.2 kB view hashes)

Uploaded Source

Built Distribution

hatch_pip_compile-0.1.2-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

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