You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| `PYPI_TRUSTED_PUBLISHER` | Optional | Set to any value to use PyPI [Trusted Publisher](https://docs.pypi.org/trusted-publishers/) authentication (OIDC). Requires a supported ambient identity (i.e. CI/CD environment). |
224
+
| `PYPI_DISABLE_ATTESTATIONS` | Optional | Set to any value to disable [PyPI attestations](https://docs.pypi.org/attestations/producing-attestations/) (enabled by default with Trusted Publishers). |
225
+
226
+
### Trusted Publishers and Attestations
227
+
228
+
PyPI [Trusted Publishers](https://docs.pypi.org/trusted-publishers/) allows publishing without API tokens by using OpenID Connect (OIDC) authentication between a trusted third-party service and PyPI.
229
+
Typically these are CI/CD providers like GitHub Actions or Gitlab CI/CD.
230
+
PyPI attestations provide cryptographic proof of package provenance and integrity and are **enabled by default when using Trusted Publishers**. Attestations are only available when using Trusted Publisher authentication.
231
+
232
+
**Trusted Publisher Setup:**
233
+
234
+
1. Configure your PyPI project to use a [Trusted Publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/)
235
+
2. Set `PYPI_TRUSTED_PUBLISHER=1` in your workflow environment
236
+
3. No `TWINE_USERNAME` or `TWINE_PASSWORD` needed
237
+
238
+
**Requirements:**
239
+
240
+
* **GitHub Actions**: Your workflow must have `id-token: write` permission.
241
+
* **Gitlab CI/CD**: The keyword `id_tokens` is used to request an OIDC token from GitLab with name `PYPI_ID_TOKEN` and audience `pypi`.
0 commit comments