feat: add PyPI trusted publishing support#115
Merged
Conversation
Add `useTrustedPublishing` field to PyPi publishing config to enable
OIDC-based trusted publishing instead of token-based authentication.
Changes:
- Add `UseTrustedPublishing` field to `PyPi` struct
- Make `Token` field optional when using trusted publishing
- Update `Validate()` to error if both token and trusted publishing are set
- Update `IsPublished()` to recognize trusted publishing as valid config
- Update JSON schema with new field and descriptions
Usage:
```yaml
targets:
python-sdk:
target: python
source: my-source
publish:
pypi:
useTrustedPublishing: true
```
Co-Authored-By: Claude <noreply@anthropic.com>
1725adb to
edd63c2
Compare
TristanSpeakEasy
approved these changes
Feb 4, 2026
danielkov
added a commit
to speakeasy-api/speakeasy
that referenced
this pull request
Feb 4, 2026
## Summary
Adds instructions for configuring PyPI trusted publishing when users run
`speakeasy configure publishing` with a Python target that has
`useTrustedPublishing: true` configured.
## Changes
- Add `PyPITrustedPublishingConfig` struct
- Add `getPyPITrustedPublishingInstructions()` function that generates
user-facing instructions
- Update `configurePublishing()` to detect PyPI trusted publishing
configs and display setup instructions
- Update sdk-gen-config dependency to v1.47.1 (includes
`UseTrustedPublishing` field)
## Instructions Output
When a user has configured trusted publishing, they'll see:
```
• Configure trusted publishing for your PyPI package 'my-package':
◦ Navigate to https://pypi.org/manage/project/my-package/settings/publishing/
◦ Add a new 'trusted publisher' with the following configuration:
- Owner: my-org
- Repository name: my-repo
- Workflow name: sdk_publish.yaml
- Environment name: <Leave Blank>
• Navigate to https://github.com/my-org/my-repo/actions to regenerate and publish
• Your package will be published with attestations. Verify at https://pypi.org/project/my-package/#files
```
## Related PRs
- sdk-gen-config:
speakeasy-api/sdk-gen-config#115 (merged)
- sdk-generation-action:
speakeasy-api/sdk-generation-action#286 (merged)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for PyPI trusted publishing (OIDC) as an alternative to token-based authentication.
Changes
UseTrustedPublishingfield toPyPistructTokenfield optional when using trusted publishingValidate()to error if both token and trusted publishing are setIsPublished()to recognize trusted publishing as valid configUsage
Related
🤖 Generated with Claude Code