Skip to content

ci: block a publish when the tag disagrees with pyproject.toml - #5

Merged
yash161004 merged 1 commit into
mainfrom
ci/tag-version-guard
Jul 29, 2026
Merged

ci: block a publish when the tag disagrees with pyproject.toml#5
yash161004 merged 1 commit into
mainfrom
ci/tag-version-guard

Conversation

@yash161004

Copy link
Copy Markdown
Owner

Why

Publishing is irreversible — PyPI does not permit re-uploading a version — and this repo has already had a near-miss of exactly this class: 0.2.0 was written into pyproject.toml, never tagged, and never released, so the tree disagreed with reality for three weeks. That's what made openeval-core>=0.1.2 look like a valid pin when it shipped no fixtura adapter at all.

fixtura already runs this guard (yash161004/fixtura-core#10). Porting it back.

Changes

1. Tag-vs-version check before the build:

TAG="${GITHUB_REF_NAME#v}"
VERSION="$(python -c 'import tomllib; ...')"
[ "$TAG" != "$VERSION" ] && exit 1

2. Build interpreter 3.10 → 3.11, which tomllib requires. This does not narrow what the release supports — the wheel is pure Python (py3-none-any, confirmed on the published 0.2.1 artifact) and requires-python = ">=3.10" is declared in pyproject.toml, independent of the interpreter that builds it.

3. CHANGELOG.md: marked the 0.2.0 section — NEVER RELEASED, with a note that pip install openeval-core==0.2.0 does not resolve and never will. Previously it read like a shipped release.

Verified

Case Result
tag v0.2.1 vs pyproject 0.2.1 passes, would publish
tag v9.9.9 vs pyproject 0.2.1 correctly blocked

Workflow YAML parses; permissions unchanged (id-token: write, contents: read).

No version change here — 0.2.1 is already published, so this is CI and docs only.

🤖 Generated with Claude Code

Publishing is irreversible -- PyPI does not permit re-uploading a version -- and
this repo has already had a near-miss of exactly this class: 0.2.0 was written
into pyproject.toml, never tagged, and never released, so the version in the
tree disagreed with reality for three weeks.

Port the guard fixtura already runs: compare the pushed tag against the version
in pyproject.toml and fail before the build if they differ.

Bumps the build-time interpreter 3.10 -> 3.11 for tomllib. This does not narrow
what the release supports: the wheel is pure Python (py3-none-any) and
requires-python is declared in pyproject.toml, independent of the interpreter
that builds it.

Also mark the 0.2.0 CHANGELOG section as never released, so nobody reads it as a
version they can install.

Verified locally: a v0.2.1 tag passes against pyproject 0.2.1, and a mismatched
tag is correctly rejected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@yash161004
yash161004 merged commit 056667c into main Jul 29, 2026
6 checks passed
@yash161004
yash161004 deleted the ci/tag-version-guard branch July 29, 2026 03:44
yash161004 added a commit that referenced this pull request Jul 29, 2026
The `test` job installs .[dev], which pulls
openeval-core[fixtura,langchain,openai], so every optional dependency is always
present and the job cannot detect an adapter that has started requiring one.

That is how the eager `from .langchain import ...` in
openeval/adapters/__init__.py shipped: the suite stayed green the whole time
while `pip install openeval-core` could not import any adapter at all. The fix
in #5 removed the bug but left nothing to stop it coming back.

Add a bare-install job that reproduces what a real user gets and asserts:

- adapters with no third-party dependency import (fixtura, openai -- the openai
  adapter parses dicts and never imports the openai package)
- the LangChain adapter fails only on access, and cleanly
- an unknown attribute still raises AttributeError, so the lazy __getattr__
  cannot silently swallow typos
- the optional deps really are absent, so the job cannot pass vacuously if one
  ever becomes a base dependency

Wired into all-tests-passed, which is the required check, so it actually gates.

Verified against a clean venv: all assertions pass on current main, and
reinstating the eager import makes the import assertion fail as intended.

Closes #6

Co-authored-by: yash161004 <yash161004@github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant