Releasing¶
PyAccessKit is published to PyPI from GitHub Actions with Trusted
Publishing: PyPI trusts this repository's release.yml workflow directly, so no API token is stored
anywhere. The documentation is deployed to GitHub Pages by docs.yml.
Uploads are permanent
A version number can be uploaded to PyPI only once. It cannot be replaced, even after deleting it. Rehearse on TestPyPI whenever something about packaging changed.
One-time setup¶
- PyPI and TestPyPI accounts. Create them on pypi.org and test.pypi.org. They are separate, and both need two-factor authentication.
-
Pending trusted publishers. This registers the project before its first upload. On each site, go to Your account → Publishing → Add a new pending publisher and enter:
Field Value PyPI project name pyaccesskitOwner ariedotcodotnzRepository name PyAccessKitWorkflow name release.ymlEnvironment name pypi(on TestPyPI:testpypi) -
GitHub environments. In the repository, go to Settings → Environments and create
pypiandtestpypi. Onpypi, add yourself as a required reviewer, so each upload waits for your approval. - GitHub Pages. Go to Settings → Pages → Source: GitHub Actions. The docs deploy on every push to
the default branch (
mainormaster).
Each release¶
- Update the version in
src/pyaccesskit/_version.py, following semantic versioning. Until 1.0, a minor release may break the API; say so in the changelog. - Update
CHANGELOG.md. Move the entries from Unreleased to a new## [X.Y.Z] - YYYY-MM-DDsection, and update the comparison links at the bottom. -
Run the full checks on a Windows machine with Access. CI cannot run the real-Access tests:
uv run ruff check . && uv run ruff format --check . && uv run pyright uv run python scripts/sync_docs.py --check uv run pytest --integration UV_PROJECT_ENVIRONMENT=.venv-x86 uv run --python cpython-3.12-windows-x86 pytest --integration -
Rehearse (optional). Go to Actions → Release → Run workflow → target: testpypi. Then install from TestPyPI in a clean environment:
uv venv /tmp/pak && uv pip install --python /tmp/pak --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pyaccesskit -
Commit, push, and publish a GitHub release with the tag
vX.Y.Z. The tag must match the package version, or the workflow stops. The workflow runs the checks, builds the sdist and wheel, and uploads them to PyPI after you approve thepypienvironment. - Check pypi.org/p/pyaccesskit, then
pip install -U pyaccesskitandpyaccesskit doctor --probeon a machine with Access.
Publishing without GitHub Actions¶
With an API token from PyPI → Account settings → API tokens:
uv build
uvx twine check --strict dist/*
uv publish --publish-url https://test.pypi.org/legacy/ --token pypi-… # rehearsal on TestPyPI
uv publish --token pypi-… # PyPI
Prefer a token scoped to the pyaccesskit project, and keep it out of shell history. Set it in the
UV_PUBLISH_TOKEN environment variable instead of passing --token.