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%
Build a helper module to gather stubtest inputs and configuration for a typeshed-style repository while respecting repository ignore rules and cross-platform temporary file behavior.
.gitignore that excludes a subdirectory, test discovery skips that ignored directory even if it contains test cases. @testtest_cases directories, it returns entries in order with stdlib first followed by alphabetical distributions, each including the resolved test_cases path. @testtest_cases directory, discovery raises an error instead of silently ignoring it. @test--allowlist <path> for each existing allowlist in priority order for the current platform and Python version. @test@generates
from __future__ import annotations
from contextlib import contextmanager
from dataclasses import dataclass
from pathlib import Path
from typing import Iterable, Iterator
@dataclass(frozen=True)
class DistributionTests:
name: str
test_cases_path: Path
def discover_test_cases(base_path: Path) -> list[DistributionTests]:
"""Return stdlib first then third-party distributions with non-empty test_cases directories, skipping gitignored paths."""
def build_allowlist_args(distribution_name: str, base_path: Path) -> list[str]:
"""Return stubtest allowlist CLI arguments for the distribution based on existing allowlist files."""
@contextmanager
def temporary_config(lines: Iterable[str]) -> Iterator[Path]:
"""Yield the path to a temp config file containing the lines, ensuring the file remains usable cross-platform until cleanup."""Provides cross-platform temporary files, gitignore parsing, and stubtest discovery helpers for a typeshed-style repository.
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