Dependabot opens a PR, CI is green (or red for some boring reason), you merge, and two days later
something you never tested throws AttributeError. I wanted to know how often that actually
happens, so I went looking for it in public repos.
Short version: most bumps are fine, even major ones. When a bump did break something, the break
was almost never in the project's own code, and CI showed it in only 1 of the 4 cases I found.
How I checked
I wrote pipbreak for this. It reads the code of
every installed package and checks each call one package makes into another against the versions
actually installed. On a bump PR it runs twice, on the environment before the bump and after it,
and reports only what's new.
For each PR, in a locked-down Docker sandbox:
- Check out the PR and its parent commit.
- Install each side's dependencies (wheels only, no network during the check).
- Run pipbreak on both, keep findings that only appear after the bump and mention the bumped library.
- Read every finding by hand, and reproduce the ones that look real.
I did this twice: in October on 40 bump PRs for 8 libraries (Werkzeug, SQLAlchemy, numpy, pydantic,
marshmallow, pandas, httpx, openai), and in November on 53 still-open PRs across 21 libraries.
Most PRs can't even be reproduced
Before any results, the unglamorous part: of 93 PRs, I could only rebuild both environments for 37.
The rest had dependencies spread across a monorepo, only in a lock file my installer didn't read,
with no wheel for the Python version, or (in October, where I only kept major bumps) the "bump"
was a patch release the search swept up. A few had a new side that simply failed to resolve, like
tensorflow==2.10 on Python 3.12. My harness first
counted those as "checked", and pipbreak duly reported half the environment as missing. That was
my bug, not a finding.
So whatever you take from the numbers below, it's 37 PRs, not 93.
What broke
Across the 37, four bumps break code that would run:
| PR | Bump | What breaks | Did CI show it? |
|---|---|---|---|
| IBM/ada#17 | Werkzeug 2.2 → 3.1 | Flask 2.2 reads werkzeug.__version__, which Werkzeug 3 removed | Yes, the test failed on that exact line |
| Septem151/gifsync#61 | Werkzeug 2.2 → 3.1 | Flask, Flask-Login and Flask-WTF import url_quote, url_parse, url_encode... 10 calls; the app can't even be imported | No, CI failed earlier on a deprecated GitHub Action |
| Azure/containerization-assist#803 | Werkzeug 2.3 → 3.1 | Flask's werkzeug.__version__ again, in a fixture app | No, CI passed; it never runs that app |
| andreroggeri/pynubank#510 | pyOpenSSL 23.2 → 26.4 | OpenSSL.crypto.PKCS12(), removed in pyOpenSSL 24.1 | No, CI died on actions/cache@v2 before running tests |
Three things stand out.
The break is usually in someone else's package. Only pynubank's break was in its own code.
The other three were in Flask and its extensions. Flask 2.2 declares Werkzeug>=2.2.2, so pip
installs Werkzeug 3 without complaint, pip check stays green, and the first sign of trouble is
a traceback from a file you didn't write.
A red CI is as good as no CI. Two of the four had failing CI, but for an unrelated reason
(an outdated action) that stopped the job before a single test ran. If you're used to bump PRs
failing for boring reasons, you'll assume this one did too.
Green CI only covers what your tests run. containerization-assist's CI passed because nothing
ran the app that breaks.
What didn't break
In the other 33, pipbreak found no new break in code that runs, including plenty of big jumps:
Flask 2 → 3 (twice), Django 4.2 → 6.1, urllib3 1 → 2, numpy 1 → 2, pandas 2 → 3,
marshmallow 3 → 4, protobuf 5 → 7, setuptools 70 → 84. The closest call was SQLAlchemy 1.4 → 2.1
in closeio/sync-engine: it breaks alembic's testing helpers, which the app itself doesn't import,
and turns 56 calls in the project into deprecation warnings. Library maintainers mostly do a good
job; a major version usually means "something changed", not "your code breaks".
Of the 27 open PRs I could check, 8 had red CI. pipbreak found an API break in exactly one of them.
I didn't diagnose the rest this time; in October, where I did, the failures were resolver
conflicts, a type checker and CI configuration, things pip and your CI logs already tell you.
What looked like a break but wasn't
One false lead is worth telling. On microsoft/discovery's numpy 2 bump, pipbreak flagged
return np.float_ in plotly 7.1.0, the version the PR pins. np.float_ really was removed in numpy 2,
and the line really is there. But plotly only ever calls that helper with out_range=np.uint8,
which returns before that line. Dead code, not a break.
I sent plotly a one-line fix anyway. They asked for an issue with a real use case first, and the
honest answer was "there isn't one through the public API". Static analysis finds code that
would fail; whether anything reaches it is a separate question.
Sending the fixes
I opened a fix PR for pynubank: build the .p12 with cryptography instead of the removed
PKCS12, and update the CI so the tests run again. It was closed within hours. The README says
the library stopped working in 2023, when Nubank started requiring facial verification. Read the
README before writing the patch.
Running the same check on whole applications went better. On paperless-ngx it found Django
Channels using timezone.utc (removed in Django 5) and nltk using numpy.NINF (removed in
numpy 2), and a pinned Flask-Migrate in CTFd passing an argument alembic 1.16 dropped. Those are
reported upstream, the first two with fix PRs.
What I'd take from this
- Bump PRs are mostly safe. About 1 in 9 of the ones I could rebuild broke something that would run.
- When one isn't, look at your dependencies, not your code. A package that doesn't cap its upper bound (most don't) will happily run against a version that removed what it calls.
- Don't merge on a red CI you haven't read. Half the real breaks here were hidden behind an unrelated failure.
- Green CI is a statement about your tests. It says nothing about code paths they skip.
Limits
37 PRs is a small sample, and three of the four breaks are the same Werkzeug 3 story. pipbreak can't see arguments forwarded through **kwargs,
methods on objects whose type is only known at runtime, C extension changes, or behaviour changes
behind an unchanged API. It complements tests; it doesn't replace them.
The harness, the PR lists and every result file are in the repo:
research/. pipbreak runs as a
GitHub Action on Dependabot and Renovate PRs, or locally with pip install pipbreak.
