This document describes how to build and deploy the interactive-sort package to PyPI.
-
Install build tools:
pip install build twine
-
Make sure you have PyPI account credentials configured:
- Create account at https://pypi.org/account/register/
- Get API token from https://pypi.org/manage/account/token/
- Configure credentials with
keyringor.pypircfile
-
Clean any previous builds:
rm -rf dist/ build/ *.egg-info -
Build the distribution files:
python -m build
This creates:
dist/interactive-sort-X.X.X.tar.gz(source distribution)dist/interactive_sort-X.X.X-py3-none-any.whl(wheel distribution)
-
Install in a test environment:
pip install dist/interactive-sort-*.whl -
Test both commands:
interactive-sort --help is --help
-
Test functionality:
echo -e "cherry\napple\nbanana" | interactive-sort echo -e "cherry\napple\nbanana" | is
-
Upload to Test PyPI:
python -m twine upload --repository testpypi dist/* -
Test installation from Test PyPI:
pip install --index-url https://test.pypi.org/simple/ interactive-sort
-
Upload to production PyPI:
python -m twine upload dist/* -
Verify installation:
pip install interactive-sort
Before deploying:
- Update version in
src/interactive_sort/__init__.py - Update version in
pyproject.toml(should match) - Create a git tag:
git tag v1.0.0 git push origin v1.0.0
The package provides two equivalent commands:
interactive-sort- Full command nameis- Short alias for convenience
Both commands have identical functionality and options.