Since it just came up in Lock files don't mesh with dynamic package version info · Issue #7533 · astral-sh/uv · GitHub – it looks like that neither this PEP nor the discussions have no provisions for dynamic package version metadata. I have to admit that I’m not deep enough in the topic to make a cogent argument WRT the PEP, but let me explain why I think it would be a mistake to pass it without:
Isn’t this just for packages? Lockfiles are for applications!
This is correct, but many projects with higher churn and dependencies that tend to break[1] already have full locks of their dependencies to keep their CI stable – usually using pip-tools or Poetry. Updates + fixes happen in a controlled manner on one’s own time. uv’s speed and DX was my hope to embrace it for some of my projects too.
Why dynamic version metadata?
Projects like like setuptools-scm or hatch-vcs are highly popular because they allow to deduplicate the VCS metadata (usually: Git tags) and package metadata to only use one source of truth: the one that drives CI and e.g. GitHub releases, which is a big deal together with PyPI Trusted Publishing. In certain configurations, the version of the package changes with every commit. One of them adds a number of commits since the last tag that also allows you to continuously to upload your package to TestPyPI to ensure your whole packaging pipeline works as expected (as popularized by @hugovk): Client Challenge
But this is just one use-case; it does make sense to have a direct connection from the version number to a certain commit in the repo. But that means that the lock file needs to change after every commit.
What do I want?
I want a way to say that a certain (current!) package’s version is “dynamic” and shouldn’t be part of the lock file. There’s already been plenty of discussion in Lock files don't mesh with dynamic package version info · Issue #7533 · astral-sh/uv · GitHub if you want to dig deeper.
I’m sorry for suggesting another color, but it seems to me like a miss if we pass this without good support for PyPI packages and the workflows employed by high-profile projects. This could be a stepping stone for more stable CIs using only standards and many pieces are already in place (e.g., tox).
E.g., attrs has top-locks on both Mypy and Pyright as I’m writing. ↩︎