Skip to content

uv lock --no-build fails when no build backend is specified in root package #9776

@konstin

Description

@konstin

uv lock --no-build fails when no build backend is specified. This is a false positive, since we never build the package when locking:

  × Failed to build `dummy @ file:///home/konsti/projects/dummy`
  ╰─▶ Building source distributions is disabled

pyproject.toml

[project]
name = "dummy"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = []

The metadata in this package is static, we should skip the build, and indeed the lock messages (-v) don't show any build from happening. This can be verified by adding a bogus build backend to pyproject.toml, now the locking passes even with --no-build:

[build-system]
requires = ["bogus-does-not-exit"]
build-backend = "bogus-does-not-exit"

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