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-3/

Cross-Version Search Namespace Prep

A tiny helper that prepares the Azure Cognitive Services Search namespace so downstream search client packages import correctly on both Python 2 and Python 3.

Capabilities

Prepare namespace on Python 2

  • When the interpreter major version is 2, calling prepare_namespace() loads the search namespace package, returns True, and ensures imports under azure.cognitiveservices.search succeed without raising an ImportError. @test

Skip prep on Python 3+

  • When the interpreter major version is 3 or higher, prepare_namespace() performs no namespace package import, returns False, and signals that no preparation was needed. @test

Idempotent calls

  • Calling prepare_namespace() more than once does not duplicate namespace paths or repeat side effects, while returning the same boolean result on subsequent calls. @test

Availability probing

  • namespace_available() reports whether imports under azure.cognitiveservices.search currently resolve, never bubbling up import errors. @test

Implementation

@generates

API

def prepare_namespace() -> bool:
    """Prepares the search namespace for the current interpreter version and returns whether a namespace package import was performed."""

def namespace_available() -> bool:
    """Returns True when imports under azure.cognitiveservices.search resolve after any necessary preparation."""

Dependencies { .dependencies }

azure-cognitiveservices-search-nspkg { .dependency }

Provides the version-conditional namespace package for Azure Cognitive Services Search, ensuring namespace path extension where needed.

Install with Tessl CLI

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

tile.json