Commit c15e4b63 authored by Jan Reimes's avatar Jan Reimes
Browse files

refactor(cli,config): remove unused CLI args and utility functions

Remove unused CLI options (OverallTimeoutOption, SpecOption, ProcessTDocIdOption,
CheckoutPathOption), unused ConfigService.crawl_limits, and fix TDocQueryConfig
parameter name from target_ids to tdoc_ids.
parent 4483b101
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ def checkout(

    manager = CacheManager(cache_dir).register()
    normalized_ids = [tid.strip().upper() for tid in tdoc_ids]
    config = TDocQueryConfig(target_ids=normalized_ids)
    config = TDocQueryConfig(tdoc_ids=normalized_ids)

    with create_cached_session() as session:
        with TDocDatabase(manager.db_file) as database:
+4 −4
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ IncrementalOption = Annotated[
]
LimitTDocsOption = Annotated[int | None, typer.Option("--limit-tdocs", help="Limit number of TDocs", envvar="TDC_LIMIT_TDOCS")]
ClearTDocsOption = Annotated[bool, typer.Option("--clear-tdocs", help="Clear all TDocs before crawling")]
OverallTimeoutOption = Annotated[
_ = Annotated[
    int | None,
    typer.Option("--overall-timeout", help="Maximum total crawl duration in seconds (None = unlimited)", envvar="TDC_OVERALL_TIMEOUT"),
]
@@ -99,7 +99,7 @@ AgendaPatternExcludeOption = Annotated[
ClearSpecsOption = Annotated[bool, typer.Option("--clear-specs", help="Clear all specs before crawling")]
TitleOption = Annotated[str | None, typer.Option("--title", help="Filter by title contains")]
StatusOption = Annotated[str | None, typer.Option("--status", help="Filter by status")]
SpecOption = Annotated[list[str] | None, typer.Option("--spec", help="Spec number(s) (dotted or undotted)")]
_ = Annotated[list[str] | None, typer.Option("--spec", help="Spec number(s) (dotted or undotted)")]

SpecFileOption = Annotated[Path | None, typer.Option("--spec-file", help="File with spec numbers")]
ReleaseOption = Annotated[
@@ -169,7 +169,7 @@ QueryOption = Annotated[str | None, typer.Option("--query", help="Semantic searc
WorkspaceNameOption = Annotated[str | None, typer.Option("--workspace", "-w", help="Workspace name")]
EmbeddingTopKOption = Annotated[int, typer.Option("--top-k", "-k", help="Number of embedding results to return")]

ProcessTDocIdOption = Annotated[str | None, typer.Option("--tdoc-id", "-t", help="TDoc ID to process")]
_ = Annotated[str | None, typer.Option("--tdoc-id", "-t", help="TDoc ID to process")]
EmbeddingBackendOption = Annotated[
    Literal["torch", "onnx", "openvino"],
    typer.Option(
@@ -179,7 +179,7 @@ EmbeddingBackendOption = Annotated[
        envvar="TDC_AI_EMBEDDING_BACKEND",
    ),
]
CheckoutPathOption = Annotated[str | None, typer.Option("--checkout-path", help="Path to checkout document")]
_ = Annotated[str | None, typer.Option("--checkout-path", help="Path to checkout document")]
CheckoutBaseOption = Annotated[str | None, typer.Option("--checkout-base", help="Base path for checkout")]
ProcessAllOption = Annotated[bool, typer.Option("--all", help="Process all documents in workspace")]
ProcessNewOnlyOption = Annotated[bool, typer.Option("--new-only", help="Process only new documents")]
+1 −1
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ import typer

from tdoc_crawler.logging import get_console, get_logger

console = get_console()
_ = get_console()
logger = get_logger(__name__)


+0 −11
Original line number Diff line number Diff line
@@ -76,17 +76,6 @@ class ConfigService:
            self._http_cache = HttpCacheConfig.resolve_http_cache_config(cache_file=self.cache_manager.http_cache_file)
        return self._http_cache

    @property
    def crawl_limits(self) -> CrawlLimits:
        """Return crawl limits with all limits unset (use CLI overrides as needed).

        Returns:
            CrawlLimits instance with no restrictions applied.
        """
        if self._crawl_limits is None:
            self._crawl_limits = CrawlLimits()
        return self._crawl_limits

    @classmethod
    def from_env(cls, cache_manager_name: str | None = None) -> ConfigService:
        """Create ConfigService loading settings from environment variables.
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ from tdoc_crawler.logging import get_logger
from tdoc_crawler.models import HttpCacheConfig
from tdoc_crawler.tdocs.sources.doclist import fetch_meeting_document_list

logger = get_logger(__name__)
_ = get_logger(__name__)


def fetch_meeting_document_list_subinterpreter(