This document describes the process for building, testing, and publishing RepoDoctor to PyPI.
uvpackage manager installed- PyPI account with API token
- Write access to the repository
RepoDoctor follows Semantic Versioning:
- MAJOR version: Incompatible API changes
- MINOR version: New functionality (backward-compatible)
- PATCH version: Bug fixes (backward-compatible)
Update the version in the following files:
pyproject.toml-[project] version = "x.y.z"src/repodoc/__init__.py-__version__ = "x.y.z"CHANGELOG.md- Add new version entry
Before publishing a new release:
- All tests pass:
uv run pytest - No linting errors:
uv run ruff check - Code is formatted:
uv run ruff format --check - No type errors:
uv run ty check - Version bumped in all files
- CHANGELOG.md updated with changes
- README.md is up-to-date
- Git working directory is clean
# Remove old distribution files
rm -rf dist/# Build both wheel and source distribution
uv buildThis creates:
dist/repodoc-{version}-py3-none-any.whl- Wheel packagedist/repodoc-{version}.tar.gz- Source distribution
# List contents of the wheel
python -m zipfile -l dist/repodoc-{version}-py3-none-any.whl
# Check package metadata
uv pip show repodoc# Install from wheel
uv pip install dist/repodoc-{version}-py3-none-any.whl
# Verify CLI works
repodoc --version
repodoc --help
# Run a test command
repodoc diet --help
# Uninstall after testing
uv pip uninstall repodoc- Configure Test PyPI credentials:
# Create/edit ~/.pypirc
[testpypi]
username = __token__
password = pypi-YOUR-TEST-PYPI-TOKEN- Upload to Test PyPI:
uv publish --repository testpypi dist/*- Test installation from Test PyPI:
uv pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ repodoc- Configure PyPI credentials:
# Create/edit ~/.pypirc
[pypi]
username = __token__
password = pypi-YOUR-PYPI-TOKEN- Upload to PyPI:
uv publish dist/*- Verify on PyPI:
- Check https://pypi.org/project/repodoc/
- Verify README renders correctly
- Check that all classifiers are correct
- Test installation:
uv pip install repodoc
repodoc --versionAfter publishing to PyPI:
- Tag the release:
git tag -a v{version} -m "Release version {version}"
git push origin v{version}- Create GitHub Release:
- Go to https://github.com/k1lgor/RepoDoctor/releases/new
- Select the tag you just created
- Title:
v{version} - Description: Copy from CHANGELOG.md
- Attach distribution files from
dist/ - Mark as pre-release if version < 1.0.0
- Update CHANGELOG.md:
## [Unreleased]
## [{version}] - {date}
### Added
- Feature 1
- Feature 2
### Changed
- Change 1
### Fixed
- Bug fix 1If you need to yank a release from PyPI:
# Yank a specific version (keeps it available but marks it as yanked)
uv publish --yank {version}Note: You cannot delete a version from PyPI, only yank it.
Consider setting up GitHub Actions for:
- Automated testing on PRs
- Automated building on tags
- Automated publishing to PyPI on release
- Check that all source files are included
- Verify
pyproject.tomlis valid - Run
uv build --verbosefor detailed output
- Verify PyPI token is correct and has upload permissions
- Check that version doesn't already exist on PyPI
- Ensure package name is available (first-time publish)
- Check Python version compatibility (>=3.11)
- Verify all dependencies are available on PyPI
- Check for platform-specific issues
For issues with publishing:
- PyPI help: https://pypi.org/help/
- GitHub issues: https://github.com/k1lgor/RepoDoctor/issues