CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-cognitiveservices-search-nspkg

Microsoft Azure Cognitive Services Search Namespace Package for Python 2/3 compatibility

64

1.25x

Quality

Pending

Does it follow best practices?

Impact

64%

1.25x

Average score across 6 eval scenarios

Overview
Eval results
Files

task.mdevals/scenario-4/

Search Namespace Health Check

Create a small diagnostic utility that inspects the Azure Cognitive Services Search namespace and reports its readiness when only the namespace placeholder package is installed (no runtime search clients are present).

Capabilities

Report namespace availability

  • With only the namespace package installed and no search clients, running the CLI prints JSON showing namespace_present: true and clients: []. @test
  • If the namespace cannot be imported because the dependency is missing, the CLI exits with a non-zero status and emits a clear error message to stderr. @test

Detect installed search clients

  • The CLI reports any installed modules under the search namespace as a sorted list of dotted names (e.g., azure.cognitiveservices.search.imagesearch) in the clients field. @test

Warn on legacy conflicts

  • When a legacy monolithic azure 0.x package is installed, the tool includes a human-readable warning advising users to uninstall it before using search SDKs. @test

Provide version context

  • The JSON output includes the running Python major.minor version in a python_version field to explain why the namespace may be empty on newer interpreters. @test

Implementation

@generates

API

from typing import Any, Dict, List, Optional

def detect_namespace() -> bool:
    """Return True if the search namespace can be imported without errors."""

def find_search_clients() -> List[str]:
    """Return sorted dotted module names discovered under the search namespace."""

def legacy_conflict_warning() -> str:
    """Return a warning message when a legacy azure 0.x package is installed, else an empty string."""

def build_report() -> Dict[str, Any]:
    """
    Return a dictionary containing:
    - namespace_present: bool
    - clients: List[str]
    - legacy_conflict: str
    - python_version: str
    """

def main(argv: Optional[List[str]] = None) -> int:
    """Write the report as JSON to stdout, emit errors to stderr, and return an exit status."""

Dependencies { .dependencies }

azure-cognitiveservices-search-nspkg { .dependency }

Provides the search namespace placeholder needed for discovery and compatibility checks.

Install with Tessl CLI

npx tessl i tessl/pypi-azure-cognitiveservices-search-nspkg

tile.json