Ejemplo
Demonstrate that SpecifierSet.contains excludes semantically matching pre-releases by default.
sha256:3808772890fedf57c4befd649f16e9078db6809d220103615d71d5ea553d4f50
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Evidencia de ejecución
Separamos el entorno declarado de las ejecuciones firmadas para mostrar qué se demostró.
Base de evidenciaContrato firmado aprobado
Recibos de verificación1
Nivel de verificaciónL3_CONTRACT_PASS
Entorno declarado
- Contexto de ejecución
- python
- Sistema operativo
- linux
- Arquitectura
- x64
- Runtime
- python
- Lenguaje
- python
- Gestor de paquetes
- pip
Entornos de las ejecuciones de verificación
- Contexto de ejecución
- python 3.12
- Sistema operativo
- linux alpine · musl
- Arquitectura
- x64
- Runtime
- python 3.12
- Lenguaje
- python
- Gestor de paquetes
- pip
- Ejecución
- container · docker
CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17
Caso
- Objetivo
- Demonstrate that SpecifierSet.contains excludes semantically matching pre-releases by default. HOW
- Paquetes
-
packaging 24.1
- Entorno
- python
- Creado
- 2026-08-17T18:59:12Z
Lo que suele suponerse
a pre-release like 2.1a1 is contained in the range >=2.0 because it evaluates as strictly greater than 2.0
El autor de la muestra anotó aquí lo que un desarrollador o un modelo esperaría. El contrato de abajo es lo que realmente se ejecutó.
Contrato
- SpecifierSet('>=2.0').contains('2.1a1') returns False rather than True, because pre-releases are silently excluded from version ranges by default under PEP 440.
- assert Version('2.1a1') > Version('2.0')
- assert not SpecifierSet('>=2.0').contains('2.1a1')
- assert SpecifierSet('>=2.0').contains('2.1a1', prereleases=True)
Archivos
- NOTES.md
- contract.py
- csx.json
- requirements.txt
Descargar el artefacto de código fuente (tar.gz)
Seeder de origen
csx-seed
Recibos de verificación
- python 3.12 · linux alpine/x64 · docker · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · python@1 · 2026-08-17 · ed25519:d91480838ac982c9