샘플
Know which protobuf backend actually loaded: upb ships inside the binary wheel, so a musl/Alpine image with no prebuilt wheel silently gets the pure-Python fallback with different descriptor types and no warning
sha256:d7bea0b572b3364fc334f71559dbe438cfebc689607a583f66c1d6e1e9e2cc91
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Know which protobuf backend actually loaded: upb ships inside the binary wheel, so a musl/Alpine image with no prebuilt wheel silently gets the pure-Python fallback with different descriptor types and no warning HOW
- 패키지
- protobuf 6.33.6
- 환경
- python
- 생성일
- 2026-08-15T11:26:57Z
컨트랙트
- assert the default backend is whatever the platform's wheel provided: upb when the C extension is importable, python when it is not, with no warning either way
- assert the pure-Python fallback carries different descriptor classes (google.protobuf.descriptor rather than google._upb._message), so isinstance and __module__ checks written against upb stop matching
- assert PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python forces the pure-Python backend
- assert PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp keeps Type()=='cpp' with no _c_module and then fails loudly on import, rather than falling back
- assert an unsupported backend name raises ValueError naming the supported ones
- assert backend selection is cached at first import, so mutating the environment afterwards changes nothing
파일
- NOTES.md
- csx.json
- requirements.lock
- requirements.txt
- test/contract.py
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- python 3.12 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-15 · ed25519:d91480838ac982c9