Fix publish to testpypi #665
Merged
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.
Description
This PR closes #635
It uses trusted publishing to publish packages to testpypi. This uses the OpenID Connect (OIDC) standard to exchange short-lived identity tokens between a trusted third-party service (Github in this case) and PyPI (TestPyPI in our case) instead of relying on a secret long-lived token that we have to generate and keep in Github secrets.
We should also do the same for publishing to PyPI in a separate PR.
I kept the changes to a minimum and mostly copied the changes from one of my repositories (https://github.com/AnesBenmerzoug/langsfer/blob/main/.github/workflows/main.yml). I haven't tested the changes because if they work a new package would be published on testpypi from this branch, which is something we don't necessarily want.
We should consider switching from bump2version to bump-my-version because it is no longer maintained and the newer package offers nice features such as getting the current version without any parsing or regular expressions.
Changes
Checklist
Wrote Unit tests (if necessary)Updated Documentation (if necessary)Updated ChangelogIf notebooks were added/changed, added boilerplate cells are tagged with"tags": ["hide"]
or"tags": ["hide-input"]