Skip to content

build: isolate optional runtime dependencies#1702

Open
xeophon wants to merge 4 commits into
feat/nano-as-v1from
codex/isolate-optional-dependencies
Open

build: isolate optional runtime dependencies#1702
xeophon wants to merge 4 commits into
feat/nano-as-v1from
codex/isolate-optional-dependencies

Conversation

@xeophon

@xeophon xeophon commented Jun 16, 2026

Copy link
Copy Markdown
Member

Overview

Keep the base Verifiers install focused on default evaluation and platform paths while making Modal and renderer-backed training explicit opt-ins.

Details

  • Move Modal to verifiers[modal] and renderer-backed clients to verifiers[renderers]; keep renderers in the development group for repository integration coverage.
  • Preserve TrainClient as a lazy package export and validate renderer configuration with the native renderer config union when the extra is installed.
  • Use native renderer multimodal types when available, with lightweight V1 fallback types for base installations.
  • Regenerate the lockfile so frozen installs reflect the optional extras while preserving the repository exclusion policy.
  • Remove unused direct requirements for Jinja2, Textual, the unreachable Python 3.10 tomli marker, and the obsolete regex workaround.
  • Leave Daytona out until a shipped runtime or another package path consumes it.

User Impact

Default evaluation workflows continue to use the base package. Renderer-backed training requires verifiers[renderers], and the Modal runtime requires verifiers[modal].


Note

Medium Risk
Install-time and import-path behavior changes for anyone relying on implicit modal/renderers/textual in the base package; training and multimodal serialization paths need the renderers extra to match full behavior.

Overview
Shrinks the default verifiers install by moving modal, renderers, and several unused direct deps (jinja2, textual, the old regex pin, and tomli for <3.11) out of core dependencies. verifiers[modal] and verifiers[renderers] are new optional extras; renderers stays in the dev group so repo CI still exercises renderer-backed paths.

Renderer-backed training no longer loads at import time: TrainClient is lazy-exported from verifiers.v1.clients (clear error pointing at verifiers[renderers]), resolve_client imports it only for TrainClientConfig, and RendererConfig degrades to dict[str, Any] when renderers is missing.

v1 core types work without renderers: MultiModalData / PlaceholderRange are imported from renderers when present, otherwise defined as lightweight dataclass fallbacks in verifiers.v1/types.py; graph and trace import those types from verifiers.v1.types instead of renderers.base.

uv.lock is regenerated so frozen installs match the slimmer default graph (e.g. textual and its markdown extras drop out of the base tree).

User impact: plain pip install verifiers stays eval/platform-focused; renderer training needs verifiers[renderers], Modal runtime needs verifiers[modal].

Reviewed by Cursor Bugbot for commit 317e77d. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Make renderers, modal, jinja2, and textual optional runtime dependencies

  • Removes renderers, modal, jinja2, and textual from core dependencies in pyproject.toml; they are now available via extras/dependency groups.
  • Adds lazy imports in verifiers/v1/clients/init.py so TrainClient is only imported on access, raising a clear ImportError if renderers is not installed.
  • Makes RendererConfig and TrainClient imports optional in verifiers/v1/clients/config.py, with TrainClient deferred to resolution time.
  • Adds fallback dataclass definitions for MultiModalData and PlaceholderRange in verifiers/v1/types.py when renderers is unavailable, with graph.py and trace.py updated to import from there.
  • Behavioral Change: installing the package no longer pulls in renderers or related packages by default; code paths that require them will raise ImportError at access time rather than import time.

Macroscope summarized 317e77d.

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 16, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 16, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Unresolved review comments identify potential bugs with the lockfile regeneration, TrainClient export behavior, and type compatibility when the renderers extra is installed. These substantive issues warrant human review.

You can customize Macroscope's approvability policy. Learn more.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be386c1d8f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pyproject.toml
Comment on lines +107 to +109
modal = [
"modal>=1.4.0",
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Regenerate uv.lock for the new extras

This change adds the modal extra and removes Modal/renderers from the base dependency set, but the tracked uv.lock still has modal, renderers, jinja2, textual, and regex under the base verifiers package and its provides-extras list still omits modal. In locked/frozen installs, uv sync --locked will continue installing the old heavy base dependencies, and verifiers[modal] is not represented in the lock, so the dependency isolation documented by this PR is defeated until the lockfile is regenerated.

Useful? React with 👍 / 👎.

@macroscopeapp macroscopeapp Bot dismissed their stale review June 16, 2026 11:30

Dismissing prior approval to re-evaluate 94ba449

Comment thread verifiers/v1/clients/config.py Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 94ba449bcd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 20 to 23
"TrainClientConfig",
"resolve_client",
"EvalClient",
"TrainClient",
]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the TrainClient package export

When verifiers[renderers] is installed, existing code that imports TrainClient from the package (from verifiers.v1.clients import TrainClient) now fails because this package no longer defines or lazily resolves that name. The dependency isolation only needs to avoid importing renderers during base imports; add a __getattr__/lazy export with the missing-extra error instead of dropping the public export entirely.

Useful? React with 👍 / 👎.

Comment thread verifiers/v1/clients/train.py Outdated
Comment on lines +117 to +126
MultiModalData(
mm_hashes=renderer_mmd.mm_hashes,
mm_placeholders={
modality: [
PlaceholderRange(offset=p.offset, length=p.length) for p in ranges
]
for modality, ranges in renderer_mmd.mm_placeholders.items()
},
mm_items=renderer_mmd.mm_items,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reuse renderer multimodal types when available

In runs that install verifiers[renderers], this conversion replaces the renderer's renderers.base.MultiModalData payload with the local fallback dataclass, so downstream training code that expects the renderer sidecar type or its methods no longer sees the original multimodal object. The fallback should only be used when renderers is absent; when the extra is installed, import and pass through the renderer's MultiModalData/PlaceholderRange types.

Useful? React with 👍 / 👎.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1ac2fb4. Configure here.

Comment thread verifiers/v1/clients/__init__.py Outdated
Comment thread pyproject.toml
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