Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PyPI publishing] feat: automate the process of pypi publication to some extent. #7270

Merged
merged 6 commits into from Mar 13, 2024

Conversation

sayakpaul
Copy link
Member

@sayakpaul sayakpaul commented Mar 11, 2024

What does this PR do?

This PR adds utilities to semi-automate the process of publishing a new release on PyPI and notifying our internal Slack channel about it.

Synopsis

setup.py clearly lays out the steps needed in order for us to prepare a new library and publish it on PyPI. Steps from 1 - 6 need careful inspection and might often require manual intervention. But steps 7 - 9 and making an announcement on Slack about the release don't require it IMO and can be systematically automated.

Design

  1. As mentioned earlier, the PR assumes that we need some level of babysitting till step 6 of the publishing process. So, the workflow, pypi_publish.yaml starts after it. More specifically, it gets triggered after a tag is created and pushed. It then does the following:
  • Checks out the latest release branch.
  • Builds the wheel and distribution.
  • Pushes to the Test PyPI server.
  • Runs a small import test (as prescribed in setup.py).
  • If the above test succeeds, pushes to the main PyPI.
  1. The step that comes after PyPI publishing is publishing the release on our GitHub with the release notes. We then usually (should) notify in an internal Slack channel about the release. This is handled by notify_slack_about_release.yml. This workflow gets triggered after a release is published on our GitHub.

Considerations

  • Both the workflows mentioned above have "workflow_dispatch" included as their additional triggers so that they can be run manually when needed.
  • I have extensively tested this design with a dummy repository: https://github.com/sayakpaul/blossom/. You can find the actions here. The released package on PyPI is here. Dummy Slack channel for testing: #temp-notification-bot-test where.

@LysandreJik @yiyixuxu @DN6 WDYT?

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If others maintainers like this workflow, SGTM!

Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

.github/workflows/pypi_publish.yaml Outdated Show resolved Hide resolved
@sayakpaul sayakpaul requested a review from yiyixuxu March 12, 2024 02:31
Copy link
Collaborator

@yiyixuxu yiyixuxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@sayakpaul
Copy link
Member Author

@DN6 LMK what you think. Would like to test-drive this with the upcoming release 🚗

@sayakpaul sayakpaul merged commit 038ff70 into main Mar 13, 2024
9 checks passed
@sayakpaul sayakpaul deleted the semi-automate-pypi-publishing branch March 13, 2024 10:58
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.

None yet

4 participants