Repository navigation
[http-client-python] Fix playground generation with bundled dependency wheels - #12484
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
You can try these changes here
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
3 open issues
What changed in this PR
Fixes TypeSpec playground Python SDK generation by bundling browser-compatible dependency wheels and avoiding runtime PyPI/package-index resolution failures.
Changes:
- Add a dedicated
build:playgroundpath that resolves and publishes pure-Python wheels + a manifest at build time. - Harden/standardize package-manager detection and venv bootstrapping with pinned/minimum pip/uv versions.
- Add unit + emitter tests and documentation describing the new browser wheel/manifest flow.
| File | Description |
|---|---|
| packages/http-client-python/tests/unit/test_package_manager.py | Adds unit coverage for package-manager version floors and pip bootstrapping behavior. |
| packages/http-client-python/tests/unit/test_browser_wheels.py | Adds unit coverage for building/publishing the browser wheel manifest and pure wheels. |
| packages/http-client-python/package.json | Adds build:playground script and includes browser wheel assets + manifest in published files. |
| packages/http-client-python/eng/scripts/setup/package_manager.py | Enforces minimum versions, pins pip, and changes venv bootstrapping/install command behavior. |
| packages/http-client-python/eng/scripts/setup/build_pygen_wheel.py | Implements build-time browser wheel resolution + manifest generation; adds --playground CLI flag. |
| packages/http-client-python/eng/scripts/setup/build.ts | Forwards CLI args to the Python wheel builder (enables --playground). |
| packages/http-client-python/eng/pipeline/publish.yml | Wires playground publication to use build:playground. |
| packages/http-client-python/emitter/test/browser-pyodide.test.ts | Adds emitter test ensuring browser installs bundled wheels without index queries + manifest error cases. |
| packages/http-client-python/emitter/src/emitter.ts | Loads manifest + bundled wheels in browser; installs with deps: false and loads native deps via Pyodide. |
| packages/http-client-python/emitter/src/constants.ts | Uses package.json as the single Pyodide-version source. |
| packages/http-client-python/ARCHITECTURE.md | Documents the new browser runtime behavior and build-time resolution constraints. |
| .chronus/changes/python-playground-browser-wheels.md | Adds changelog entry for the playground/browser-wheels fix and package-manager floors. |
Review effort: Lite
|
All changed packages have been documented.
Show changes
|
commit: |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Python emitter diffBaseline No changes to generated output. Rendered diff: inline on the run summary, or the emitter-diff-html artifact. Informational check (eng/emitter-diff); does not block the PR. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove unrelated installer hardening and CI provisioning changes, and retain the existing Pyodide and PyYAML versions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pass native wheel URLs and the compatibility pin directly to pip instead of generating constraints and find-links arguments. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Provision pinned pip through the selected package manager only for playground builds and cover uv bootstrap ordering. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>


Fix Python playground
Failed to fetcherrors by publishing dependencies with the emitter instead of resolving them from PyPI in the browser.** When running the script for the playground we pull the dependencies down from the CFS feed and bundle them. Non-playground uses of the emitter should not be impacted. We pull all dependencies of the emitter with the exception of pyYAML and MarkupSafe which are vendored by pyodide already