-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
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
topylock.toml
inuv export
. - Supporting
pylock.toml
as a dependency source foruv pip install
, or maybe justuv pip sync
? - Extending our PEP 508 implementation to understand the new
extras
anddependency-groups
markers.