Skip to content
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

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

Closed
konstin opened this issue Dec 10, 2024 · 0 comments · Fixed by #9785
Closed

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

konstin opened this issue Dec 10, 2024 · 0 comments · Fixed by #9785
Assignees
Labels
bug Something isn't working

Comments

@konstin
Copy link
Member

konstin commented Dec 10, 2024

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"
@konstin konstin added the bug Something isn't working label Dec 10, 2024
@charliermarsh charliermarsh self-assigned this Dec 10, 2024
charliermarsh added a commit that referenced this issue Dec 10, 2024
## Summary

This optimization isn't quite right, because we can successfully extract
metadata without having to build from source. (The builder itself will
error if we reach the point at which we need to build, but builds are
disabled.)

Closes #9776.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants