pypa/hatch

Make `uv` optional

开放

#2,141 创建于 2025年12月10日

 (2 条评论) (1 个反应) (0 位负责人)Python (240 个派生)batch import
enhancementgood first issue

仓库指标

星标
 (4,451 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description

According to the documentation uv is optional:

The virtual environment type by default uses virtualenv for virtual environment creation and pip to install dependencies. You can speed up environment creation and dependency resolution by using UV instead of both of those tools.

But hatch lists it as a required dependency: https://github.com/pypa/hatch/blob/962260eedbaf0d77996ec50807482a878000cbe1/pyproject.toml#L56

It'd be great to have an option not to install uv with hatch.

Use case/motivation

uv is a large binary, consisting of 18MB of wheels and 45MB of binary files. It accounts for 64% of the total size of downloaded wheels during hatch installation and 40% of the size of virtual environments after installation. In many cases, installing uv at all with hatch is unnecessary because:

  1. uv may already be installed: Many developers likely have uv installed, and there's no reason to install it twice. Even hatch's CI installs uv twice (https://github.com/pypa/hatch/actions/runs/20072023789/job/57576505774).

  2. Environments are disposable: In environments like CI or containers, hatch is used for a single action, after which the environment is deleted. In such cases, installing uv may consume more resources than the performance benefits it provides.

Additionally, it creates a peculiar situation when a project management tool relies on a third-party project management tool.

Therefore, if we make uv optional, we'll gain more flexibility and be able to save some resources.

Related issues

No response

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

贡献者指南