- Install build tools:
pip install build twine-
Get PyPI API token:
- Create account at https://pypi.org/account/register/
- Go to Account Settings → API tokens
- Create token for "FlashRecord" project
-
Configure credentials:
# Copy template
cp .pypirc.template ~/.pypirc
# Edit with your token
nano ~/.pypirc# Clean previous builds
rm -rf dist/ build/ *.egg-info
# Build distribution packages
python -m buildThis creates:
dist/flashrecord-0.3.4-py3-none-any.whl(wheel)dist/flashrecord-0.3.4.tar.gz(source)
# Upload to test PyPI
python -m twine upload --repository testpypi dist/*
# Test install
pip install -i https://test.pypi.org/simple/ flashrecord# Upload to production PyPI
python -m twine upload dist/*
# Verify
pip install flashrecord- Test installation:
pip install flashrecord
flashrecord --help- Create GitHub release:
gh release create v0.3.4 \
--title "FlashRecord v0.3.4 - Production Quality" \
--notes "See CHANGELOG.md for details" \
dist/*Build fails:
- Ensure pyproject.toml is valid
- Check all dependencies are declared
Upload fails:
- Verify API token in ~/.pypirc
- Check version number is incremented
- Ensure no existing version on PyPI
Import fails after install:
- Check package structure:
flashrecordmodule insrc/flashrecord/ - Verify init.py exports