Skip to content

Command Line Interface#

It's recommend to use pipx to install the CLI, but you can also install it with pip:

pipx install hatch-pip-compile

hatch-pip-compile#

Upgrade your hatch-pip-compile managed dependencies from the command line.

Usage:

hatch-pip-compile [OPTIONS] [ENVIRONMENT]...

Options:

Name Type Description Default
--version boolean Show the version and exit. False
-U, --upgrade / --no-upgrade boolean Try to upgrade all dependencies to their latest versions False
-P, --upgrade-package text Specify a particular package to upgrade; may be used more than once None
--all boolean Upgrade all environments False
--help boolean Show this message and exit. False

How it works#

The hatch-pip-compile CLI is a wrapper around hatch that simply sets the PIP_COMPILE_UPGRADE / PIP_COMPILE_UPGRADE_PACKAGE environment variables before running a hatch command in a given environment.

These environment variables are used by the hatch-pip-compile plugin to run the pip-compile command with the --upgrade / --upgrade-package flags.

Examples#

Upgrade the default environment#

The below command will upgrade all packages in the default environment.

hatch-pip-compile --upgrade

Upgrade a non-default environment#

The below command will upgrade all packages in the docs environment.

hatch-pip-compile docs --upgrade

Upgrade a specific package#

The below command will upgrade the requests package in the default environment.

hatch-pip-compile --upgrade-package requests

Upgrade all pip-compile environments#

The below command will upgrade all packages in all pip-compile environments.

hatch-pip-compile --upgrade --all