gcp-attest
Produce Digital Attestations and use PyPI Trusted Publishing using Google Cloud service accounts.
Setup
First, follow the setup guide.
# Build your package; e.g. with `python -m build`
# Sign files
gcp-attest sign dist/*
# Upload to PyPI incl. attestations
TWINE_USERNAME=__token__ \
TWINE_PASSWORD="$(gcp-attest exchange)" \
twine upload --attestations dist/*
Digital attestations
Run gcp-attest sign <FILES...> (alias: attest) in the same way you would run pypi-attestations sign. This will create attestations for all valid Python package files.
usage: gcp-attest attest [-h] [--staging] FILE [FILE ...]
positional arguments:
FILE file(s) to sign
options:
-h, --help show this help message and exit
--staging use the staging environment
PyPI uploading
Run gcp-attest exchange (alias: mint) to exchange a Google OIDC token for a PyPI upload token.
You can use --repository to specify a different repository (e.g. TestPyPI)
usage: gcp-attest exchange [-h] [--repository REPOSITORY]
options:
-h, --help show this help message and exit
--repository, -r REPOSITORY
the repository (package index) to mint the token for
Why
PyPI encourages Trusted Publishing, but their supported platforms do not include Codeberg. This is understandable: Supporting a new platform means trusting it, and for a long time neither of Codeberg's CI options even had an option to issue OIDC tokens.
PyPI trusts Google's OIDC, though. All OIDC tokens issued by Google Cloud IAM can be exchanged against valid PyPI publishing tokens. The same applies to Sigstore and digital attestations.
Google Cloud OIDC tokens usually represent a service account. There are multiple ways to "log in" as said account to issue tokens:
- Inside a Google Cloud workflow. This is the expected way and already supported by di/id and pypi-attestations.
- Using a long-lived credentials key file.
- Using Workload Identity Federation
The last one is interesting, as it allows us to exchange OIDC tokens from any valid identity provider for Google Cloud tokens. This way, Google Cloud acts like a proxy between PyPI and not (yet) supported OIDC providers.
This project aims to simplify publishing process by offering APIs to create attestations and exchange tokens.
Licence
© 2026 Nikita Karamov
Licensed under the ISC License
Metadata
Release files for gcp-attest 0.3.1.post1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gcp_attest-0.3.1.post1.tar.gz | 158.2 kB | With provenance | Details for gcp_attest-0.3.1.post1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gcp_attest-0.3.1.post1-py3-none-any.whl | Python 3 | none | any | Details for gcp_attest-0.3.1.post1-py3-none-any.whl |
Total release size: 166.6 kB
Release files / gcp_attest-0.3.1.post1.tar.gz
| Download URL | gcp_attest-0.3.1.post1.tar.gz |
|---|---|
| Size | 158.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d08a7d4d8286b47195d5d87778f28a0614678380a2d575a910c81b1290d8459
|
|
BLAKE2b-256 checksum How to use checksums |
d2f43213cd8e356c0f46b9d1757365e0c8a68af4bc519fce480a87fff28216be
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Jul 15, 2026.
Transparency logRelease files / gcp_attest-0.3.1.post1-py3-none-any.whl
| Download URL | gcp_attest-0.3.1.post1-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5547ddef5c94c3dbc1bb604ad9a129fa1230845e32653838d91e3219a36c96fb
|
|
BLAKE2b-256 checksum How to use checksums |
0e3c6cc44ec6deeab9d5068f34e8ac0d13fee2505dade2c1325b2bd8002f1d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Jul 15, 2026.
Transparency logSecurity for gcp-attest 0.3.1.post1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for gcp_attest-0.3.1.post1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by Google Cloud, verified by PyPI on Jul 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.