Community adoption of pylock.toml (PEP 751)

pip, PDM, uv can now export pylock.toml files.

It’s exciting to see how quickly the community moved on this.

25 Likes

Oh wow!

I also just realised uv supports installation (in addition to export) of pylock.toml

uv sync pylock.toml or uv pip install -r pylock.toml

1 Like

Does anyone know of a place that’s tracking the progress of adopting both the generation of and installation from PEP 751 lock files across the various packaging tools? (Other than this thread itself, obviously)

If there isn’t one already, I’ll see if I can put a simple page together with the statuses and links to issues/PRs/docs/etc. (somewhat similar to this one for free threading Compatibility Status Tracking - py-free-threading)

1 Like

To anyone interested, I wrote a complete, immutable dataclass-based pylock model, with fairly extensive validation, and toml compatible to/from dict serialization in pip: Add pylock parser and validator by sbidoul · Pull Request #13369 · pypa/pip · GitHub

models/pylock.py only depends on packaging. If there is interest we can consider making it a standalone library or include it in packaging.

8 Likes

This is great! I think including it in packaging would make a lot of sense.

6 Likes

Is there today a website allowing to check currently manualy made lockfiles ?

PDM>=2.25.0 can use pylock as the primary lock format: Release v2.25.0 · pdm-project/pdm · GitHub

11 Likes

Pipenv: has a draft PR.

3 Likes

I post on Mastodon and Bluesky when I come across things, but there isn’t anything more centralized that I’m aware of.

Standard APIs for PEP 751? · Issue #898 · pypa/packaging · GitHub is the issue and @sbidoul has a PR open.

Not that I’m aware of. What would you expect such a site to “check” since “The format is designed to be human-readable and machine-generated”?

As in, whether or not said lock files are compatible with the spec? If so, you can use pylock.toml’s JSON schema; there are plenty of generic JSON schema validators out there, most notably ajv. The schema alone cannot verify everything though (e.g., URIs).

As for the schema’s correctness, I’m not sure. I tried to be as careful as possible when I wrote it, but there might be some minor mistakes.

I’m using pip to generate my pylock.toml now, so no more need of a website to control the result.

Tracking issues/discussions for

1 Like