Skip to content

Versioning and releases

How dokimi is versioned, how a change reaches the changelog, and how a release is cut. The first release is 0.1.0.

Version numbers

The version lives in project.version in pyproject.toml, with a copy in package.version of ../conda-recipe/meta.yaml that tests/test_conda_recipe.py keeps equal to it. dokimi --version, dokimi.__version__ and the dokimi_version field of the dokimi docs check manifest, of the subject scorecard run_manifest and of each catalog check --jsonl row all read it. A source checkout reads pyproject.toml itself, an installed wheel its package metadata.

dokimi follows Semantic Versioning. Before 1.0 the minor number is the breaking one:

Bump When
minor, 0.1.0 → 0.2.0 anything a user may have to react to: a command, flag or output field removed or renamed; a changed default; a metric, judge prompt or scoring change that moves scores for the same inputs; a dropped Python version; new features
patch, 0.1.0 → 0.1.1 fixes that change no interface and no score for inputs that already worked; docs; packaging

A scoring change is a minor bump even when no interface changes: results from two versions are comparable only when the scoring is the same, and the version in the dokimi docs check manifest or the scorecard is how a reader tells.

Artifact formats are versioned separately, by the schema_version of each file under dokimi/schemas/ and the schema_compat vs the PR base step in ci.yml's static job; a package release does not replace that.

Between releases main keeps the version of the last release; the release PR bumps it.

Changelog

CHANGELOG.md is generated: each PR that changes the package adds a fragment to changelog.d/, and the release PR collects them. See changelog.d/README.md for how to write one and when the Fragment for package changes step in ci.yml's static job asks for it.

Cutting a release

  1. Release PR (from a fork, like any PR). From dokimi/:
# bump project.version in pyproject.toml and package.version in
# ../conda-recipe/meta.yaml to X.Y.Z, then:
scriv collect --version X.Y.Z          # fragments -> CHANGELOG.md section
python scripts/check_release.py vX.Y.Z  # what the release workflow checks

Read the collected section as a user would and tidy it. Merge the PR.

  1. Release. A maintainer first runs the release workflow on main and waits for it to pass while main is still the merge commit: the workflow runs only after the Release is published, so a failure there leaves a Release without files and spends the version. Then the maintainer creates the GitHub Release, and with it the tag, on the merge commit:
gh workflow run release.yml -R intel/dokimi --ref main  # no tag: it does not exist yet
python scripts/check_release.py vX.Y.Z --notes > notes.md
gh release create vX.Y.Z -R intel/dokimi --target <merge-commit-sha> \
  --title "dokimi X.Y.Z" --notes-file notes.md

Publishing the release runs .github/workflows/release.yml. It checks the tag against the version, the changelog section and leftover fragments, builds the sdist and wheel (the wheel from the sdist), smoke-tests the installed wheel from outside the checkout (scripts/smoke_installed.py), runs the test suite with the newest dependency releases the ranges allow, signs both files, attaches them to the release with their signatures and build provenance (see Verifying a release) and, once enabled, uploads them to PyPI. If it fails, fix on main and release the next patch version: a published version is never rebuilt.

workflow_dispatch runs the same build, smoke test and test suite without uploading anything. Given a tag, it checks out that tag (and fails if it does not exist) and also runs the readiness check on it; without one it builds the ref it was dispatched from.

Verifying a release

Each release carries, next to the sdist and wheel:

  • <file>.sigstore.json: a Sigstore bundle per file, signed keyless with the identity of release.yml on the release tag.
  • dokimi-X.Y.Z.intoto.jsonl: a SLSA build-provenance attestation for both files (which workflow run, commit and runner built them), also stored in the repository's attestations.
gh release download vX.Y.Z -R intel/dokimi
# signature: signed by release.yml on the tag
python -m pip install sigstore
python -m sigstore verify github dokimi-X.Y.Z-py3-none-any.whl \
  --bundle dokimi-X.Y.Z-py3-none-any.whl.sigstore.json \
  --repository intel/dokimi --ref refs/tags/vX.Y.Z --name release
# provenance, from the attached file (offline) or the repository's attestations
gh attestation verify dokimi-X.Y.Z-py3-none-any.whl -R intel/dokimi \
  --signer-workflow intel/dokimi/.github/workflows/release.yml \
  --bundle dokimi-X.Y.Z.intoto.jsonl

The same commands check the sdist (dokimi-X.Y.Z.tar.gz). Releases before this (v0.1.0) are unsigned.

Enabling PyPI

The pypi job of the release workflow is off until a maintainer, once:

  1. On PyPI, adds a pending trusted publisher for project dokimi: owner intel, repository dokimi, workflow release.yml, environment pypi. Trusted Publishing authenticates the upload with the workflow's OIDC token, so no API token is created or stored. A pending publisher does not reserve the name: the first upload does.
  2. In intel/dokimi settings, creates the environment pypi, limited to tags v*, optionally with required reviewers so each upload waits for approval.
  3. Sets the repository variable PYPI_PUBLISH to true.

The next published release then goes to PyPI too.

conda-forge

conda-forge packages are built by a feedstock repository under conda-forge/, not from this repository. After the first PyPI release:

  1. Generate a recipe from the PyPI sdist (grayskull pypi dokimi), make it noarch: python with python {{ python_min }}.* in host and test and python >={{ python_min }} in run, where python_min is 3.11 unless the conda-forge global value is already at least that (see conda-forge's noarch guide), test with dokimi --version and dokimi --help, add the maintainers, and open a PR to conda-forge/staged-recipes. The sdist is the source because it is the project directory alone (this repository's dokimi/), with LICENSE at its root for license_file.
  2. Once merged, conda-forge creates conda-forge/dokimi-feedstock. From then on its bot opens a version-bump PR for every new PyPI release; a maintainer checks the dependency changes in it and merges.

Every runtime dependency in pyproject.toml must be on conda-forge, in a version inside its range: the conda-forge.yml workflow checks this on every PR that changes pyproject.toml, and weekly for drift on conda-forge, so a dependency conda-forge lacks is found while the PR is open, not on the feedstock's version-bump PR after the release. A new dependency it fails on goes to staged-recipes first; one whose conda-forge name differs from its PyPI name goes in CONDA_NAMES of scripts/conda_forge_specs.py. The recipe's run: list is a copy of the dependencies: a change to them goes into the version-bump PR by hand. An optional extra (ragas, ocr, mcp, embeddings, typed-scorer) is not part of the conda package.