Skip to content

fix maturin build --pgo -i <version> with uv install - #3237

Merged
messense merged 4 commits into
PyO3:mainfrom
davidhewitt:uv-pgo
Jun 30, 2026
Merged

fix maturin build --pgo -i <version> with uv install#3237
messense merged 4 commits into
PyO3:mainfrom
davidhewitt:uv-pgo

Conversation

@davidhewitt

Copy link
Copy Markdown
Member

Somewhat related to #3236

When using the --pgo argument to maturin build, if the interpreter is passed as e.g. -i 3.14 and a python 3.14 interpreter is not found on the path by maturin, then uv was being invoked to create a virtual environment with argument --python '' (i.e. empty).

This PR corrects this to forward a compatible version string to uv.

I also added a general integration test for PGO (however it doesn't specifically exercise this path, as passing a version to uv might force a download and it seemed fiddly to handle that in CI), and unit tests for the version strings passed to uv.

@davidhewitt davidhewitt changed the title Uv pgo fix maturin build --pgo -i <version> with uv install Jun 19, 2026
@messense
messense merged commit e54b777 into PyO3:main Jun 30, 2026
45 checks passed
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Aug 26, 2026
Changelog:

* Set `UV_PYTHON` when running `maturin develop` with uv ([#3236](PyO3/maturin#3236))
* Set UID and GID headers in pax ([#3241](PyO3/maturin#3241))
* Replace unguarded panics with explicit errors on fallible input ([#3242](PyO3/maturin#3242))
* Harden PEP 517 build-wheel and fix unreachable OIDC 404 fallback ([#3244](PyO3/maturin#3244))
* Fix abi3t PyModExport entrypoint check ([#3246](PyO3/maturin#3246))
* Fix `maturin build --pgo -i <version>` with `uv` install ([#3237](PyO3/maturin#3237))
* Refactor: apply some mechanical cleanups ([#3250](PyO3/maturin#3250))
* Refactor: BuildOrchestrator pipeline deduplication ([#3251](PyO3/maturin#3251))
* Refactor: improve context and environment hygiene ([#3252](PyO3/maturin#3252))
* Fix(ci): honor ~= and ==X.* in requires-python for generate-ci ([#3249](PyO3/maturin#3249))
* Refactor: type cleanup for options, tags, and wheel metadata ([#3253](PyO3/maturin#3253))
* Refactor: InstallDest, single BridgeModel, and ui output facade ([#3254](PyO3/maturin#3254))
* Don’t specify generate-import-lib for PyO3 0.29 ([#3258](PyO3/maturin#3258))
* Refactor build so that pgo is part of normal pathway ([#3257](PyO3/maturin#3257))
* Fix: verify bindings detection with cargo tree in workspaces ([#3264](PyO3/maturin#3264))
* Fix: harden cargo tree verification of bindings detection ([#3266](PyO3/maturin#3266))
* Feat: support --pgo for maturin develop ([#3270](PyO3/maturin#3270))
* Feat: support `MATURIN_PGO` env var to activate --pgo ([#3271](PyO3/maturin#3271))
* Docs: correct crate feature documentation; remove stale clippy allow
* Fix: deduplicate SBOM includes across full merged list, preserving first-seen order
* Feat: type the bindings input with a single-source-of-truth enum ([#3273](PyO3/maturin#3273))
* Don't force export of the `PyInit_{module_name}` in UniFfi mode ([#3275](PyO3/maturin#3275))
* Switch musllinux images to `musllinux_1_2` as `musllinux_1_1` is EOL ([#3280](PyO3/maturin#3280))
* Fix(generate-stubs): write stubs into the module's package directory ([#3282](PyO3/maturin#3282))
* Fix group not cwd ([#3284](PyO3/maturin#3284))
* Docs: document missing [tool.maturin] config fields ([#3287](PyO3/maturin#3287))
* Update cargo-zigbuild & cargo-xwin to 0.23.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Aug 26, 2026
Changelog:

* Set `UV_PYTHON` when running `maturin develop` with uv ([#3236](PyO3/maturin#3236))
* Set UID and GID headers in pax ([#3241](PyO3/maturin#3241))
* Replace unguarded panics with explicit errors on fallible input ([#3242](PyO3/maturin#3242))
* Harden PEP 517 build-wheel and fix unreachable OIDC 404 fallback ([#3244](PyO3/maturin#3244))
* Fix abi3t PyModExport entrypoint check ([#3246](PyO3/maturin#3246))
* Fix `maturin build --pgo -i <version>` with `uv` install ([#3237](PyO3/maturin#3237))
* Refactor: apply some mechanical cleanups ([#3250](PyO3/maturin#3250))
* Refactor: BuildOrchestrator pipeline deduplication ([#3251](PyO3/maturin#3251))
* Refactor: improve context and environment hygiene ([#3252](PyO3/maturin#3252))
* Fix(ci): honor ~= and ==X.* in requires-python for generate-ci ([#3249](PyO3/maturin#3249))
* Refactor: type cleanup for options, tags, and wheel metadata ([#3253](PyO3/maturin#3253))
* Refactor: InstallDest, single BridgeModel, and ui output facade ([#3254](PyO3/maturin#3254))
* Don’t specify generate-import-lib for PyO3 0.29 ([#3258](PyO3/maturin#3258))
* Refactor build so that pgo is part of normal pathway ([#3257](PyO3/maturin#3257))
* Fix: verify bindings detection with cargo tree in workspaces ([#3264](PyO3/maturin#3264))
* Fix: harden cargo tree verification of bindings detection ([#3266](PyO3/maturin#3266))
* Feat: support --pgo for maturin develop ([#3270](PyO3/maturin#3270))
* Feat: support `MATURIN_PGO` env var to activate --pgo ([#3271](PyO3/maturin#3271))
* Docs: correct crate feature documentation; remove stale clippy allow
* Fix: deduplicate SBOM includes across full merged list, preserving first-seen order
* Feat: type the bindings input with a single-source-of-truth enum ([#3273](PyO3/maturin#3273))
* Don't force export of the `PyInit_{module_name}` in UniFfi mode ([#3275](PyO3/maturin#3275))
* Switch musllinux images to `musllinux_1_2` as `musllinux_1_1` is EOL ([#3280](PyO3/maturin#3280))
* Fix(generate-stubs): write stubs into the module's package directory ([#3282](PyO3/maturin#3282))
* Fix group not cwd ([#3284](PyO3/maturin#3284))
* Docs: document missing [tool.maturin] config fields ([#3287](PyO3/maturin#3287))
* Update cargo-zigbuild & cargo-xwin to 0.23.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Aug 27, 2026
Changelog:

* Set `UV_PYTHON` when running `maturin develop` with uv ([#3236](PyO3/maturin#3236))
* Set UID and GID headers in pax ([#3241](PyO3/maturin#3241))
* Replace unguarded panics with explicit errors on fallible input ([#3242](PyO3/maturin#3242))
* Harden PEP 517 build-wheel and fix unreachable OIDC 404 fallback ([#3244](PyO3/maturin#3244))
* Fix abi3t PyModExport entrypoint check ([#3246](PyO3/maturin#3246))
* Fix `maturin build --pgo -i <version>` with `uv` install ([#3237](PyO3/maturin#3237))
* Refactor: apply some mechanical cleanups ([#3250](PyO3/maturin#3250))
* Refactor: BuildOrchestrator pipeline deduplication ([#3251](PyO3/maturin#3251))
* Refactor: improve context and environment hygiene ([#3252](PyO3/maturin#3252))
* Fix(ci): honor ~= and ==X.* in requires-python for generate-ci ([#3249](PyO3/maturin#3249))
* Refactor: type cleanup for options, tags, and wheel metadata ([#3253](PyO3/maturin#3253))
* Refactor: InstallDest, single BridgeModel, and ui output facade ([#3254](PyO3/maturin#3254))
* Don’t specify generate-import-lib for PyO3 0.29 ([#3258](PyO3/maturin#3258))
* Refactor build so that pgo is part of normal pathway ([#3257](PyO3/maturin#3257))
* Fix: verify bindings detection with cargo tree in workspaces ([#3264](PyO3/maturin#3264))
* Fix: harden cargo tree verification of bindings detection ([#3266](PyO3/maturin#3266))
* Feat: support --pgo for maturin develop ([#3270](PyO3/maturin#3270))
* Feat: support `MATURIN_PGO` env var to activate --pgo ([#3271](PyO3/maturin#3271))
* Docs: correct crate feature documentation; remove stale clippy allow
* Fix: deduplicate SBOM includes across full merged list, preserving first-seen order
* Feat: type the bindings input with a single-source-of-truth enum ([#3273](PyO3/maturin#3273))
* Don't force export of the `PyInit_{module_name}` in UniFfi mode ([#3275](PyO3/maturin#3275))
* Switch musllinux images to `musllinux_1_2` as `musllinux_1_1` is EOL ([#3280](PyO3/maturin#3280))
* Fix(generate-stubs): write stubs into the module's package directory ([#3282](PyO3/maturin#3282))
* Fix group not cwd ([#3284](PyO3/maturin#3284))
* Docs: document missing [tool.maturin] config fields ([#3287](PyO3/maturin#3287))
* Update cargo-zigbuild & cargo-xwin to 0.23.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Aug 27, 2026
Changelog:

* Set `UV_PYTHON` when running `maturin develop` with uv ([#3236](PyO3/maturin#3236))
* Set UID and GID headers in pax ([#3241](PyO3/maturin#3241))
* Replace unguarded panics with explicit errors on fallible input ([#3242](PyO3/maturin#3242))
* Harden PEP 517 build-wheel and fix unreachable OIDC 404 fallback ([#3244](PyO3/maturin#3244))
* Fix abi3t PyModExport entrypoint check ([#3246](PyO3/maturin#3246))
* Fix `maturin build --pgo -i <version>` with `uv` install ([#3237](PyO3/maturin#3237))
* Refactor: apply some mechanical cleanups ([#3250](PyO3/maturin#3250))
* Refactor: BuildOrchestrator pipeline deduplication ([#3251](PyO3/maturin#3251))
* Refactor: improve context and environment hygiene ([#3252](PyO3/maturin#3252))
* Fix(ci): honor ~= and ==X.* in requires-python for generate-ci ([#3249](PyO3/maturin#3249))
* Refactor: type cleanup for options, tags, and wheel metadata ([#3253](PyO3/maturin#3253))
* Refactor: InstallDest, single BridgeModel, and ui output facade ([#3254](PyO3/maturin#3254))
* Don’t specify generate-import-lib for PyO3 0.29 ([#3258](PyO3/maturin#3258))
* Refactor build so that pgo is part of normal pathway ([#3257](PyO3/maturin#3257))
* Fix: verify bindings detection with cargo tree in workspaces ([#3264](PyO3/maturin#3264))
* Fix: harden cargo tree verification of bindings detection ([#3266](PyO3/maturin#3266))
* Feat: support --pgo for maturin develop ([#3270](PyO3/maturin#3270))
* Feat: support `MATURIN_PGO` env var to activate --pgo ([#3271](PyO3/maturin#3271))
* Docs: correct crate feature documentation; remove stale clippy allow
* Fix: deduplicate SBOM includes across full merged list, preserving first-seen order
* Feat: type the bindings input with a single-source-of-truth enum ([#3273](PyO3/maturin#3273))
* Don't force export of the `PyInit_{module_name}` in UniFfi mode ([#3275](PyO3/maturin#3275))
* Switch musllinux images to `musllinux_1_2` as `musllinux_1_1` is EOL ([#3280](PyO3/maturin#3280))
* Fix(generate-stubs): write stubs into the module's package directory ([#3282](PyO3/maturin#3282))
* Fix group not cwd ([#3284](PyO3/maturin#3284))
* Docs: document missing [tool.maturin] config fields ([#3287](PyO3/maturin#3287))
* Update cargo-zigbuild & cargo-xwin to 0.23.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
halstead pushed a commit to openembedded/openembedded-core that referenced this pull request Aug 27, 2026
Changelog:

* Set `UV_PYTHON` when running `maturin develop` with uv ([#3236](PyO3/maturin#3236))
* Set UID and GID headers in pax ([#3241](PyO3/maturin#3241))
* Replace unguarded panics with explicit errors on fallible input ([#3242](PyO3/maturin#3242))
* Harden PEP 517 build-wheel and fix unreachable OIDC 404 fallback ([#3244](PyO3/maturin#3244))
* Fix abi3t PyModExport entrypoint check ([#3246](PyO3/maturin#3246))
* Fix `maturin build --pgo -i <version>` with `uv` install ([#3237](PyO3/maturin#3237))
* Refactor: apply some mechanical cleanups ([#3250](PyO3/maturin#3250))
* Refactor: BuildOrchestrator pipeline deduplication ([#3251](PyO3/maturin#3251))
* Refactor: improve context and environment hygiene ([#3252](PyO3/maturin#3252))
* Fix(ci): honor ~= and ==X.* in requires-python for generate-ci ([#3249](PyO3/maturin#3249))
* Refactor: type cleanup for options, tags, and wheel metadata ([#3253](PyO3/maturin#3253))
* Refactor: InstallDest, single BridgeModel, and ui output facade ([#3254](PyO3/maturin#3254))
* Don’t specify generate-import-lib for PyO3 0.29 ([#3258](PyO3/maturin#3258))
* Refactor build so that pgo is part of normal pathway ([#3257](PyO3/maturin#3257))
* Fix: verify bindings detection with cargo tree in workspaces ([#3264](PyO3/maturin#3264))
* Fix: harden cargo tree verification of bindings detection ([#3266](PyO3/maturin#3266))
* Feat: support --pgo for maturin develop ([#3270](PyO3/maturin#3270))
* Feat: support `MATURIN_PGO` env var to activate --pgo ([#3271](PyO3/maturin#3271))
* Docs: correct crate feature documentation; remove stale clippy allow
* Fix: deduplicate SBOM includes across full merged list, preserving first-seen order
* Feat: type the bindings input with a single-source-of-truth enum ([#3273](PyO3/maturin#3273))
* Don't force export of the `PyInit_{module_name}` in UniFfi mode ([#3275](PyO3/maturin#3275))
* Switch musllinux images to `musllinux_1_2` as `musllinux_1_1` is EOL ([#3280](PyO3/maturin#3280))
* Fix(generate-stubs): write stubs into the module's package directory ([#3282](PyO3/maturin#3282))
* Fix group not cwd ([#3284](PyO3/maturin#3284))
* Docs: document missing [tool.maturin] config fields ([#3287](PyO3/maturin#3287))
* Update cargo-zigbuild & cargo-xwin to 0.23.1

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Sep 8, 2026
https://build.opensuse.org/request/show/1375982
by user mia + anag_factory
- Update to 1.15.0
  * set UV_PYTHON when running maturin develop with uv
    gh#PyO3/maturin#3236
  * Set UID and GID headers in pax
    gh#PyO3/maturin#3241
  * Replace unguarded panics with explicit errors on fallible input
    gh#PyO3/maturin#3242
  * Harden PEP 517 build-wheel and fix unreachable OIDC 404
    fallback
    gh#PyO3/maturin#3244
  * docs: add pdfcrate and quebec to examples
    gh#PyO3/maturin#3245
  * Fix abi3t PyModExport entrypoint check
    gh#PyO3/maturin#3246
  * fix maturin build --pgo -i <version> with uv install
    gh#PyO3/maturin#3237
  * Don’t specify generate-import-lib for PyO3 0.29
    gh#PyO3/maturin#3258
  * refactor build so that pgo is part of normal pathway
    gh#PyO3/maturin#3257
  * fix: verify bindings detection with cargo tree in workspaces
    gh
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.

2 participants