Skip to content

馃悰 fix(zipapp): restore one cross-platform pipx.pyz - #1990

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:zipapp
Jul 29, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:zipapp

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

A release publishes one pipx.pyz for every platform and Python version, but shiv delegates dependency resolution to pip, and pip evaluates the environment markers in dependencies on the machine that builds the artifact. The release runner (Linux, Python 3.14) resolves away colorama (sys_platform == 'win32') and tomli (python_version < '3.11'), which breaks the zipapp on Windows (#1978) and on Python 3.10 on every platform (#1984). #1979 addressed the Windows half by shipping a second pipx-windows.pyz, which split the download instructions per platform and left the Python 3.10 crash in place.

This adopts the mechanism from #1985 by @marko1olo: naming colorama>=0.4.4 and tomli in the shiv invocation bundles them no matter where the build runs. 馃摝 Both are small pure-Python wheels and pipx imports them behind platform and version guards, so platforms that need them get a working artifact and the rest carry a few unused kilobytes. One artifact serves everyone again, so this rolls back the #1979 split: one shiv command in tox.toml, one upload in the release workflow, and one download in the docs.

CI now mirrors the release path. The Linux job builds through tox run -e zipapp, keeping the shiv command in a single place, and tests the artifact under Python 3.10. The Windows job stopped building its own zipapp: it downloads the Linux-built pipx.pyz and runs --version plus install black under Python 3.10 on windows-2025, hitting both marker-gated imports in the exact bytes a release ships. 馃獰

pip evaluates environment markers against the interpreter building the
artifact, so colorama (win32-only) and tomli (py<3.11-only) never reached
a pipx.pyz built on the release runner. Requesting both explicitly in the
shiv invocation keeps one artifact valid on every supported platform and
Python version, which lets the separate pipx-windows.pyz from pypa#1979 be
rolled back.

The Windows CI job now downloads the Linux-built pipx.pyz and runs it
under Python 3.10, exercising both markers in the artifact that ships.

Fixes pypa#1978, fixes pypa#1984.
@gaborbernat gaborbernat added the bug Something isn't working label Jul 29, 2026
@gaborbernat
gaborbernat merged commit deab2f3 into pypa:main Jul 29, 2026
17 checks passed
@gaborbernat
gaborbernat deleted the zipapp branch October 3, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant