Skip to content

Releasing cypher2sql

One release target at a time, on a release/<version> branch cut from develop. Only the conductor pushes the branch and opens the PR; a human merges it into develop. Nothing is ever force-pushed, tagged or merged by an agent.

Before opening the release PR

  1. Version. Bump version in pyproject.toml to <version> (no .dev0/local suffix) and uv.lock agrees: uv lock --check is clean. tests/test_packaging.py reads the version from pyproject.toml and fails if the changelog disagrees.
  2. Changelog. CHANGELOG.md has a dated ## <version> — YYYY-MM-DD entry covering what actually shipped, plus known limits. No unreleased heading is left.
  3. Docs. README.md shows the stable pip install cypher2sql line, and every sql/python fence of the tutorial, the API reference and the README runs: make check (the four t-string blocks run under make check-py314; below 3.14 make check reports them as skipped). Docs that describe an unbuilt API use the harness's pending: #N marker, and no such marker may survive a release. The PyPI publish job (#47, dispatch-only, human-run) must run before that install line is true.
  4. TCK. make tck is green and its first line records the live split. The in-scope count is a ratchet: copy in-scope passing: N / N into the PR body and never lower tests/tck/scope.toml's in_scope_floor for a release. Record planned: P in the PR body too and list the surviving scenario keys — 0.1.0 ships P = 31. A scenario that still cannot pass at release time is a written decision, never a silent skip; one that does pass is promoted in scope.toml before the release.
  5. Review Gate. review-cruft, review-dx and review-security have each run on the release diff; their REVIEW FAIL findings are closed, not waived. The review-dx pass reads the tutorial as a newcomer, because the docs are the product.

Gates and the artifact

make check        # ruff format --check + ruff check + mypy --strict + pytest on real PostgreSQL
make tck          # openCypher TCK; prints the live in-scope/planned/out-of-scope split
make check-py314  # the 3.14-only doc blocks and template tests; must print `skipped 0 blocks ...`
make docs-check   # the published site: strict build, heading inventory, links, determinism
uv lock --check   # the lock agrees with pyproject.toml
uv build          # dist/cypher2sql-<version>-py3-none-any.whl and dist/cypher2sql-<version>.tar.gz

Smoke the wheel the way a user installs it — a clean venv, no dev dependencies, no database:

uv venv /tmp/c2s-wheel
uv pip install --python /tmp/c2s-wheel/bin/python dist/cypher2sql-<version>-py3-none-any.whl
uv pip show --python /tmp/c2s-wheel/bin/python cypher2sql   # `Requires:` must be empty
cd /tmp && /tmp/c2s-wheel/bin/python <checkout>/tests/test_packaging.py

The last command executes the tutorial's schema block and its first query from the installed wheel and compares the emitted SQL with the text docs/tutorial.md documents, so a wheel that drifts from the docs cannot ship. CI runs the same four jobs: check, tck, docs-py314 (Python 3.14 is mandatory — no continue-on-error, no branch/path condition, the job fails unless the run reports skipped 0 blocks requiring python 3.14) and build (sdist + wheel, clean-venv install, tutorial smoke).

The PR

  1. Push release/<version> and open the PR into develop (conductor only), titled for the version.
  2. The body carries: the changelog entry, the TCK live split with the surviving planned scenario keys, the three Review Gate outcomes, the uv build artifact names, and Fixes #<n> for every issue the release closes.
  3. Humans review and merge; the PR is merged, never force-pushed or rebased, and no agent creates a tag.
  4. After the merge, the next release/<version> branch is cut from the updated develop, and the next milestone's issues are the only release target.

Publishing

The pip install cypher2sql line in the README (and the tutorial's pip install cypher2sql psycopg) becomes true only after the first publish below: before that it names the release target, not an installable distribution. A human publishes, never an agent, and only after the release PR has merged into develop.

.github/workflows/publish.yml is workflow_dispatch-only — no push, tag or schedule runs it. It builds the sdist and wheel and uploads both with PyPI trusted publishing (OIDC; the job has id-token: write and environment: release, so no token secret exists). Before the first run, configure a trusted publisher on PyPI for this repository, workflow publish.yml and environment release; that setting goes through the ask-human issue.

  1. Open Actions → publish → Run workflow on develop, after the release PR merge.
  2. Wait for both artifacts to upload, then run the post-publish gate against the index, not the checkout:
uv venv /tmp/c2s-pypi
uv pip install --python /tmp/c2s-pypi/bin/python cypher2sql
/tmp/c2s-pypi/bin/python -c 'from cypher2sql import Edge, Node, Schema; c = Node("Customer", table="customer", key="id", properties={"country": str}); o = Node("Order", table="order", key="id"); s = Schema(nodes=[c, o], edges=[Edge("PLACED", c, o, source_columns="customer_id")]); print(s.to_sql("MATCH (c:Customer {country: $country})-[:PLACED]->(:Order) RETURN c", {"country": "FR"}).sql)'

The printed SQL must start SELECT n1."id"; a No matching distribution found from pip means the release is not visible on the index pip used. Also check the project page shows no dependencies, the Apache-2.0 license and the Typing :: Typed classifier. The project page renders metadata, not wheel contents; that the wheel itself ships py.typed is proved by tests/test_packaging.py inspecting the built wheel.

If the workflow is unavailable, the same artifacts built by the release commit can be uploaded by hand with the exact fallback:

uv publish dist/*

The documentation site

https://offworldnexus.github.io/cypher2sql/ serves the same Markdown this repository's tests execute. .github/workflows/docs.yml builds and publishes it on a push to develop (or by hand with Run workflow), never from a release branch: the site publishes what is on develop — a release merge makes the released version current. The deploy job also carries if: github.ref_name == 'develop', so a hand-run dispatch from a release or feature branch cannot publish. It runs in the github-pages environment with contents: read, pages: write and id-token: write; it runs make docs-check (the strict build plus the content guard), uploads site/ and deploys it with GitHub Pages. Every action is a full commit SHA, as in ci.yml. No agent pushes or deploys; the site updates itself when a human merges the release PR.

Preview locally:

make docs                                   # zensical build --strict -> site/
make docs-check                             # strict build plus tests/test_docs_site.py
uv run python -m http.server -d site 8000   # serve site/ on http://localhost:8000

The build is deterministic — two consecutive builds are byte-identical, which tests/test_docs_site.py asserts — and it does not use the network: a build with HTTPS_PROXY pointed at a closed port succeeds, so make check still needs no network. Exit 0 alone is not success: Zensical 0.1.4 exits 0 after silently dropping a fence it does not understand, so make docs-check inventories every heading and code block in the built HTML and fails, naming the page, if one vanished. The fence-info contract, and why a bare attribute is a harness error, is in Executable docs.