Skip to content

revert: restore evaluators for 0.14 - #131

Merged
huangjeff5 merged 4 commits into
mainfrom
revert/evaluators-for-0.14
Nov 17, 2026
Merged

huangjeff5 merged 4 commits into
mainfrom
revert/evaluators-for-0.14

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Restores evaluators for 0.14, warns at runtime that they will be removed next release, caps genkit-evaluators at <0.15, and makes the Vertex AI evaluator import in genkit-google-genai optional. Combined with the removal plan below, CI/CD pipelines that rebuild and redeploy Genkit apps keep working when evaluators are removed in 0.15 or 1.0 (the sole exception is pinning genkit-google-genai==0.13.0 with unpinned genkit).

Changes

  • Restores evaluators for 0.14. Reverts feat(py)!: remove evaluators from 1.0 #37 (b7330db86) and 4397bd409 so genkit.evaluator, genkit-evaluators, and the Vertex AI evaluators ship in 0.14, keeping every 0.13 → 0.14 upgrade path intact.
  • Warns at runtime when evaluators are used. define_evaluator, define_batch_evaluator, evaluate, register_genkit_evaluators, and direct evaluator action runs emit a FutureWarning (Genkit evaluators are deprecated in 0.14 and will be removed in the next release.) attributed to the caller's line. Uses FutureWarning because Python hides non-__main__ DeprecationWarnings by default (PEP 565). Importing genkit.evaluator or initializing VertexAI stays silent so model and embedder users see nothing.
  • Caps genkit-evaluators at the next minor (<0.(Y+1)). bin/bump_version and scripts/check_consistency.py write genkit>=0.14.0,<0.15 (and genkit[evaluators] pulls genkit-evaluators>=0.14.0,<0.15) instead of <1, holding evaluator resolves on 0.14 whether removal happens in 0.15 or 1.0.
  • Makes the genkit-google-genai evaluator import optional. genkit-google-genai allows genkit<2, and published 0.14 wheels can't be patched later. Skipping Vertex evaluator registration only on ModuleNotFoundError with e.name == 'genkit.evaluator' (while still raising any other import error) lets model and embedder users upgrade genkit past 0.14 without capping genkit-google-genai.

Follow-up removal plan

  1. Done: genkit-evaluators 0.9.0–0.12.0 are yanked on PyPI. 0.9.0 was the first release under the genkit-evaluators name (before that it was genkit-plugin-evaluators). 0.9.0–0.12.0 all declared a bare Requires-Dist: genkit and already broke on 0.13+ because of private imports. Yank reason: Incompatible with genkit>=0.13.0; upgrade to genkit-evaluators>=0.13.0 or pin genkit-evaluators==<version>. 0.13.0 stays live until 0.14.0 ships, so fresh installs still have a version to resolve to.
  2. Publish 0.14.0 (this PR + regenerated chore: release v0.14.0 #130), then immediately yank genkit-evaluators 0.13.0. 0.14.0 release notes warn: "genkit-evaluators 0.14 is the last line and requires genkit<0.15. Uninstall it before upgrading past 0.14." 0.13.0 caps at genkit<1, which blocks 1.0 on its own but allows 0.15 — yanking 0.13.0 once 0.14.0 is live leaves 0.14.0 (<0.15) as the sole non-yanked release, so uv and Poetry treat 0.15 and 1.0 identically instead of backtracking onto genkit 0.15 + genkit-evaluators 0.13.0 if 1.0 slips.
  3. Remove evaluators in the next release (0.15 or 1.0) with two safeguards:
    • genkit.evaluator stub: raises ModuleNotFoundError(..., name='genkit.evaluator') with fix instructions (see snippet below). genkit-google-genai 0.14 skips Vertex evaluators only on that exact error.
    • Frozen evaluators extra: keep evaluators = ["genkit-evaluators>=0.14.0,<0.15"] in packages/genkit/pyproject.toml so genkit[evaluators] resolves to 0.14 instead of installing post-0.14 genkit with no evaluator package. Exempt genkit-evaluators in both scripts/check_consistency.py and bin/bump_version so bump_version 0.15.0's 0.x sed rule doesn't roll the frozen bound to >=0.15.0,<0.16.
  4. Post-removal release notes: lead with pip install -U genkit genkit-google-genai, note that genkit-evaluators holds resolves on 0.14 until uninstalled, and tell anyone pinning genkit-google-genai<0.14 to bump it.

What happens to user environments

Tested against pip 26.3, uv 0.9.18, and Poetry 2.5.1 in fresh venvs using a local PEP 503 mirror serving real 0.9–0.13 PyPI wheels, 0.14 from this branch, and a post-removal release (1.0.0, with the stub and frozen extra) built from main:

Apps without evaluators

  • Unpinned, genkit==0.9.0–0.13.0, or genkit-google-genai>=0.14.0: unaffected by genkit-evaluators yanks (genkit itself is never yanked), and unpinned/>=0.14.0 apps upgrade cleanly to 0.15 / 1.0.
  • Pinned genkit-google-genai==0.13.0 + unpinned genkit: the one deploy that fails at startup after removal (0.13.0 is already published, allows genkit<2, and unconditionally imports genkit.evaluator). The stub turns the crash into an actionable message; bump the genai pin to >=0.14.0:
    ModuleNotFoundError: genkit.evaluator was removed in genkit 1.0.0. An installed package still imports it:
      - genkit-evaluators: uninstall it, or stay on genkit 0.14
      - genkit-google-genai older than 0.14: run `pip install -U genkit-google-genai`
    

Apps with evaluators

  • Fresh CI builds (pip install -r, uv pip install -r, loose pyproject.toml floors, genkit[evaluators]): resolve to 0.14.0 regardless of package order, and the app keeps working. Drop genkit-evaluators when ready to upgrade past 0.14.
  • Exact == pins on both packages (genkit==0.9.0 + genkit-evaluators==0.9.0, etc.): unchanged (== bypasses PEP 592 yanks, and yanked wheels remain on PyPI).
  • Committed lockfiles (uv.lock, poetry.lock): uv sync --frozen/--locked and poetry install install locked versions as-is (even if yanked later). Full lock upgrades (uv lock --upgrade, poetry update) hold on 0.14.0, and explicit upgrades (uv add genkit==1.0.0 / 0.15.0) fail fast at solve time. (One 0.15 edge case: a single-package --upgrade-package genkit bump on a stale lock still holding genkit-evaluators==0.13.0 passes the solver because PEP 592 yanks don't evict locked entries and 0.13.0 allows genkit<1; CI catches it on import via the stub.)
  • New user following an old tutorial (pip install genkit genkit-evaluators, uv add ...): resolves to 0.14.0, runs, and prints FutureWarning: Genkit evaluators are deprecated in 0.14 and will be removed in the next release. at their call site.
  • Already past 0.14, then adding genkit-evaluators: uv add and poetry add fail before installing; pip install genkit-evaluators downgrades genkit to 0.14.0 and reports the conflict with genkit-google-genai.
  • In-place pip install -U genkit in an existing venv or notebook: pip warns that installed genkit-evaluators 0.14.0 requires genkit<0.15 but installs the new genkit anyway; running the app surfaces the stub message.
  • Fresh resolves pinned below 0.14 (genkit==0.9.0–0.13.0 + unpinned genkit-evaluators, or genkit[evaluators]==0.10.0–0.12.0): 0.9.0–0.12.0 are now yanked, and 0.13.0 will be yanked after 0.14.0 ships, so these setups have to pin the matching version explicitly: genkit-evaluators==<version>. == bypasses PEP 592 yanks. genkit 0.10–0.12 declared an unpinned genkit-evaluators in its [evaluators] extra. genkit 0.9.0 had no [evaluators] extra.

Merge order

…uator exists

genkit-google-genai allows genkit<2 and imported genkit.evaluator at module
load. A later genkit release removes that module, so `pip install -U genkit`
would break `from genkit_google_genai import VertexAI` for every Google AI and
Vertex AI user, with or without genkit-evaluators installed.

Catch only ModuleNotFoundError(name='genkit.evaluator'), skip Vertex AI
evaluator registration, and have _resolve_evaluator return None. Any other
import error, including a missing name inside an existing genkit.evaluator,
still propagates.
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.

2 participants