Move shared Rich console to olmo_eval.common.console to break import cycle#160
Merged
Conversation
…cycle Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…e Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the shared Rich
consolesingleton fromolmo_eval.cli.utilsto a newolmo_eval.common.consolemodule so non-CLI modules don't pull the entireclipackage into their import graph.The cycle this prevents
When a module under
olmo_eval.harness.sandboxis imported at module level — asfinbarr/prebuild-sandbox(#159) does inscicode/eval.py— the chain is:The fix is to relocate
consoleto a leaf module that imports nothing fromcli/harness/runners.cli.utilsre-exports it so existing CLI imports are unchanged.Files
src/olmo_eval/common/console.py— new file, justconsole = Console(force_terminal=True, width=120).src/olmo_eval/cli/utils.py— re-exports fromcommon.console; CLI callers unchanged.src/olmo_eval/runners/io/storage.py— switches tocommon.console. This is the actual cycle break.src/olmo_eval/runners/common/mixins.py— same swap.src/olmo_eval/common/inspection.py— replaces 7 lazyfrom olmo_eval.cli.utils import console as shared_consolelines inside functions with one top-level import (keeps imports at top of file).Why standalone
Split out from #159 for independent review. The fix applies cleanly to
mainand is a no-op for any current import path; it's preemptive infrastructure for #159.Verification
uv run pytest tests/ -q— 1336 passed, 22 skipped.make lint— clean.