Skip to content

feat: build wheels from sdist with --sdist flag#3014

Merged
messense merged 1 commit intoPyO3:mainfrom
messense:build-wheels-from-sdist
Feb 18, 2026
Merged

feat: build wheels from sdist with --sdist flag#3014
messense merged 1 commit intoPyO3:mainfrom
messense:build-wheels-from-sdist

Conversation

@messense
Copy link
Member

Change maturin build --sdist to build the source distribution first, unpack it into a temporary directory, then build wheels from the unpacked sdist. This verifies that the produced sdist is complete and usable.

The same sdist-first workflow is also applied to maturin publish when --no-sdist is not specified.

Closes #2564

Change `maturin build --sdist` to build the source distribution first,
unpack it into a temporary directory, then build wheels from the unpacked
sdist. This verifies that the produced sdist is complete and usable.

The same sdist-first workflow is also applied to `maturin publish` when
`--no-sdist` is not specified.

Closes PyO3#2564
@messense messense force-pushed the build-wheels-from-sdist branch from f19caff to 9f3a730 Compare February 17, 2026 14:56
@konstin
Copy link
Member

konstin commented Feb 17, 2026

I both really want this and wonder how much we reimplement uv build this way (which does that by default), but I'm not sure if there's even a way to expose the same options as we now have in maturin from uv build in a way that's user friendly.

@messense
Copy link
Member Author

Yeah I was also hesitate to implement this in maturin, but the actual code changes are small and provides real benefits, so don't hurt to have it.

@messense messense merged commit a782e86 into PyO3:main Feb 18, 2026
81 of 84 checks passed
@messense messense deleted the build-wheels-from-sdist branch February 18, 2026 09:44
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.

Please support building wheels via source distribution in maturin build workflow

2 participants

Comments