context-fabrica publishes to PyPI through GitHub Actions trusted publishing.
rm -rf dist build src/context_fabrica.egg-info
python -m build
python -m twine check dist/*
python -m pytest
python -m pip install .Optional but recommended:
python -m pip install ".[all]"
python -m venv /tmp/context-fabrica-release-test
. /tmp/context-fabrica-release-test/bin/activate
python -m pip install dist/*.whl
context-fabrica --help
context-fabrica-doctor --help- Update
setup.pyversion. - Add the release section to
CHANGELOG.md. - Commit and push to
main.
- Create a GitHub release tagged like
v1.0.0. - The
publish-pypi.ymlworkflow will build, runtwine check, and publish to PyPI. - Approve the
pypiGitHub environment if required.
Before the first PyPI publish, a repository admin must create the pypi environment in GitHub:
- Go to
Settings -> Environments - Create an environment named
pypi - Optionally require reviewers for manual approval
I attempted to create it automatically, but the current GitHub token does not have repository admin rights.
Configure PyPI trusted publishing for:
- repository:
TaskForest/context-fabrica - workflow:
.github/workflows/publish-pypi.yml - environment:
pypi
Verify the released package:
python -m pip install context-fabrica
context-fabrica --help