Skip to content

Provide verifiably reproducible wheels on PyPI #12811

@tabbyrobin

Description

@tabbyrobin

It would be nice if the PyPI-hosted wheels were verifiably bit-for-bit reproducible. I've experimented with the codebase and I've identified a few changes that would be needed to make this happen. If these changes are welcome, I can prepare some pull requests.

Short-term:

  • Either replace (some) calls to uv build with other commands (maybe uv venv + ... + pip wheel), or wait for a fix to Use of random temp paths by uv build adds nondeterminism into build environments astral-sh/uv#13096
  • Deterministically normalize the .whl ZIP metadata (timestamps, permissions etc.)
  • Would also be nice: Change (some) calls to actions/checkout to instead use git commands directly. (This would facilitate verifying the reproducibility, which involves executing the GitHub actions yaml locally using a local GHA-runner, such as Nektos Act.)

Long-term:

  • Move complex build logic out of GHA yaml and into more general tools. The GHA yaml would then be a thin wrapper around that logic. This would facilitate verifying build reproducibility locally, without relying on local GHA-runners like Nektos Act.
  • Add CI tests comparing checksums of builds done twice in a row. This would catch reproducibility regressions.

(Note: For the moment, I have only focused on the Linux wheel builds.)

Somewhat related issue: #12764

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions