-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add support for PEP 751 lockfiles #12584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Since this PEP contains packages.index may i propose to add functionality for uv add (--script) for the lockfile to solve #11053 |
Yes, exporting to PEP 751 would solve that issue. |
Any insight why this limitation was deemed out of the scope for that PEP? |
Yeah, it was discussed at length but it was ultimately decided that it was adding too much complexity for a first draft / version of the spec. uv is also the only tool that supports this IIUC which made it hard to motivate standardizing around it right now. |
Is there an effort to work on a version 2 that would add support for it?😅 Do you have some plans on how to select when both lock files are present or what would UV lock generate by default? In the long term obviously, as this ticket says that we'll only support it via export. |
There isn't yet, but there should be eventually. It was made fairly clear in the DPO discussion that if there is a Version 2 with support for these kinds of features, the expectation is that the PEP would need to be authored and driven by tooling authors (uv, Poetry, PDM, etc.). |
Please support |
We use |
Yeah I think so. I expect |
The initial |
|
Uh oh!
There was an error while loading. Please reload this page.
PEP 751 is officially accepted.
Today, the PEP 751-style
pylock.toml
files are not sufficient to replaceuv.lock
. The biggest limitation is that there's no support for arbitrary entrypoints to the graph, becausepylock.toml
includes a fixed marker for each package entry rather than recording a graph of dependencies. Specifically, this meansuv 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-stylepylock.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 modernrequirements.txt
. Apylock.toml
file captures a set of packages to install, along with the source of those packages. Unlikerequirements.txt
, the format is fully standardized, and it can also model certain pieces of information thatrequirements.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 inuv export
, and as an installable format inuv pip install
. Likeuv pip install --group
, we may want to see how pip chooses to support these files before implementinguv pip install
support. This requires:uv.lock
topylock.toml
inuv export
.pylock.toml
as a dependency source foruv pip install
, or maybe justuv pip sync
?extras
anddependency-groups
markers.The text was updated successfully, but these errors were encountered: