샘플
pooch 1.9.0: pooch
검증된 샘플 — pypi pooch 1.9.0: pooch. python 3.12 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: pooch.__version__ exposes a valid release version string…
sha256:4670ba3b3ab4820df3fb0da3f7a30fee8e4470e6b44dde8d21769bb3198f83cf
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
python 3.12 linux 24 · ubuntu · glibc 2.39 x64 python 3.12 python pip
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| python 3.12 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1python:3.12-slim@sha256:09f7da3bc104… |
2026-09-05 |
케이스
HOW- 목표
- verify pooch in pkg:pypi/pooch@1.9.0
- 패키지
- 심벌
-
- pooch
- 환경
- python 3.12
- 생성일
- 2026-09-05T18:42:56Z
컨트랙트
- pooch.__version__ exposes a valid release version string matching the pinned package version.
- pooch.os_cache returns an operating-system specific cache directory as a pathlib.Path containing the provided application namespace.
- pooch.file_hash computes cryptographic checksums for local files using sha256 by default and supports alternative algorithms including md5.
- pooch.check_version validates PEP440 version strings and replaces unreleased development version strings with the designated fallback string.
- pooch.check_version raises packaging.version.InvalidVersion when given an invalid version string.
- pooch.get_logger returns the default pooch Logger instance and supports configuring logging levels.
- pooch.HTTPDownloader initializes with configurable download parameters including chunk size, progress bar display, and custom request headers.
- pooch.DOIDownloader initializes with configurable DOI download options including chunk size and request timeout.
파일
- NOTES.md
- PROMPT.md
- csx.json
- pyproject.toml
- requirements.txt
- spec.json
- test/contract.py
소스
# pooch Package Verification
This sample pins `pooch` 1.9.0 and verifies core module functions and classes.
The contract verifies:
- `pooch.__version__` exposes a valid release version string matching the pinned package version.
- `pooch.os_cache` returns an operating-system specific cache directory as a `pathlib.Path` containing the provided application namespace.
- `pooch.file_hash` computes cryptographic checksums for local files using sha256 by default and supports alternative algorithms including md5.
- `pooch.check_version` validates PEP440 version strings and replaces unreleased development version strings with the designated fallback string.
- `pooch.check_version` raises `packaging.version.InvalidVersion` when given an invalid version string.
- `pooch.get_logger` returns the default pooch `Logger` instance and supports configuring logging levels.
- `pooch.HTTPDownloader` initializes with configurable download parameters including chunk size, progress bar display, and custom request headers.
- `pooch.DOIDownloader` initializes with configurable DOI download options including chunk size and request timeout.
Clean-room public code sample — generation instructions
Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.
A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.
Goal: verify pooch in pkg:pypi/pooch@1.9.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:pypi/pooch@1.9.0
Demonstrate these symbols/APIs:
- pooch
Rules:
- One focused purpose; the smallest project that proves the goal.
- Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
- Pin every dependency with a lockfile so resolution is reproducible.
- No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
- No personal names, emails, company names, or project identifiers of any kind.
- No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
- Keep it under 200 files and 256KB packed.
{"case":{"caseId":"case:sha256:49db6dbea0cb0454336ef0746a19c90232f23ddc700f018bf5f845e0e71a82ab","contract":["pooch.__version__ exposes a valid release version string matching the pinned package version.","pooch.os_cache returns an operating-system specific cache directory as a pathlib.Path containing the provided application namespace.","pooch.file_hash computes cryptographic checksums for local files using sha256 by default and supports alternative algorithms including md5.","pooch.check_version validates PEP440 version strings and replaces unreleased development version strings with the designated fallback string.","pooch.check_version raises packaging.version.InvalidVersion when given an invalid version string.","pooch.get_logger returns the default pooch Logger instance and supports configuring logging levels.","pooch.HTTPDownloader initializes with configurable download parameters including chunk size, progress bar display, and custom request headers.","pooch.DOIDownloader initializes with configurable DOI download options including chunk size and request timeout."],"goal":"verify pooch in pkg:pypi/pooch@1.9.0","kind":"HOW","packages":["pkg:pypi/pooch@1.9.0"],"schemaVersion":1,"symbols":["pooch"]},"contractCommand":["python","test/contract.py"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"pypi","executionContext":"python","language":"python","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"pip","runtime":"python","runtimeVersion":"3.12","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/pooch@1.9.0"],"schemaVersion":1,"subject":"pkg:pypi/pooch@1.9.0","symbols":["pooch"],"verifierAdapter":"python@1"}
[project]
name = "sample-pooch"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
"pooch==1.9.0",
]
certifi==2026.7.22
charset-normalizer==3.5.1
idna==3.19
packaging==26.3
platformdirs==4.11.7
pooch==1.9.0
requests==2.34.2
urllib3==2.7.0
{
"schemaVersion": 1,
"goal": "verify pooch in pkg:pypi/pooch@1.9.0",
"kind": "HOW",
"packages": [
"pkg:pypi/pooch@1.9.0"
],
"symbols": [
"pooch"
]
}
import hashlib
import logging
import pathlib
import tempfile
import packaging.version
import pooch
# 1. Verify pooch.__version__
assert hasattr(pooch, "__version__"), "pooch module should export __version__"
assert "1.9.0" in pooch.__version__, f"Unexpected version string: {pooch.__version__}"
# 2. Verify pooch.os_cache
cache_path = pooch.os_cache("sample-app")
assert isinstance(cache_path, pathlib.Path), "os_cache must return a pathlib.Path"
assert "sample-app" in str(cache_path), f"os_cache path should contain project name: {cache_path}"
# 3. Verify pooch.file_hash
with tempfile.TemporaryDirectory() as tmpdir:
test_file = pathlib.Path(tmpdir) / "test_data.bin"
test_bytes = b"CodeSampleX offline verification payload"
test_file.write_bytes(test_bytes)
# Default algorithm (sha256)
sha256_hash = pooch.file_hash(str(test_file))
expected_sha256 = hashlib.sha256(test_bytes).hexdigest()
assert sha256_hash == expected_sha256, f"sha256 mismatch: {sha256_hash} != {expected_sha256}"
# Custom algorithm (md5)
md5_hash = pooch.file_hash(str(test_file), alg="md5")
expected_md5 = hashlib.md5(test_bytes).hexdigest()
assert md5_hash == expected_md5, f"md5 mismatch: {md5_hash} != {expected_md5}"
# 4. Verify pooch.check_version with PEP440 compliant and dev versions
v_clean = pooch.check_version("1.9.0")
assert v_clean == "1.9.0", f"Expected '1.9.0', got {v_clean}"
v_dev = pooch.check_version("1.9.0+dev.123", fallback="main")
assert v_dev == "main", f"Expected fallback 'main', got {v_dev}"
# 5. Verify pooch.check_version raises InvalidVersion on malformed versions
try:
pooch.check_version("invalid_format_version!!!")
raise AssertionError("pooch.check_version should raise InvalidVersion on invalid input")
except packaging.version.InvalidVersion:
pass
# 6. Verify pooch.get_logger
logger = pooch.get_logger()
assert isinstance(logger, logging.Logger), "get_logger must return a logging.Logger"
assert logger.name == "pooch", f"Logger name must be 'pooch', got {logger.name}"
orig_level = logger.level
try:
logger.setLevel(logging.INFO)
assert logger.level == logging.INFO, "Logger level should be updated"
finally:
logger.setLevel(orig_level)
# 7. Verify pooch.HTTPDownloader
http_downloader = pooch.HTTPDownloader(chunk_size=4096, progressbar=False, headers={"User-Agent": "sample-agent"})
assert http_downloader.chunk_size == 4096, f"Expected chunk_size 4096, got {http_downloader.chunk_size}"
assert http_downloader.progressbar is False, "Expected progressbar False"
assert http_downloader.kwargs == {"headers": {"User-Agent": "sample-agent"}}, "kwargs mismatch"
# 8. Verify pooch.DOIDownloader
doi_downloader = pooch.DOIDownloader(chunk_size=8192, progressbar=False, timeout=60)
assert doi_downloader.chunk_size == 8192, f"Expected chunk_size 8192, got {doi_downloader.chunk_size}"
assert doi_downloader.progressbar is False, "Expected progressbar False"
assert doi_downloader.timeout == 60, f"Expected timeout 60, got {doi_downloader.timeout}"
print("CONTRACT PASS: pooch verified offline")
오리진 시더
익명