Skip to content

Commit 5274ab5

Browse files
committed
fix: remove CI script and fix circular import in abs_encoder
Remove scripts/check_circular_imports.py and its Makefile references per reviewer consensus. Move get_task import in abs_encoder.py to function-level to break the circular import chain: mteb.abstasks → abstask → mteb.models → abs_encoder → get_tasks → mteb.abstasks
1 parent 62a5e85 commit 5274ab5

File tree

3 files changed

+4
-153
lines changed

3 files changed

+4
-153
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ lint:
1212
uv run --no-sync ruff format . # running ruff formatting
1313
uv run --no-sync ruff check . --fix --exit-non-zero-on-fix # running ruff linting # --exit-non-zero-on-fix is used for the pre-commit hook to work
1414
uv run --no-sync typos
15-
uv run --no-sync python scripts/check_circular_imports.py
1615

1716
lint-check:
1817
@echo "--- 🧹 Check is project is linted ---"
1918
# Required for CI to work, otherwise it will just pass
2019
uv run --no-sync ruff format . --check
2120
uv run --no-sync ruff check .
2221
uv run --no-sync typos --diff
23-
uv run --no-sync python scripts/check_circular_imports.py
2422

2523
test:
2624
@echo "--- 🧪 Running tests ---"

mteb/models/abs_encoder.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from typing import TYPE_CHECKING, Any, Literal, cast, get_args, overload
77

88
from mteb.abstasks.task_metadata import TaskType
9-
from mteb.get_tasks import get_task
109
from mteb.similarity_functions import (
1110
cos_sim,
1211
dot_score,
@@ -166,6 +165,8 @@ def validate_task_to_prompt_name(
166165

167166
if task_name not in task_types and task_name not in prompt_types:
168167
try:
168+
from mteb.get_tasks import get_task
169+
169170
get_task(task_name=task_name)
170171
except KeyError:
171172
msg = f"Task name {task_name} is not valid. {valid_keys_msg}"
@@ -224,6 +225,8 @@ def get_instruction(
224225
if prompt:
225226
return prompt
226227

228+
from mteb.get_tasks import get_task
229+
227230
abstask = get_task(task_name=task_metadata.name)
228231
return abstask.abstask_prompt
229232

scripts/check_circular_imports.py

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)