Skip to content

Use uv locked πŸ”’ environments with Hatch 🐣!

License

Notifications You must be signed in to change notification settings

djcopley/hatch-uvenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

hatch-uvenv

This provides a plugin for Hatch that creates environments using UV's locked virtual environment capabilities for fast, reproducible Python dependency management.

Hatch project Lint PyPI version PyPI Supported Python Versions Downloads

Table of Contents

Installation

  • pyproject.toml

    [tool.hatch.env]
    require = ["hatch-uvenv"]
  • hatch.toml

    [env]
    require = ["hatch-uvenv"]

Configuration

The environment plugin name is uvenv.

  • pyproject.toml

    [tool.hatch.envs.<env_name>]
    type = "uvenv"
  • hatch.toml

    [envs.<env_name>]
    type = "uvenv"

Dependencies

UV's locked environments ensure that dependencies are installed in a fast and deterministic manner. The environment will resolve dependencies based on a lockfile, ensuring reproducibility.

Example config:

[envs.<ENV_NAME>]
uv-flags = [
  "--all-packages",
]
groups = [
  "dependency-group-1",
  "dependency-group-2",
]
features = [
  "feature-1",
  "feature-2",
]