← All posts

When to upgrade Python in production

A new Python release does not mean your production systems should move at once. The practical question is when your dependencies, tooling, packaging path, and benchmarks make the upgrade low-risk.

Simon Willison points to a Talk Python episode on Python 3.15 and frames a familiar pattern in engineering teams. Once a new Python release lands, many teams start moving to the prior one in production. For practitioners building AI systems, backend services, or blockchain tooling, this matters less as language news and more as delivery math.

You ship systems with dependency trees, CI images, type-checkers, native extensions, and runtime constraints. A new language version changes all of them at different speeds. The hard part is rarely syntax. It is support windows, packaging friction, and hidden performance or compatibility changes across your stack.

If you build with Go, Python, or both, you have seen the same operational truth. The best version is often not the newest one. It is the newest one your tooling, libraries, and deployment path support with low friction. Here is how to evaluate a runtime upgrade like an engineer, not a release-note reader.

Start with your dependency floor

Your real Python version is set by the least ready part of your stack. In AI systems, this often means native packages, model-serving frameworks, CUDA bindings, or data libraries. In blockchain tooling, it often means ABI codegen, cryptography libraries, RPC clients, and indexing pipelines.

Build an inventory before you change anything:

  • direct dependencies
  • native dependencies with compiled wheels
  • internal shared libraries
  • CI images and buildpacks
  • deployment base images
  • type-checking and linting tools
  • observability agents

Then classify each item by support state:

  • supports your current version only
  • supports current and target versions
  • supports target version in pre-release only
  • unknown support state

Unknown is where upgrades stall. Treat it as work, not as a footnote.

For Python, the first check is simple. Run your dependency resolver against the target version in a clean environment and record every failure. Do not stop at install success. Imports fail later. Tests fail later. Native code fails later.

A useful pattern is a compatibility matrix in CI:

python-version: ["3.11", "3.12", "3.13"]

This gives you two things. First, proof of support. Second, early warning when one dependency drops support for an older version before your production fleet is ready to move.

Inspect packaging and native-extension risk

Most runtime upgrade pain comes from packaging. The language release is stable. The wheel ecosystem is still catching up.

This is common in AI workloads. Packages tied to BLAS, CUDA, tokenizers, or custom C and Rust extensions often lag. The same applies in blockchain stacks using secp256k1 bindings, database drivers, or performance-sensitive serialization code.

Look for these signals:

  • no prebuilt wheels for your OS and architecture
  • fallback to source builds in CI
  • pinned setuptools, maturin, or rust toolchain versions
  • transitive dependencies with limited maintainer activity
  • Dockerfiles with handwritten compiler setup

Each signal adds time and variance to your builds. It also changes your rollback path. If moving to a new Python version requires source compilation in production images, you now depend on more than Python. You depend on compilers, system headers, and often network access during build.

A practical verification flow:

  1. Build your full production image on the target version.
  2. Time the build and compare it to the current baseline.
  3. Record which packages switch from wheels to source.
  4. Run smoke tests under the final container, not only in virtualenv.

This catches a class of issues teams miss when they test only at the package level.

If your organization mixes Go and Python, keep the boundary narrow. Push performance-critical or OS-sensitive components into Go services where version support tends to move with less packaging drag. Keep Python at orchestration, data handling, and model integration layers where its library ecosystem pays for the complexity.

Measure performance where it changes your cost curve

Language release notes often highlight speedups. Those matter only if they improve your workload.

Benchmark what you run:

  • API request handling
  • batch inference
  • ETL jobs
  • blockchain indexer backfills
  • signing or verification loops
  • JSON and protobuf serialization
  • startup latency for short-lived jobs

Use representative datasets and production-like settings. Microbenchmarks help with diagnosis, not with upgrade decisions.

In AI systems, a Python upgrade might barely affect model runtime if most work sits in native kernels. It might still reduce control-plane overhead, startup time, or memory use enough to matter for autoscaling. In blockchain ingestion systems, the win may come from parsing, async scheduling, or lower GC pressure in support libraries rather than core cryptography.

Measure three classes of outcome:

  • throughput
  • tail latency
  • memory footprint

Tail latency matters more than average latency in user-facing APIs. Memory footprint matters more than raw speed in dense worker fleets. A small memory drop across many pods often beats a small CPU gain.

Where teams go wrong is assuming runtime speedups offset migration cost. Sometimes they do. Often they do not. A version bump that saves 4 percent CPU but adds 20 percent build time and several fragile source builds is not an obvious win.

Treat tooling compatibility as a first-class gate

Your application running is not enough. Your engineering system must run too.

Check these layers:

  • test runners and coverage tools
  • formatters and linters
  • mypy or pyright
  • notebook environments
  • profiling tools
  • debuggers
  • build backends
  • pre-commit hooks

Many failed upgrades are tooling failures disguised as runtime failures. A library imports fine, but your lint job breaks. A service passes tests, but your notebook image used by data science does not build. A package works in development, but your deploy step relies on a plugin with stale version constraints.

Create an upgrade gate with explicit pass criteria:

  • all CI jobs green on the target version
  • production image builds without source-only surprises
  • load tests within agreed thresholds
  • observability output unchanged or intentionally updated
  • rollback to the prior runtime tested once

The rollback test matters. Teams rehearse the move forward and ignore the move back. If your database migrations, cache serialization, or generated artifacts change under the new runtime, rollback grows harder than it looks.

Plan adoption around support windows, not release excitement

The source title, “Hello Python 3.15, now we can use 3.11”, captures a useful operational instinct. Mature teams adopt when the ecosystem settles, not when the announcement lands.

This pattern holds across stacks. Go teams often upgrade faster because the distribution model is simpler and static binaries reduce packaging variance. Python teams need more patience because their stack includes a wider packaging surface and more third-party release timing.

For AI and blockchain systems, support windows matter even more:

  • managed platforms pin runtimes on their own schedule
  • GPU images lag behind interpreter releases
  • security scanners and base images update asynchronously
  • regulated environments prefer fewer runtime changes per year

Pick a target cadence. Many teams do well with one major interpreter jump after ecosystem support is broad and before their current version nears end of support. This keeps the delta manageable.

A useful rule is to separate evaluation from adoption:

  • evaluate the new version early in CI
  • adopt it in production only after dependency and tooling support is stable

This lowers surprise without forcing rushed migration work.

What to watch next

Watch wheel availability, CI image support, and framework support statements more closely than headline language features. Those signals tell you when an upgrade shifts from experiment to routine maintenance.

If you run mixed Go and Python systems, keep tracking which work belongs on each side of the boundary. A clean split reduces upgrade friction on both sides. Python keeps its ecosystem advantage. Go keeps deployment and runtime behavior predictable.

The release train will keep moving. Your job is not to chase it. Your job is to move when the stack under your service is ready.