Bumpcheck
Catch Pydantic runtime behavior changes before a dependency bump.
Bumpcheck runs one small application contract in two isolated Python environments and compares what users can observe: returned JSON, Pydantic validation errors, warnings, and captured output.
Quickstart
Install uv, then install Bumpcheck:
uv tool install bumpcheck
Create contract.py:
from collections.abc import Mapping
from typing import Annotated
from pydantic import BaseModel, ConfigDict, Field
MetadataKey = Annotated[str, Field(max_length=3)]
class Model(BaseModel):
model_config = ConfigDict(strict=True)
metadata: Mapping[MetadataKey, str]
def run():
return Model(metadata={"toolong": "b"}).model_dump(mode="json")
Run it against two versions:
$ bumpcheck check contract.py \
--baseline pydantic==2.10.6 \
--candidate pydantic==2.11.1 \
--python-version 3.12
BASELINE pydantic=2.10.6 @ .../pydantic/__init__.py
CANDIDATE pydantic=2.11.1 @ .../pydantic/__init__.py
CHANGED contract: ValidationError[string_too_long] -> return {"metadata":{"toolong":"b"}}
Exit code 0 means unchanged, 1 means behavior changed, and 2 means the capture was not trustworthy. This makes the command usable as a CI gate.
GitHub Actions
Run Bumpcheck from PyPI and install the checkout into both comparison environments:
jobs:
bumpcheck:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
with:
enable-cache: true
python-version: "3.12"
version: 0.12.5
- run: |
uvx --from bumpcheck==0.2.0 \
bumpcheck check contract.py \
--baseline pydantic==2.10.6 \
--candidate pydantic==2.11.1 \
--with . \
--python-version 3.12
Tracewright's Pydantic compatibility job uses this pattern to replay four JSON Lines fixture inputs against two Pydantic versions.
Check your application
A contract is a normal Python file exposing either run() or run(value).
Return a JSON-compatible value that represents the behavior your application
depends on.
Use --with . to install the current project into both isolated environments:
bumpcheck check contract.py \
--baseline pydantic==2.10.6 \
--candidate pydantic==2.11.1 \
--with .
Repeat --with for shared dependencies. Use --watch DIST[:MODULE] to add to
the default pydantic and pydantic-core provenance. Use --only-watch
instead when the named distributions should replace those defaults.
For example, the issue-derived integration suite detects the
Path / Path fix in Monty:
bumpcheck check examples/regressions/monty_path_join.py \
--baseline pydantic-monty==0.0.19 \
--candidate pydantic-monty==0.0.20 \
--only-watch pydantic-monty:pydantic_monty
For real payloads, define run(value) and pass --inputs. Bumpcheck accepts a
JSON array, .jsonl or .ndjson, or a Pydantic Evals JSON document containing
a cases array. It preserves case names or JSON Lines source line numbers and
hashes the case and input bytes before comparing results.
If environments already exist, use --baseline-python and
--candidate-python instead of requirement targets. Use --json for a
machine-readable report and --exact when warning messages, exception messages,
stdout, and stderr must also match.
Scope and limits
Bumpcheck is a focused pre-upgrade gate, not a test runner or an API/schema diff. It is useful for data-dependent validation and serialization behavior that ordinary dependency tooling does not observe.
Cases are trusted code. The subprocess boundary enforces a timeout but is not a security sandbox. Receipts contain local interpreter and module paths, so review JSON output before sharing it. Imported project files are not hashed; run from an immutable revision when they are part of the contract.
Migration
Bumpcheck was previously named Pydantic Canary. The bumpcheck distribution
installs a temporary pydantic-canary command alias, but new code should import
bumpcheck and use the bumpcheck command.
Development
uv run --isolated --no-project --no-config --no-cache --with . -- \
python -B -m unittest discover -s tests -v
uv run --isolated --no-project --no-config --with ruff==0.16.4 -- ruff check .
uv build
Metadata
Release files for bumpcheck 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bumpcheck-0.2.1.tar.gz | 22.0 kB | With provenance | Details for bumpcheck-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bumpcheck-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for bumpcheck-0.2.1-py3-none-any.whl |
Total release size: 36.0 kB
Release files / bumpcheck-0.2.1.tar.gz
| Download URL | bumpcheck-0.2.1.tar.gz |
|---|---|
| Size | 22.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac4c465e1976fc42c3df1ffe1d07b2f5f8089d53fa21c42192e7c8001f3f3e51
|
|
BLAKE2b-256 checksum How to use checksums |
20ceb0d82b58f778f506ed95209420de8903c3a0df6d3a858a4f05ea4ec1af60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logRelease files / bumpcheck-0.2.1-py3-none-any.whl
| Download URL | bumpcheck-0.2.1-py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88da7c0631ad5782d2beba7d6d67da8887648bcaf6b1ceecdf3bd45ee0f435fb
|
|
BLAKE2b-256 checksum How to use checksums |
9913ccc7acd70af37c2e2777c60443c90d91f43484203886ceac35e19592a0e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logSecurity for bumpcheck 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for bumpcheck-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.