Skip to content

Possibly broken uv lock after upgrading from 0.5.20 to 0.5.21 #10776

@flangr-lucid

Description

@flangr-lucid

Hello,

today I've upgraded uv from 0.5.20 to 0.5.21 (my OS is Ubuntu 24.04) and I've encountered a possible bug. I have a project with dynamic versioning setup in pyproject.toml:

[project]
dynamic = ["version"]
...
[tool.hatch.version]
path = "[path]/__about__.py"
...

I run uv lock which added new line version = "0.2.0" to uv.lock (correctly read from __about__.py):

...
[[package]]
name = [the name of my library]
version = "0.2.0"
...

Next, I run uv lock --locked which I would expect to pass (I've just run uv lock), however, I get:

error: The lockfile at `uv.lock` needs to be updated, but `--locked` was provided. To update the lockfile, run `uv lock`.

So I run uv lock again, but it doesn't change anything anymore and uv lock --locked keeps failing.

Could you please advice me what I'm doing wrong? Or is this a bug? I think uv lock should not include the version in uv.lock anymore since 0.5.21, as it's dynamically set, but it seems it does so anyway?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions