This document describes how to cut a new release, publish wheels to TestPyPI or PyPI, and verify the artifacts.
pyproject.toml under [project] version.vX.Y.ZrcN, vX.Y.ZaN, vX.Y.ZbN, or vX.Y.ZdevNvX.Y.Zmain.README.md and CHANGELOG (if present).# Build C++
mkdir -p ~/matrixlib_build && cd ~/matrixlib_build
cmake -G "Unix Makefiles" -DBUILD_TESTS=ON -DBUILD_BENCHMARKS=OFF -DPYTHON_EXECUTABLE=$(which python3) /path/to/repo
cmake --build . -j
ctest --output-on-failure
# Python editable install & smoke import
pip install -U pip scikit-build-core pybind11 numpy
pip install -e /path/to/repo
python - <<'PY'
import LinAlgKit as lk
m = lk.Matrix(2,2,1.0)
print("OK:", m.to_numpy().shape)
PY
1) Build artifacts locally
python -m pip install -U build twine
python -m build
2) Upload to TestPyPI
# Create a token at https://test.pypi.org/account/ and set TWINE_PASSWORD env var
python -m twine upload -r testpypi dist/*
3) Verify install from TestPyPI in a clean venv
python -m venv .venv && source .venv/bin/activate
pip install -i https://test.pypi.org/simple/ LinAlgKit
python - <<'PY'
import LinAlgKit as lk
print(lk.Matrix(2,2,1.0).to_numpy())
PY
Publishing is automated via .github/workflows/release.yml:
v*, the workflow builds wheels (Linux/macOS/Windows) and an sdist.PYPI_API_TOKEN: PyPI token with upload permissions.TEST_PYPI_API_TOKEN: TestPyPI token with upload permissions.git tag v0.1.0rc1 # pre-release -> TestPyPI
git push --tags
# or stable
git tag v0.1.0
git push --tags
# Stable from PyPI
pip install LinAlgKit
# Pre-release from TestPyPI
pip install -i https://test.pypi.org/simple/ LinAlgKit
cmake/compiler during build-from-source:
sudo apt-get install -y cmake build-essential python3-devxcode-select --install (Command Line Tools)pip install -U numpy before installing LinAlgKit$HOME and point CMake to Windows path instead of building on /mnt/c.