Skip to content

Latest commit

 

History

History
87 lines (65 loc) · 1.58 KB

File metadata and controls

87 lines (65 loc) · 1.58 KB

PyPI Deployment Guide

Prerequisites

  1. Install build tools:
pip install build twine
  1. Get PyPI API token:

  2. Configure credentials:

# Copy template
cp .pypirc.template ~/.pypirc

# Edit with your token
nano ~/.pypirc

Build Package

# Clean previous builds
rm -rf dist/ build/ *.egg-info

# Build distribution packages
python -m build

This creates:

  • dist/flashrecord-0.3.4-py3-none-any.whl (wheel)
  • dist/flashrecord-0.3.4.tar.gz (source)

Test on TestPyPI (Optional)

# Upload to test PyPI
python -m twine upload --repository testpypi dist/*

# Test install
pip install -i https://test.pypi.org/simple/ flashrecord

Deploy to PyPI

# Upload to production PyPI
python -m twine upload dist/*

# Verify
pip install flashrecord

Post-Deployment

  1. Test installation:
pip install flashrecord
flashrecord --help
  1. Create GitHub release:
gh release create v0.3.4 \
    --title "FlashRecord v0.3.4 - Production Quality" \
    --notes "See CHANGELOG.md for details" \
    dist/*

Troubleshooting

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: flashrecord module in src/flashrecord/
  • Verify init.py exports