Skip to content

[Feature Request] Modernize packaging: add support for uv + PEP518 + PEP621 #1966

@ojeda-e

Description

@ojeda-e

Is your feature request related to a problem? Please describe.
Installing dependencies currently relies exclusively on pip, which can be relatively slow and sometimes inconsistent across environments. One of the key dependencies is torch and torchvision, which are large packages that can take significant time to install with pip. This is not a problem per se, but installation and dependency management can be optimized, and in the process the project can modernize to comply with some PEP.

Describe the solution you'd like
I’d like to have a pyproject that supports environments managed with uv, since it offers faster and more reliable dependency installation than pip for both users and developers. As part of this, the project would adopt a pyproject.toml that complies with:
PEP 518 (specifying build system requirements)
PEP 621 (declaring project metadata)
This change would modernize the repository’s packaging infrastructure and improve the developer and user experience with uv.

Describe alternatives you've considered
A first step would be to comply with PEP 621 by specifying metadata in the pyproject.toml. Then include a uv.lock file for reproducible installations. The repository could continue supporting the existing setup.py for backwards compatibility, while offering uv as an optional or preferred path. It will offer flexibility to the user to choose between pip and uv as a dependency manager.

Additional context
I acknowledge that currently the repository uses setup.py and env vars that determine the versions of some dependencies (VALID_BUILD_TYPES = {"release", "nightly", "dev"} and BUILD_TYPE = os.environ.get("BUILD_TYPE", "dev"). Because of that, some changes may be needed in the CI/CD workflows or build infrastructure. One possible solution is to keep setup.py for legacy compatibility, but introduce pyproject.toml + uv support so users/devs can choose between the traditional method or the newer uv workflow.

I also recognize that there are probably reasons why this hasn’t been done before (for example backwards compatibility, build toolchain constraints, or CI integration), which I don’t personally know and the maintainers will know better than anyone else. But in any case I’m happy to help with this issue and collaborate with maintainers to make the repo compatible with uv and the PEP standards mentioned above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions