Releasing¶
This repository is prepared to publish Python packages via GitHub Actions using trusted publishing.
Release posture¶
- Public releases follow semantic versioning.
- The current public release line is
0.2.x. mainshould stay releasable: CI green,python -m buildgreen, and both installed-wheel and installed-sdist smoke tests passing.
Config surfaces¶
src/tick_backtest/config/templates/contains the public packaged templates exposed bytick-backtest example-config.src/tick_backtest/demo_data/contains the bundled public demo dataset used for the packaged example project.src/tick_backtest/config/contains checkout-only development fixtures used by repo smoke/golden checks. These are not part of the public installed template surface.
The CI workflow validates both sides: - installed-package smoke tests exercise the public packaged templates and demo data - installed-sdist smoke tests verify the published source-distribution install path - repo smoke/golden scripts exercise the checkout-only configs
Before tagging¶
- Update
pyproject.tomlversion. - Add a short entry to
CHANGELOG.md. - Ensure local checks pass:
source .venv/bin/activate rm -rf build dist python -m build python -m twine check dist/* pytest -q - Merge to
main.
TestPyPI publishing flow¶
TestPyPI publishing is handled by .github/workflows/testpypi-release.yml.
- Bump
pyproject.tomlto a version that has not already been uploaded to TestPyPI. - Create and push a tag such as
testpypi-v0.2.0. - The workflow builds:
- an sdist via
python -m build --sdist - Linux wheels via
cibuildwheel - On Linux,
cibuildwheelruns inside the standard manylinux container flow and usesauditwheelrepair so the published wheels carry manylinux tags instead of plainlinux_x86_64tags. The current configuration targets CPython 3.12 onx86_64and pins the Linux image family tomanylinux_2_28. - The workflow runs
twine checkover the sdist and repaired wheels. - The workflow publishes the artifacts to TestPyPI using GitHub OIDC trusted publishing and the
testpypienvironment.
The trigger is intentionally separate from future production tags so TestPyPI rehearsals do not imply a real PyPI release.
The TestPyPI workflow currently disables package attestations because TestPyPI attestation verification can reject otherwise valid trusted-publishing uploads. Revisit this when TestPyPI attestation support is stable enough for this project.
The workflow also retries the cibuildwheel step because Linux wheel builds depend on pulling manylinux container images from Quay, and transient Quay timeouts can otherwise fail the release before the build starts.
For public Linux binary distribution, the release path should use the cibuildwheel manylinux wheels, not the plain local python -m build wheel produced on a developer machine or generic Ubuntu runner.
Trusted publishing setup¶
Because the TestPyPI project does not exist yet, the first setup step is a pending Trusted Publisher on TestPyPI.
Create a pending Trusted Publisher with:
- Index: TestPyPI
- Project name:
tick-backtest - Owner:
edwardclewer - Repository:
tick_backtest - Workflow file:
.github/workflows/testpypi-release.yml - Environment name:
testpypi
This matches the workflow exactly:
- workflow filename:
.github/workflows/testpypi-release.yml - GitHub environment:
testpypi - publish job:
publish_testpypi
The first successful trusted-publishing run will create the TestPyPI project automatically.
No API token, username, or password is used in the workflow.
You may optionally add GitHub environment protection rules to testpypi, but they are not required for the initial dry run.
PyPI publishing flow¶
Real PyPI publishing is handled by .github/workflows/pypi-release.yml.
- Bump
pyproject.tomlto the intended release version. - Create and push a tag such as
v0.2.0. - The workflow builds:
- an sdist via
python -m build --sdist - Linux wheels via
cibuildwheel - The workflow runs
twine checkover the sdist and repaired wheels. - The workflow publishes the artifacts to PyPI using GitHub OIDC trusted publishing and the
pypienvironment.
The trigger is intentionally separate from TestPyPI tags:
- TestPyPI:
testpypi-v* - PyPI:
v*
Use GitHub environment protection on pypi if you want a manual approval gate before the publish job runs.
PyPI trusted publishing setup¶
Because the project does not yet exist on PyPI, the first setup step is a pending Trusted Publisher on PyPI.
Create a pending Trusted Publisher with:
- Index: PyPI
- Project name:
tick-backtest - Owner:
edwardclewer - Repository:
tick_backtest - Workflow file:
.github/workflows/pypi-release.yml - Environment name:
pypi
This matches the workflow exactly:
- workflow filename:
.github/workflows/pypi-release.yml - GitHub environment:
pypi - publish job:
publish_pypi
The first successful trusted-publishing run will create the PyPI project automatically.
No API token, username, or password is used in the workflow.
After publishing¶
- Verify installation from TestPyPI in a clean environment.
- Confirm the installed first-run path works:
pip install --index-url https://test.pypi.org/simple/ tick-backtest tick-backtest example-config --output ./demo --include-demo-data tick-backtest run ./demo/backtest.yaml - Verify the published package metadata matches the tagged source tree:
- version
- classifiers
- supported-platform claims
- Record any issues found before cutting the real PyPI tag.