This document describes the process for releasing new versions of GSW PyTorch.
We follow Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backwards-compatible manner
- PATCH version for backwards-compatible bug fixes
Before creating a release, ensure:
- All tests pass (
pytest) - Code quality checks pass (
ruff check,mypy gsw_torch) - Documentation is up to date
-
CHANGELOG.mdis updated with release notes -
README.mdreflects current status - Version number updated in:
pyproject.tomlgsw_torch/_version.py
-
LICENSEfile is present -
MANIFEST.inincludes all necessary files - Package builds successfully (
python -m build) - Package installs successfully (
pip install dist/*.whl) - Import works (
python -c "import gsw_torch; print(gsw_torch.__version__)")
Update version in two places:
pyproject.toml:
[project]
version = "0.1.0" # Update to new versiongsw_torch/_version.py:
__version__ = "0.1.0" # Update to new versionAdd a new section to CHANGELOG.md:
## [0.1.0] - 2025-01-27
### Added
- List of new features
### Changed
- List of changes
### Fixed
- List of bug fixes
### Known Limitations
- List any known issues# Install build tools
pip install build
# Build source distribution and wheel
python -m build
# Verify build
ls dist/
# Should see: gsw-torch-0.1.0.tar.gz and gsw_torch-0.1.0-py3-none-any.whl# Create clean virtual environment
python -m venv test_env
source test_env/bin/activate # Linux/Mac
# or
test_env\Scripts\activate # Windows
# Install from wheel
pip install dist/gsw_torch-0.1.0-py3-none-any.whl
# Test import
python -c "import gsw_torch; print(gsw_torch.__version__)"
python -c "import gsw_torch; help(gsw_torch.CT_from_t)"# Commit all changes
git add .
git commit -m "Release version 0.1.0"
# Create annotated tag
git tag -a v0.1.0 -m "Release version 0.1.0"
# Push commits and tags
git push origin main
git push origin v0.1.0- Go to GitHub repository
- Click "Releases" → "Draft a new release"
- Select tag:
v0.1.0 - Title:
Version 0.1.0 - Description: Copy from
CHANGELOG.md - Upload
dist/gsw-torch-0.1.0.tar.gzanddist/gsw_torch-0.1.0-py3-none-any.whl - Mark as "Latest release" if appropriate
- Publish release
Note: PyPI publishing should be done carefully and only after thorough testing.
# Install twine
pip install twine
# Upload to TestPyPI first
twine upload --repository testpypi dist/*
# Test installation from TestPyPI
pip install --index-url https://test.pypi.org/simple/ gsw-torch
# If successful, upload to PyPI
twine upload dist/*PyPI Credentials: Store in ~/.pypirc or use environment variables.
After release:
- Update
IMPLEMENTATION_STATUS.mdif needed - Announce release (if applicable)
- Monitor for issues
- Plan next release
- Breaking API changes
- Major new features
- Significant refactoring
- Requires migration guide
- New functions added
- New features
- Backwards compatible
- Update
IMPLEMENTATION_STATUS.md
- Bug fixes
- Documentation updates
- Performance improvements
- No API changes
For critical bugs:
- Create hotfix branch from main
- Fix the issue
- Add test to prevent regression
- Follow release process with patch version bump
- Merge hotfix back to main
- 118+ functions implemented
- Full PyTorch implementation with autograd support
- GPU acceleration support
- Numerical parity with reference GSW
- Comprehensive test suite
- Complete documentation
See IMPLEMENTATION_STATUS.md for detailed list of known limitations, including:
- Precision issues in some derivative functions
- Autograd limitations for edge cases (SA=0)
- Polynomial fitting precision in spiciness functions
- Additional functions from reference GSW
- Performance optimizations
- Enhanced documentation
- API improvements based on user feedback
- Complete function coverage
- Stable API
- Production-ready status
- Full documentation