Skip to content

feat: add PyPI trusted publishing support#115

Merged
danielkov merged 1 commit intomainfrom
feat/pypi-trusted-publishing
Feb 4, 2026
Merged

feat: add PyPI trusted publishing support#115
danielkov merged 1 commit intomainfrom
feat/pypi-trusted-publishing

Conversation

@danielkov
Copy link
Copy Markdown
Contributor

Summary

Adds support for PyPI trusted publishing (OIDC) as an alternative to 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

targets:
  python-sdk:
    target: python
    source: my-source
    publish:
      pypi:
        useTrustedPublishing: true

Related

🤖 Generated with Claude Code

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>
@danielkov danielkov force-pushed the feat/pypi-trusted-publishing branch from 1725adb to edd63c2 Compare February 4, 2026 11:20
@danielkov danielkov merged commit f8a62f6 into main Feb 4, 2026
1 check passed
@danielkov danielkov deleted the feat/pypi-trusted-publishing branch February 4, 2026 11:23
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants