This directory contains scripts to help automate the release process for publishing selectools to PyPI.
Before using these scripts, ensure you have:
-
PyPI API Token configured in GitHub
- Go to https://pypi.org/manage/account/token/
- Create a new API token
- Add it to GitHub repository secrets as
PYPI_API_TOKEN - Go to: https://github.com/johnnichev/selectools/settings/secrets/actions
-
Clean working directory
- Commit or stash any uncommitted changes before releasing
-
On the main branch
- The scripts will warn you if you're not on main
The Python script provides more features including dry-run mode and automatic changelog updates.
# Basic release
python scripts/release.py --version 0.3.1
# With custom commit message
python scripts/release.py --version 0.4.0 --message "Add streaming support and bug fixes"
# Dry run (see what would happen without making changes)
python scripts/release.py --version 1.0.0 --dry-run- ✅ Validates semantic versioning format
- ✅ Updates
pyproject.tomlversion - ✅ Updates
CHANGELOG.mdwith new version entry - ✅ Creates commit and tag
- ✅ Pushes to GitHub
- ✅ Dry-run mode for testing
- ✅ Interactive confirmations at each step
A simpler bash script for quick releases.
# Basic release
./scripts/release.sh 0.3.1
# With custom commit message
./scripts/release.sh 0.4.0 "Add new features"- ✅ Validates semantic versioning format
- ✅ Updates
pyproject.tomlversion - ✅ Creates commit and tag
- ✅ Pushes to GitHub
- ✅ Interactive confirmations
-
Local changes:
- Version updated in
pyproject.toml - Changes committed
- Git tag created (e.g.,
v0.3.1) - Pushed to GitHub
- Version updated in
-
GitHub Actions automatically:
- Runs all tests
- Builds the package (wheel + source distribution)
- Validates with
twine check - Publishes to PyPI (if
PYPI_API_TOKENis set) - Publishes to TestPyPI (if
TEST_PYPI_API_TOKENis set)
-
Monitor progress:
-
Verify publication:
- https://pypi.org/project/selectools/
- Test:
pip install --upgrade selectools
Follow Semantic Versioning:
- MAJOR.MINOR.PATCH (e.g.,
1.2.3) - MAJOR: Breaking changes
- MINOR: New features (backwards compatible)
- PATCH: Bug fixes (backwards compatible)
Examples:
0.3.1→ Bug fixes0.4.0→ New features1.0.0→ First stable release
Make the scripts executable:
chmod +x scripts/release.py scripts/release.shThe publish step will be skipped. Add the token to GitHub secrets:
- Go to https://github.com/johnnichev/selectools/settings/secrets/actions
- Add
PYPI_API_TOKENwith your PyPI token
PyPI doesn't allow re-uploading the same version. Bump to a new version number.
The publish step won't run if tests fail. Fix the tests and push again, or delete the tag and re-release:
git tag -d v0.3.1
git push origin :refs/tags/v0.3.1If you prefer to do it manually:
# 1. Update version in pyproject.toml
# Edit: version = "0.3.1"
# 2. Commit
git add pyproject.toml
git commit -m "Bump version to 0.3.1"
# 3. Tag
git tag v0.3.1
# 4. Push
git push origin main
git push origin v0.3.1smoke_cli.py: Quick smoke tests for different providerstest_memory_with_openai.py: Test conversation memory with OpenAI