Repository navigation
ci: add pypi release workflow - #55
WilliamBergamin wants to merge 12 commits into
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. |
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
left a comment
There was a problem hiding this comment.
Looks good so far, the OIDC setup reads really cleanly.
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Build release distributions |
There was a problem hiding this comment.
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.
# 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>
mwbrooks
left a comment
There was a problem hiding this comment.
✅ Thanks @WilliamBergamin! Trusted publishing with a test.pypi.org dry run means the Discovery SDK can ship without a stored API token.
Summary
This pull request publishes releases from GitHub Actions with PyPI trusted publishing, replacing the script that ran
twine uploadfrom a local machine.pypi-release.ymlmatches python-slack-hooks apart from the repo name: TestPyPI on a manual run, PyPI on a published release, then a Slack announcement.github/maintainers_guide.mdwith the release steps and.github/release.ymlfor generated release notes, and removesscripts/deploy_to_prod_pypi_org.sh.pytype/ignore, collapses the D100-D107 ruff ignores intoD1, and merges a splittypingimportTesting
./scripts/lint.sh,./scripts/run_mypy.sh,pytest(Python 3.7 and 3.15), and./scripts/build_pypi_package.shpass locallyBefore the first release:
slack-discovery-sdkon pypi.org and test.pypi.orgpypi(with required reviewers) andtestpypienvironments, plus theSLACK_RELEASE_ANNOUNCEMENTS_WEBHOOK_URLsecretdry_run: trueand confirm therelease-distartifact, then do a TestPyPI runRequirements
🤖 Generated with Claude Code