The agentcoach package is now ready for publishing to PyPI. Here's what has been set up:
- ✅ Added comprehensive metadata (keywords, classifiers, URLs)
- ✅ Added all Python 3.9-3.12 classifiers
- ✅ Added project URLs (homepage, docs, issues, changelog)
- ✅ Added missing dependency (jsonschema)
- ✅ Configured package data inclusion
- ✅ Includes documentation files
- ✅ Includes schemas and examples
- ✅ Excludes development files
- ✅ Complete step-by-step publishing guide
- ✅ TestPyPI and PyPI instructions
- ✅ Troubleshooting section
- ✅ Best practices
- ✅ Version management guide
- ✅ Interactive GUI for publishing workflow
- ✅ Pre-flight checks (tests, git status, files)
- ✅ Version management with auto-calculation
- ✅ Build package with validation
- ✅ Upload to TestPyPI
- ✅ Upload to PyPI
- ✅ Auto-create git tags
- ✅ Auto-publish on version tags (v*)
- ✅ Manual workflow dispatch for TestPyPI/PyPI
- ✅ Multi-Python version testing (3.9-3.12)
- ✅ Trusted publishing with OIDC
- ✅ Auto-create GitHub releases
- ✅ Automated version bumping
- ✅ Auto-commit and tag
- ✅ Updates pyproject.toml and init.py
# Install streamlit
pip install streamlit toml
# Run the assistant
streamlit run publish_assistant.pyThe assistant will guide you through:
- Pre-flight checks
- Version management
- Building the package
- Testing on TestPyPI
- Publishing to PyPI
# 1. Install tools
pip install build twine bump2version
# 2. Run tests
pytest
# 3. Bump version
bumpversion patch # or minor, or major
# 4. Build
python -m build
# 5. Check
twine check dist/*
# 6. Upload to TestPyPI (test first!)
twine upload --repository testpypi dist/*
# 7. Test installation
pip install --index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple/ \
agentcoach
# 8. Upload to PyPI
twine upload dist/*
# 9. Push tags
git push origin --tags# For TestPyPI
# Go to GitHub Actions → Publish to PyPI → Run workflow → Select testpypi
# For PyPI (via tag)
git tag v0.1.0
git push origin v0.1.0
# Workflow runs automaticallyBefore publishing, ensure:
- All tests pass (
pytest) - No uncommitted changes (
git status) - Version bumped in
pyproject.toml - CHANGELOG.md updated
- README.md is up to date
- All dependencies listed in
pyproject.toml - Package builds successfully (
python -m build) - Package passes checks (
twine check dist/*) - Tested on TestPyPI
- GitHub repository URL updated in
pyproject.toml
- Create account at https://pypi.org
- Enable 2FA
- Create API token at https://pypi.org/manage/account/token/
- Save token securely
- Create account at https://test.pypi.org
- Create API token at https://test.pypi.org/manage/account/token/
- Save token securely
- Go to repository Settings → Secrets and variables → Actions
- Add secrets:
PYPI_API_TOKEN(for PyPI)TEST_PYPI_API_TOKEN(for TestPyPI)
Or use Trusted Publishing (recommended):
- Go to PyPI → Account settings → Publishing
- Add GitHub repository
- No tokens needed!
agentcoach/
├── .github/
│ └── workflows/
│ └── publish.yml # Auto-publish workflow
├── agentcoach/ # Main package
├── schemas/ # JSON schemas (included)
├── examples/ # Examples (included)
├── tests/ # Test suite
├── pyproject.toml # Package metadata
├── MANIFEST.in # Package data config
├── PUBLISHING.md # Publishing guide
├── publish_assistant.py # Streamlit GUI
├── .bumpversion.cfg # Version management
└── README.md # Main documentation
The publish_assistant.py provides:
- ✅ Verify required files exist
- ✅ Check git status
- ✅ Run tests
- ✅ Display results with ✅/❌
- 📊 Show current version
- 🔢 Calculate new version (patch/minor/major)
- ✏️ Manual version override
- 📝 Update pyproject.toml
- 📋 Changelog template
- 🧹 Clean previous builds
- 🔨 Build source + wheel
- ✅ Validate with twine check
- 📦 Show built files
- 🔐 Secure token input
- 📤 Upload to TestPyPI
- 📝 Installation instructions
- 🔗 Link to TestPyPI page
⚠️ Confirmation required- 🔐 Secure token input
- 🚀 Upload to PyPI
- 🎉 Success with balloons!
- 🏷️ Auto-create git tag
- 🔗 Link to PyPI page
# Install
pip install bump2version
# Bump version
bumpversion patch # 0.1.0 → 0.1.1
bumpversion minor # 0.1.0 → 0.2.0
bumpversion major # 0.1.0 → 1.0.0
# This automatically:
# - Updates version in pyproject.toml
# - Updates version in agentcoach/__init__.py
# - Commits the change
# - Creates a git tagEdit pyproject.toml:
version = "0.1.1"And agentcoach/__init__.py:
__version__ = "0.1.1"1. Push a version tag:
git tag v0.1.0
git push origin v0.1.0→ Automatically publishes to PyPI
2. Manual workflow dispatch:
- Go to Actions → Publish to PyPI
- Click "Run workflow"
- Select environment (testpypi or pypi)
- Click "Run workflow"
- Build: Creates source distribution and wheel
- Test: Runs tests on Python 3.9, 3.10, 3.11, 3.12
- Publish: Uploads to TestPyPI or PyPI
- Release: Creates GitHub release (for tags)
- Never commit tokens to git
- Use API tokens, not passwords
- Enable 2FA on PyPI account
- Use project-scoped tokens after first upload
- Rotate tokens periodically
- Use Trusted Publishing (OIDC) when possible
- Store tokens in environment variables or secrets manager
- PyPI
- TestPyPI
- Python Packaging Guide
- Semantic Versioning
- Twine Documentation
- GitHub Actions for PyPI
You cannot re-upload the same version. Bump the version number.
twine check dist/*Check package structure:
unzip -l dist/agentcoach-0.1.0-py3-none-any.whlEnsure all dependencies are in pyproject.toml.
pip install streamlit toml- Update GitHub URLs in
pyproject.toml - Update author email in
pyproject.toml - Review and update README.md
- Review and update CHANGELOG.md
- Run all tests
- Build package locally
- Test on TestPyPI
- Verify installation from TestPyPI
- Publish to PyPI
- Verify installation from PyPI
- Create GitHub release
- Announce release
- Update GitHub URLs in
pyproject.tomlwith your actual repository - Update author email in
pyproject.toml - Test locally:
python -m build && twine check dist/* - Test on TestPyPI: Use Streamlit assistant or manual commands
- Publish to PyPI: Once everything works on TestPyPI
- Set up GitHub Actions: Add secrets or configure Trusted Publishing
- Announce: Share your package with the community!
Ready to publish? Run streamlit run publish_assistant.py to get started! 🚀