This guide explains how to publish the vortex-sdk-python package to the Python Package Index (PyPI).
pip install --upgrade build twine- Go to https://pypi.org/manage/account/token/
- Create a new API token with "Entire account" scope
- Save the token (starts with
pypi-)
- Go to https://test.pypi.org/manage/account/token/
- Create a new API token
- Save the token
Create a ~/.pypirc file:
[distutils]
index-servers =
pypi
testpypi
[pypi]
username = __token__
password = pypi-YOUR_PYPI_TOKEN_HERE
[testpypi]
repository = https://test.pypi.org/legacy/
username = __token__
password = pypi-YOUR_TESTPYPI_TOKEN_HERESet permissions: chmod 600 ~/.pypirc
Edit version in both files:
setup.py(line 8)pyproject.toml(line 7)src/vortex_sdk/__init__.py(line 21)
Use semantic versioning (e.g., 0.1.0, 0.2.0, 1.0.0)
Ensure these files are current:
README.md- Clear installation and usage instructionsCHANGELOG.md- Document changes (create if doesn't exist)
rm -rf build/ dist/ *.egg-info src/*.egg-infopython3 -m buildThis creates:
dist/vortex_sdk_python-X.Y.Z-py3-none-any.whl(wheel)dist/vortex-sdk-python-X.Y.Z.tar.gz(source distribution)
ls -lh dist/You should see both .whl and .tar.gz files.
twine check dist/*All checks should pass.
twine upload --repository testpypi dist/*# In a fresh virtual environment
python3 -m venv test_env
source test_env/bin/activate
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ vortex-sdk-python
# Test import
python3 -c "from vortex_sdk import VortexSDK; print('✓ Success')"
deactivate
rm -rf test_envtwine upload dist/*Visit: https://pypi.org/project/vortex-sdk-python/
pip install vortex-sdk-python
python3 -c "from vortex_sdk import VortexSDK; print('✓ Success')"git tag -a v0.1.0 -m "Release version 0.1.0"
git push origin v0.1.0- Go to your repository on GitHub
- Click "Releases" → "Create a new release"
- Select the tag you just created
- Add release notes
- Publish release
Add to README.md:
[](https://badge.fury.io/py/vortex-sdk-python)- Ensure version numbers match in
setup.py,pyproject.toml, and__init__.py - Clean build artifacts:
rm -rf build/ dist/ *.egg-info
- Check API token is correct in
~/.pypirc - Ensure token has proper permissions
- You cannot re-upload the same version
- Increment version number and rebuild
- The name
vortex-sdk-pythonmight be taken - Consider alternative names like
vortexfi-pythonorvortex-python-sdk
For subsequent releases:
- Make your code changes
- Update version numbers in all three files
- Update CHANGELOG.md
- Clean old builds:
rm -rf dist/ build/ *.egg-info - Build:
python3 -m build - Check:
twine check dist/* - Upload:
twine upload dist/* - Tag and release on GitHub
- Never delete published versions - PyPI doesn't allow re-uploading
- Test on TestPyPI first - Always test before publishing to production
- Use semantic versioning - Major.Minor.Patch (e.g., 1.2.3)
- Keep credentials safe - Never commit
~/.pypircor API tokens - Update docs - Keep README and examples current