Type stubs for chardet - Universal encoding detector for Python
Agent Success
Agent success rate when using this tile
65%
Improvement
Agent success rate improvement when using this tile compared to baseline
0.97x
Baseline
Agent success rate without this tile
67%
Compute the full external requirement list for a stub distribution by walking its declared dependencies and their nested stubs using repository metadata.
@generates
Given a repository root containing stubs/<distribution>/METADATA.toml, derive all external requirements and dependent stub distributions for a requested stub, expanding through nested stub dependencies and optional extras. Deduplicate results and return them in a deterministic, sorted-by-string order; missing metadata raises a clear error.
stubs/simple/METADATA.toml lists requires = ["requests>=2"], resolve_stub_requirements("simple", root) returns ["requests>=2"]. @testdemo depends on stub types-foo plus pytest; types-foo depends on stub types-bar plus httpx. Expect ["pytest", "httpx"] from resolve_stub_requirements("demo", root) because types-bar has no extra external deps beyond what types-foo contributes. @testfeatureful declares base requirement ["numpy"], extra postgres adding stub types-psycopg2 and external psycopg2-binary, and types-psycopg2 depends on typing-extensions. Calling resolve_stub_requirements("featureful", root, extras=["postgres"]) returns ["numpy", "psycopg2-binary", "typing-extensions"]; calling without extras omits the extra-only requirements. @testfrom pathlib import Path
from typing import Iterable, Sequence
def resolve_stub_requirements(distribution: str, root: Path, extras: Iterable[str] | None = None) -> Sequence[str]:
"""
Build the deterministically ordered, deduplicated list of requirement strings for a stub distribution.
distribution: stub distribution name that has a metadata directory under root/stubs.
root: repository root containing stubs metadata files.
extras: optional extras to include; when None, include only base requirements.
Returns requirement strings for external packages pulled from the target stub and all recursively required stubs, sorted by requirement string.
Raises a KeyError when metadata for distribution is missing.
"""Provides helpers for reading stub metadata and resolving dependency graphs across stubs. @satisfied-by
tessl i tessl/pypi-types-chardet@4.0.0docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9