샘플
fastapi 0.141.1: __version__
검증된 샘플 — pypi fastapi 0.141.1: __version__. python 3.12 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: fastapi.__version__ is accessible as a top-level…
sha256:8db5e7649755ae9e2b41a117d0e8305a4b516d56ac2b74d9699865d057f8e7b4
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
python linux 24 · ubuntu · glibc 2.39 x64 python python pip
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| python 3.12 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · python@1python:3.12-alpine@sha256:d09d15e60962… |
2026-08-28 |
케이스
HOW- 목표
- verify fastapi.__version__ in pkg:pypi/fastapi@0.141.1
- 패키지
- 심벌
-
- fastapi.__version__
- 환경
- python
- 생성일
- 2026-08-28T04:20:23Z
컨트랙트
- fastapi.__version__ is accessible as a top-level module attribute and exportable via 'from fastapi import __version__'.
- fastapi.__version__ is a string exactly equal to '0.141.1' matching the pinned distribution version.
- fastapi.__version__ adheres to semantic versioning format with major=0, minor=141, patch=1 parseable into integer components.
- fastapi.__version__ matches the installed distribution metadata version reported by importlib.metadata.version('fastapi').
파일
- NOTES.md
- PROMPT.md
- csx.json
- requirements.txt
- spec.json
- test/contract.py
소스
# FastAPI Version Verification
This sample verifies `fastapi.__version__` in `fastapi` 0.141.1.
The contract verifies:
- `fastapi.__version__` is exposed as a module attribute and matches `from fastapi import __version__`.
- `fastapi.__version__` is a string equal to `"0.141.1"`.
- `fastapi.__version__` satisfies semantic version format (`0.141.1`) and parses into `(0, 141, 1)`.
- `fastapi.__version__` matches the package version from `importlib.metadata.version("fastapi")`.
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 fastapi.__version__ in pkg:pypi/fastapi@0.141.1
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:pypi/fastapi@0.141.1
Demonstrate these symbols/APIs:
- fastapi.__version__
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:a81164946177208fe6e609ae75e6832f2adf670dc1c953ad360e1dc3f2714592","contract":["fastapi.__version__ is accessible as a top-level module attribute and exportable via 'from fastapi import __version__'.","fastapi.__version__ is a string exactly equal to '0.141.1' matching the pinned distribution version.","fastapi.__version__ adheres to semantic versioning format with major=0, minor=141, patch=1 parseable into integer components.","fastapi.__version__ matches the installed distribution metadata version reported by importlib.metadata.version('fastapi')."],"goal":"verify fastapi.__version__ in pkg:pypi/fastapi@0.141.1","kind":"HOW","packages":["pkg:pypi/fastapi@0.141.1"],"schemaVersion":1,"symbols":["fastapi.__version__"]},"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","schemaVersion":1},"license":"MIT-0","packages":["pkg:pypi/fastapi@0.141.1"],"schemaVersion":1,"subject":"pkg:pypi/fastapi@0.141.1","symbols":["fastapi.__version__"],"verifierAdapter":"python@1"}
fastapi==0.141.1
starlette==1.6.0
annotated-doc==0.0.5
pydantic==2.13.4
pydantic-core==2.46.4
typing-extensions==4.16.0
typing-inspection==0.4.4
annotated-types==0.8.0
anyio==4.14.2
idna==3.18
{
"schemaVersion": 1,
"goal": "verify fastapi.__version__ in pkg:pypi/fastapi@0.141.1",
"kind": "HOW",
"packages": [
"pkg:pypi/fastapi@0.141.1"
],
"symbols": [
"fastapi.__version__"
]
}
import importlib.metadata
import re
import fastapi
from fastapi import __version__
# 1. Verify fastapi.__version__ is accessible and matches the imported __version__ symbol
assert hasattr(fastapi, "__version__"), "fastapi module must expose __version__"
assert isinstance(fastapi.__version__, str), f"Expected str for __version__, got {type(fastapi.__version__)}"
assert fastapi.__version__ is __version__, "__version__ imported directly must be identical to fastapi.__version__"
# 2. Verify fastapi.__version__ matches the exact pinned version "0.141.1"
assert fastapi.__version__ == "0.141.1", f"Expected version '0.141.1', got '{fastapi.__version__}'"
# 3. Verify semantic versioning format and integer component parsing
match = re.match(r"^(\d+)\.(\d+)\.(\d+)$", fastapi.__version__)
assert match is not None, f"Version '{fastapi.__version__}' does not match SemVer pattern"
major, minor, patch = map(int, match.groups())
assert major == 0, f"Expected major 0, got {major}"
assert minor == 141, f"Expected minor 141, got {minor}"
assert patch == 1, f"Expected patch 1, got {patch}"
# 4. Verify consistency with importlib.metadata distribution version
dist_version = importlib.metadata.version("fastapi")
assert fastapi.__version__ == dist_version, (
f"Module version '{fastapi.__version__}' does not match package metadata '{dist_version}'"
)
print(f"CONTRACT PASS: fastapi.__version__ == {fastapi.__version__} verified offline")
오리진 시더
익명