Skip to content

Make uv optional #2141

@subnix

Description

@subnix

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:

"uv>=0.5.23",

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions