This guide documents the release workflow for the mtpx package.
Prerequisites
- PyPI account
- Project ownership for
mtpxon PyPI - Build tools:
bashpython -m pip install --upgrade build twineBuild
From repository root:
bashpython -m buildArtifacts:
dist/*.whldist/*.tar.gz
Validate Distributions
bashpython -m twine check dist/*Publish To TestPyPI (Recommended First)
bashpython -m twine upload --repository testpypi dist/*Install test package:
bashpip install --index-url https://test.pypi.org/simple/ mtpxPublish To PyPI
bashpython -m twine upload dist/*After upload:
bashpip install mtpxReleasing A New Version
- Update version in
pyproject.toml. - Update
CHANGELOG.md. - Verify optional dependency extras are current and valid.
- Rebuild and validate.
- Publish with Twine.
Versioning policy uses semantic versioning:
- Patch: bug fixes
- Minor: backward-compatible features
- Major: breaking changes
Suggested Release Checklist
bash# update pyproject.toml version first
python -m pytest tests/test_packaging_extras.py
python -m pip install -e ".[all]"
python -m build
python -m twine check dist/*
python -m twine upload dist/*Optional git tagging:
bashgit tag v0.1.4
git push origin v0.1.4Troubleshooting
File already exists- Version already published. Bump version and rebuild.
403 Forbidden- Invalid or expired PyPI token.
Invalid distribution- Remove old artifacts and build again.
Notes
- Core package import remains
import mtp. - Package name for installation is
mtpx. - Provider SDKs and database drivers are optional and installed separately.
Step 1: Clean old build files
Remove-Item -Recurse -Force dist, build -ErrorAction SilentlyContinue Remove-Item -Recurse -Force src\*.egg-info -ErrorAction SilentlyContinue
Step 2: Build the package
python -m build
Step 3: Validate the package
python -m twine check dist/*
Step 4: Upload to PyPI
python -m twine upload dist/mtpx-0.1.33*
pip install -e .