Publishing RequestNest to PyPI¶
A step-by-step runbook. There are two paths: the automated one (recommended — a GitHub Release publishes for you via Trusted Publishing) and a manual one (useful for the very first upload and for rehearsing on TestPyPI).
⚠️ Versions are permanent. You can never re-upload a version number to PyPI, even after deleting it. Bump
versioninpyproject.tomlfor every release.
One-time setup¶
- Confirm the name is free. Visit https://pypi.org/project/requestnest/.
A 404 means it's available. If it's taken, change
nameinpyproject.toml. - Create accounts on pypi.org and test.pypi.org. Enable 2FA (required).
- Set up Trusted Publishing (no tokens needed) on PyPI:
- PyPI → your project (or "Publishing" → "Add a pending publisher" if the
project doesn't exist yet) → add a GitHub publisher:
- Owner:
kenpark2600· Repository:RequestNest - Workflow filename:
publish.yml - Environment:
pypi
- Owner:
- This authorizes the workflow in
.github/workflows/publish.ymlto publish.
Automated release (recommended)¶
- Make sure
mainis green (CI passes) andversionis bumped. - Tag and push:
git tag v0.1.0 git push origin v0.1.0 - On GitHub: Releases → Draft a new release → choose the tag → write notes → Publish release.
- The
Publish to PyPIworkflow builds, checks, and uploads automatically. - Verify:
pip install requestnest(give the index a minute to update).
Manual publish (first time / rehearsal)¶
pip install build twine
# 1. Build distributions into dist/
python -m build # -> dist/requestnest-X.Y.Z.tar.gz + .whl
# 2. Sanity-check metadata
twine check dist/*
# 3. Rehearse on TestPyPI
twine upload --repository testpypi dist/*
pip install -i https://test.pypi.org/simple/ requestnest # confirm it installs
# 4. The real upload
twine upload dist/*
For manual uploads you authenticate with a PyPI API token (Account settings →
API tokens). Use __token__ as the username and the token as the password, or
put it in ~/.pypirc.
Release checklist¶
- [ ]
versionbumped inpyproject.toml(and CHANGELOG updated, if you keep one). - [ ] CI green on
main. - [ ]
python -m buildsucceeds;twine check dist/*passes. - [ ] (First release) name confirmed free + Trusted Publisher configured.
- [ ] Tag pushed and GitHub Release published.
- [ ]
pip install requestnestworks from a clean environment.