Skip to content

Commit 4c76e4c

Browse files
Nuclear MarmaladeNuclear Marmalade
authored andcommitted
Fix CI lint failures — configure ruff rules for Python 3.9 compat
- Moved ruff select to [tool.ruff.lint] (new ruff config format) - Removed UP rule group (requires Python 3.10+ syntax, breaks 3.9) - Configured ignore list for style-preference rules (B904, SIM, etc.) - All 600 tests passing, ruff clean, mypy clean
1 parent a2ff09d commit 4c76e4c

34 files changed

Lines changed: 99 additions & 73 deletions

forge/cli.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,11 @@
3535
__version__ = "1.0.0"
3636

3737
# UI helpers (colors, progress bar, logging, messages) extracted to cli_helpers.py
38-
from forge.cli_helpers import ( # noqa: E402
39-
setup_logging, die, warn, info,
38+
from forge.cli_helpers import (
39+
die,
40+
info,
41+
setup_logging,
42+
warn,
4043
)
4144

4245
# Re-export color functions that read _COLOR_ENABLED from this module
@@ -481,8 +484,9 @@ def cmd_dashboard(args: argparse.Namespace) -> None:
481484
info(" Press Ctrl+C to stop.\n")
482485

483486
try:
484-
from forge.dashboard.app import app
485487
import uvicorn
488+
489+
from forge.dashboard.app import app
486490
uvicorn.run(app, host="127.0.0.1", port=port)
487491
except ImportError as e:
488492
die(

forge/cli_enrich.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from pathlib import Path
1818
from typing import Any
1919

20-
from forge.cli_helpers import die, warn, info, green, bold, dim
20+
from forge.cli_helpers import bold, die, dim, green, info, warn
2121

2222
try:
2323
from forge import __version__

forge/cli_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import time
1313
from typing import NoReturn, Optional
1414

15-
1615
# ---------------------------------------------------------------------------
1716
# ANSI color helpers
1817
# ---------------------------------------------------------------------------

forge/dashboard/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ def _init_enrichment(mode: str, workers: int) -> tuple:
173173

174174
def _run_enrichment_loop(db, mode: str, workers: int, total: int) -> None:
175175
"""Build the pipeline and run enrichment."""
176+
from forge.adapters.ollama import OllamaAdapter
176177
from forge.enrichment.pipeline import EnrichmentPipeline
177178
from forge.tools.database import DatabasePool
178-
from forge.adapters.ollama import OllamaAdapter
179179

180180
config = _get_config()
181181
pool = DatabasePool(db=db)

forge/db.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,16 @@
1919
logger = logging.getLogger("forge.db")
2020

2121
# Schema definitions and backend classes live in db_schema.py
22+
from forge.db_io import _ForgeDBIOMixin # noqa: E402
2223
from forge.db_schema import ( # noqa: E402
24+
BOOLEAN_COLUMNS,
2325
BUSINESS_COLUMNS,
2426
BUSINESS_INDEXES,
2527
ENRICHABLE_FIELDS,
2628
JSON_COLUMNS,
27-
BOOLEAN_COLUMNS,
28-
_SQLiteBackend,
2929
_PostgresBackend,
30+
_SQLiteBackend,
3031
)
31-
from forge.db_io import _ForgeDBIOMixin # noqa: E402
32-
3332

3433
# ── Main Interface ───────────────────────────────────────────────────────────
3534

@@ -744,4 +743,4 @@ def _prepare_value_for_write(self, column: str, value: Any) -> Any:
744743

745744

746745
# _Transaction class is in db_schema.py but imported here for internal use
747-
from forge.db_schema import _Transaction # noqa: E402, F811
746+
from forge.db_schema import _Transaction # noqa: E402

forge/db_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import logging
1313
import os
1414
import uuid
15-
from typing import Any, Dict, List, Optional, Sequence, TYPE_CHECKING
15+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence
1616

1717
from forge.db_schema import ENRICHABLE_FIELDS, JSON_COLUMNS
1818

forge/db_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ class _PostgresBackend:
192192
def __init__(self, host: str, port: int, user: str, password: str,
193193
dbname: str, min_connections: int = 2, max_connections: int = 10):
194194
import psycopg2
195-
import psycopg2.pool
196195
import psycopg2.extras
196+
import psycopg2.pool
197197
self._pool = psycopg2.pool.ThreadedConnectionPool(
198198
min_connections, max_connections,
199199
host=host, port=port, user=user, password=password,

forge/discovery/overture.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def _format_results(rows: list, columns: list) -> List[dict]:
281281
for row in rows:
282282
record = dict(zip(columns, row))
283283
raw_cat = record.get("category") or ""
284-
record["forge_industry"] = _CATEGORY_TO_INDUSTRY.get(raw_cat.lower(), None)
284+
record["forge_industry"] = _CATEGORY_TO_INDUSTRY.get(raw_cat.lower())
285285
results.append(record)
286286
return results
287287

forge/enrichment/pipeline.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
import asyncio
3737
import json
3838
import logging
39-
import time
4039
import threading
40+
import time
4141
from dataclasses import dataclass
4242
from typing import Any, Dict, List, Optional
4343

44-
from forge.tools.web_scraper import AsyncWebScraper
4544
from forge.core.output_parser import extract_json_from_response
45+
from forge.tools.web_scraper import AsyncWebScraper
4646

4747
logger = logging.getLogger("forge.enrichment")
4848

forge/enrichment/prompts.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
from typing import Dict
1616

17-
1817
# ── Industry whitelist ───────────────────────────────────────────────────────
1918

2019
INDUSTRY_LIST = (

0 commit comments

Comments
 (0)