Skip to content

[python] fix install_packages.py: use 'uv build --wheel' instead of non-existent 'uv pip wheel'#10636

Closed
msyyc wants to merge 8 commits into
mainfrom
python/fix-install-packages-uv-wheel
Closed

[python] fix install_packages.py: use 'uv build --wheel' instead of non-existent 'uv pip wheel'#10636
msyyc wants to merge 8 commits into
mainfrom
python/fix-install-packages-uv-wheel

Conversation

@msyyc
Copy link
Copy Markdown
Contributor

@msyyc msyyc commented May 9, 2026

Problem

tests/install_packages.py build <flavor> currently runs:

subprocess.run(["uv", "pip", "wheel", "--no-deps", "--wheel-dir", wheel_dir] + batch, check=True)

But uv pip wheel is not a real uv subcommand. The PipCommand enum only contains compile / sync / install / uninstall / freeze / list / show / tree / check (see crates/uv-cli/src/lib.rs). Reproduced locally on uv 0.11.x:

> uv pip wheel --help
error: unrecognized subcommand 'wheel'

The existing fallback only catches FileNotFoundError, so when uv is present (which it always is in CI via mise), the whole job dies with CalledProcessError.

Fix

  • Switch to uv build --wheel --no-build-logs --out-dir <dir> <pkg> (the command that has actually existed since uv 0.4).
  • Build per-package instead of in batches of 50, so a single broken pyproject.toml no longer poisons the whole batch.
  • Catch CalledProcessError per package, log a warning, and accept partial success — packages that failed to wheelize will be installed from source by install_packages() later.
  • Keep the uv->pip wheel fallback for environments where uv is genuinely missing.

This matches the working pattern that Azure/typespec-azure's install_packages.py had before it was overwritten by syncing this file from upstream.

Copilot AI and others added 8 commits April 29, 2026 10:26
…on-existent 'uv pip wheel'

'uv pip wheel' is not a real subcommand of uv (the PipCommand enum only
has compile/sync/install/uninstall/freeze/list/show/tree/check), so
'tests/install_packages.py build <flavor>' fails with:

    error: unrecognized subcommand 'wheel'

whenever uv is on PATH (which it is in CI via mise). The previous
fallback only caught FileNotFoundError, so it never kicked in when uv
was present-but-incompatible.

Replace with 'uv build --wheel --no-build-logs --out-dir <dir> <pkg>'
(the same approach Azure/typespec-azure used before the recent sync),
build packages one at a time so a single broken pyproject.toml does
not poison the whole batch, and accept partial success (failed
packages will be installed from source by 'install_packages').

Tested locally: 'venv/Scripts/uv.exe build --wheel --help' resolves
correctly on uv 0.11.x (and the command has existed since uv 0.4).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label May 9, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 9, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@10636

commit: 440102d

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Fix serialization regression where @clientDefaultValue defaults on model properties were no longer included in the request body. Defaults are again materialized in the model's data dictionary at construction time so they are sent on the wire, while the attribute-access fallback for unset fields is preserved.

@msyyc msyyc closed this May 9, 2026
@msyyc msyyc deleted the python/fix-install-packages-uv-wheel branch May 9, 2026 03:45
msyyc added a commit to Azure/typespec-azure that referenced this pull request May 9, 2026
…eing wrapper-owned

Following the recent commits that:
- removed 	ests/tox.ini and generator/ from sync.ts INCLUDES (now
  wrapper-owned, committed)
- removed generator/ from .gitignore (now tracked)
- committed tests/requirements/* and tests/conftest.py as synced snapshots

…the prose comments around the INCLUDES list and the gitignore header
no longer matched what's actually being synced. Refresh them so a new
reader can tell at a glance:
  * which files are upstream-truth (kept aligned via pnpm sync)
  * which files are wrapper-owned (and *why* — including the upstream
    install_packages.py bug tracked in microsoft/typespec#10636)
  * which synced paths are gitignored vs committed snapshots

No behavior change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants