Skip to content

fix: preserve wheel output dir when building from unpacked sdist#3036

Merged
messense merged 1 commit into
PyO3:mainfrom
messense:fix/sdist-wheel-output-dir
Feb 24, 2026
Merged

fix: preserve wheel output dir when building from unpacked sdist#3036
messense merged 1 commit into
PyO3:mainfrom
messense:fix/sdist-wheel-output-dir

Conversation

@messense

Copy link
Copy Markdown
Member

When using --sdist, wheels were written to the temp directory's target/wheels instead of the original project's output directory because cargo_metadata.target_directory resolved from the unpacked sdist location.

Fix by setting build.out to the sdist's output directory before redirecting the manifest path, so wheels land alongside the sdist.

Fixes #3035

When using `--sdist`, wheels were written to the temp directory's
`target/wheels` instead of the original project's output directory
because `cargo_metadata.target_directory` resolved from the unpacked
sdist location.

Fix by setting `build.out` to the sdist's output directory before
redirecting the manifest path, so wheels land alongside the sdist.

Fixes PyO3#3035
@messense messense enabled auto-merge (squash) February 23, 2026 23:35
@messense messense merged commit 4325479 into PyO3:main Feb 24, 2026
45 checks passed
@messense messense deleted the fix/sdist-wheel-output-dir branch February 24, 2026 00:12
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Mar 31, 2026
https://build.opensuse.org/request/show/1343551
by user mia + anag_factory
- Drop CVE-2026-25727.patch (handled in _service)
- Update to 1.12.6
  * Sync legacy_py.rs with upstream PyPI warehouse legacy.py
    gh#PyO3/maturin#3053
  * Keep cargo build artifact at original path after staging
    gh#PyO3/maturin#3054
- Update to 1.12.5
  * feat: include debug info files (.pdb, .dSYM, .dwp) in wheels
    gh#PyO3/maturin#3024
  * Fix wrong abi3 tag for conditional cargo features enabled pyo3
    abi3 feature
    gh#PyO3/maturin#3029
  * fix: maturin build --sdist wheel name/layout for excluded
    workspace crates
    gh#PyO3/maturin#3031
  * fix: preserve wheel output dir when building from unpacked
    sdist
    gh#PyO3/maturin#3036
  * feat: add python-implementation condition to conditional
    features
    gh#PyO3/maturin#3038
  * Fix non-existent comment tag
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.

Version 1.12.3+ and --sdist does not output a binary wheel in target/wheels

1 participant