Skip to content

Fix documented Python package build command - #4384

Merged
carljm merged 1 commit into
mainfrom
cjm/ty-4361-build-docs
Aug 25, 2026
Merged

carljm merged 1 commit into
mainfrom
cjm/ty-4361-build-docs

Conversation

@carljm

@carljm carljm commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Use uv build --build to override the repository's no-build = true setting when contributors build the Python package.

Fixes #4361.

Test plan

Documentation-only change; no new tests. Verified that this works to build ty.

@zanieb

zanieb commented Aug 25, 2026

Copy link
Copy Markdown
Member

You can also allow-list ty via no-binary-package = ["ty"]

@zanieb

zanieb commented Aug 25, 2026

Copy link
Copy Markdown
Member

(which is probably a fine solution here)

@zanieb

zanieb commented Aug 25, 2026

Copy link
Copy Markdown
Member

We should also allow first-party builds in uv build even with no-build. I guess I'll fix that too.

@zanieb

zanieb commented Aug 25, 2026

Copy link
Copy Markdown
Member

This looks vaguely intentional in the code so we'll need to discuss the change.

@carljm

carljm commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@zanieb it seems like no-binary-package = ["ty"] does not fix the issue; it still produces "Building source distributions is disabled" on uv build. Codex says:

uv’s [build frontend](https://github.com/astral-sh/uv/blob/0.12.5/crates/uv/src/commands/build_frontend.rs#L760) passes no package identity, so the exception cannot match.

So I'll go ahead with this docs change for now.

@carljm
carljm merged commit 73d226e into main Aug 25, 2026
17 checks passed
@carljm
carljm deleted the cjm/ty-4361-build-docs branch August 25, 2026 01:05
zanieb pushed a commit to astral-sh/uv that referenced this pull request Aug 25, 2026
With `no-build = true` configured, uv rejects explicit `uv build`
targets and first-party packages installed non-editably by `uv sync`,
including projects in the workspace. Build restrictions should apply to
third-party dependencies instead.

Here we allow explicit builds and carry workspace-member identity
through locked directory distributions so first-party packages can be
prepared and built. Dependency resolution and installation continue to
honor global and package-specific build restrictions, including for path
dependencies outside the workspace.

Follow-up to astral-sh/ty#4384.

---------

Co-authored-by: zaniebot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building source distributions is disabled error when building local Python package

2 participants