Skip to content

Add support for PEP 751 lockfiles #12584

@charliermarsh

Description

@charliermarsh

PEP 751 is officially accepted.

Today, the PEP 751-style pylock.toml files are not sufficient to replace uv.lock. The biggest limitation is that there's no support for arbitrary entrypoints to the graph, because pylock.toml includes a fixed marker for each package entry rather than recording a graph of dependencies. Specifically, this means uv run -p could not be supported (i.e., we couldn't support installing a specific subset of the graph) within the standard.

Notably, though, unlike requirements.txt, pylock.toml also supports extras and dependency groups by extending the PEP 508 marker syntax. So markers can now express things like "this extra was enabled" or "this dependency group was enabled". As such, we could potentially use PEP 751-style pylock.toml files for single-member workspaces. I don't think this is worth the complexity right now, but it is possible.

So for now, from uv's perspective, we can think of PEP 751-style pylock.toml files as a more modern requirements.txt. A pylock.toml file captures a set of packages to install, along with the source of those packages. Unlike requirements.txt, the format is fully standardized, and it can also model certain pieces of information that requirements.txt cannot (e.g., you can specify a package as coming from a specific registry).

As a first step, we want to support PEP 751-style pylock.toml files as an export format in uv export, and as an installable format in uv pip install. Like uv pip install --group, we may want to see how pip chooses to support these files before implementing uv pip install support. This requires:

  • Adding code to translate uv.lock to pylock.toml in uv export.
  • Supporting pylock.toml as a dependency source for uv pip install, or maybe just uv pip sync?
  • Extending our PEP 508 implementation to understand the new extras and dependency-groups markers.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement to existing functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy