Skip to content

ci: add pypi release workflow - #55

Open
WilliamBergamin wants to merge 12 commits into
mainfrom
release
Open

WilliamBergamin wants to merge 12 commits into
mainfrom
release

Conversation

@WilliamBergamin

@WilliamBergamin WilliamBergamin commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This pull request publishes releases from GitHub Actions with PyPI trusted publishing, replacing the script that ran twine upload from a local machine.

  • pypi-release.yml matches python-slack-hooks apart from the repo name: TestPyPI on a manual run, PyPI on a published release, then a Slack announcement
  • Adds .github/maintainers_guide.md with the release steps and .github/release.yml for generated release notes, and removes scripts/deploy_to_prod_pypi_org.sh
  • Tidies config left over from build: move to pyproject.toml and drop python 3.6 #52-build: add mypy type checking #54: drops unused asyncio warning filters and the .pytype/ ignore, collapses the D100-D107 ruff ignores into D1, and merges a split typing import

Testing

  • ./scripts/lint.sh, ./scripts/run_mypy.sh, pytest (Python 3.7 and 3.15), and ./scripts/build_pypi_package.sh pass locally

Before the first release:

  • Add a trusted publisher for slack-discovery-sdk on pypi.org and test.pypi.org
  • Create the pypi (with required reviewers) and testpypi environments, plus the SLACK_RELEASE_ANNOUNCEMENTS_WEBHOOK_URL secret
  • After merging, run the workflow with dry_run: true and confirm the release-dist artifact, then do a TestPyPI run

Requirements

🤖 Generated with Claude Code

WilliamBergamin and others added 6 commits November 16, 2026 12:47
Replace setup.py, setup.cfg, and pytest.ini with pyproject.toml, matching
python-slack-sdk, bolt-python, and python-slack-hooks. The new floor is
Python 3.7. A Python CI workflow runs the tests on 3.7 to 3.15 and PyPy,
and tests that need live Discovery API tokens now skip without them.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Use the ruff config shared by python-slack-sdk, bolt-python, and
python-slack-hooks, with format.sh and lint.sh scripts and a Lint CI job.
This removes the .flake8 config and the flake8 workflow.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Output of ./scripts/format.sh with no other changes: ruff format plus the
safe ruff check fixes (one import per line, docstring blank lines, an
unused import).

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Split each docstring summary onto its own line with a blank line after it,
end summaries with a period, and document the missing args, so the google
convention checks pass with the same ignores as the other python repos.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Replace pytype with mypy, using the config and scripts shared with
python-slack-sdk, bolt-python, and python-slack-hooks, and a Typecheck CI
job. Fix the errors it found:

- type the HTTP request helpers and drop the unused type: ignore comments
- allow an empty response body in DiscoveryResponse
- remove the root __init__.py, which made the repo look like a package
- fix the examples package, whose import of a parent module failed

Offline tests with a local HTTP server cover the success and error paths of
the request code that changed.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Publish to PyPI with trusted publishing when a GitHub release is published,
and to TestPyPI on a manual run, with the same workflow as python-slack-sdk,
bolt-python, and python-slack-hooks. Add the maintainers guide with the
release steps and the release notes config, and remove the script that
uploaded from a local machine.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov-commenter

codecov-commenter commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.66%. Comparing base (bc9acd0) to head (c4824aa).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
- Coverage   45.75%   45.66%   -0.09%     
==========================================
  Files          17       17              
  Lines         636      635       -1     
==========================================
- Hits          291      290       -1     
  Misses        345      345              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

WilliamBergamin and others added 4 commits November 16, 2026 14:06
The license is now an SPDX expression with LICENSE.md as its license
file. This needs setuptools 77 or newer, which runs on Python 3.9+, so
the package is built on the latest Python. The py3-none-any wheel still
installs on 3.7+.

Because of this, the unit test jobs and install.sh no longer install the
package (that would build it on 3.7/3.8). The tests import it from
source, as in python-slack-sdk.

MANIFEST.in is dropped: setuptools already ships README.md, LICENSE.md,
and py.typed. PyPy is dropped from the classifiers and the test matrix
since it isn't tested.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good so far, the OIDC setup reads really cleanly.

with:
python-version: "3.x"

- name: Build release distributions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

suggestion (non-blocking): The maintainers guide says the tag and version.py must match, but nothing checks it. A step comparing ${GITHUB_REF_NAME#v} to __version__ would stop a mistyped tag from publishing, since PyPI versions can't be reused.

Base automatically changed from mypy to main November 17, 2026 19:58
WilliamBergamin and others added 2 commits November 17, 2026 15:12
# Conflicts:
#	pyproject.toml
#	requirements/dev-tools.txt
#	scripts/install.sh
Drop the asyncio deprecation filters carried over from pytest.ini (the
package has no async code), collapse the D100-D107 ignores into D1, remove
the .pytype/ ignore now that pytype is gone, and merge a split typing import.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@WilliamBergamin
WilliamBergamin marked this pull request as ready for review November 17, 2026 20:34
@WilliamBergamin
WilliamBergamin requested a review from a team as a code owner November 17, 2026 20:34
@WilliamBergamin WilliamBergamin added github_actions Pull requests that update GitHub Actions code build Build, packaging, CI, and release changes and removed github_actions Pull requests that update GitHub Actions code labels Nov 17, 2026

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

✅ Thanks @WilliamBergamin! Trusted publishing with a test.pypi.org dry run means the Discovery SDK can ship without a stored API token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Build, packaging, CI, and release changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants