Skip to content

Phase 3: Upgrade Python 3.10 to 3.13#9321

Open
camd wants to merge 3 commits intocamd/back-end-package-upgrade-phase-2from
camd/back-end-package-upgrade-phase-3
Open

Phase 3: Upgrade Python 3.10 to 3.13#9321
camd wants to merge 3 commits intocamd/back-end-package-upgrade-phase-2from
camd/back-end-package-upgrade-phase-3

Conversation

@camd
Copy link
Collaborator

@camd camd commented Mar 22, 2026

Summary

  • Upgrade Python from 3.10 to 3.13 across Docker images, CI, and tooling config
  • Update base images from Debian Bullseye to Bookworm (required for Python 3.13)
  • Fix compatibility issues: netcatnetcat-openbsd, ENV format in Dockerfile
  • Remove Python 3.10 backport deps (backports-asyncio-runner, exceptiongroup, tomli) that are now in stdlib
  • Add setuptools to dev requirements (removed from stdlib in Python 3.13)
  • Remove pyqt5/pyqt5-qt5/pyqt5-sip from common.txt — no Python 3.13 wheels and unused by Treeherder (declared by mozdetect but only needed for GUI/plotting features)
  • Upgrade zstandard 0.22.0 → 0.23.0 (0.22 fails to build on 3.13)
  • Add deprecation warning filters for datetime.utcfromtimestamp()/utcnow() (deprecated in 3.12+, TODO to migrate to timezone-aware calls)

Dependencies

Known limitations

  • mozdetect declares pyqt5 as a dependency, but PyQt5 has no Python 3.13 wheels. Since Treeherder only uses mozdetect's data analysis functions (not GUI), this is safe to skip. pip check in CI is filtered to allow this.
  • datetime.utcfromtimestamp() and datetime.utcnow() calls are suppressed via warning filters rather than migrated — there are 20+ call sites across source and tests. A follow-up PR should migrate these to datetime.fromtimestamp(ts, datetime.UTC).

Test plan

  • Full backend test suite passes (1360 passed, 2 skipped, 9 xfailed)
  • Docker dev image builds and runs on Python 3.13
  • pip check passes (with known mozdetect/pyqt5 filter)
  • CI linters pass (tox -e linters)
  • Verify production Docker image builds cleanly

🤖 Generated with Claude Code

camd and others added 2 commits March 22, 2026 12:50
- Update Docker images to python:3.13-slim-bookworm / python:3.13-bookworm
- Update CI to cimg/python:3.13-node
- Update ruff target-version to py313, tox envlist to py313
- Fix dev.Dockerfile: netcat -> netcat-openbsd (Bookworm), ENV format
- Remove Python 3.10 backport deps (backports-asyncio-runner, exceptiongroup, tomli)
- Add setuptools to dev.txt (removed from stdlib in 3.13)
- Remove pyqt5/pyqt5-qt5/pyqt5-sip (no 3.13 wheels, unused by Treeherder)
- Upgrade zstandard 0.22.0 -> 0.23.0 (0.22 doesn't build on 3.13)
- Add deprecation warning filters for datetime.utcfromtimestamp/utcnow
- Filter pip check for known mozdetect/pyqt5 incompatibility

Co-Authored-By: Claude Opus 4.6 <[email protected]>
numpy 1.26.4 has no prebuilt wheel for Python 3.13, causing the
Docker build to fail when trying to compile from source without g++.
numpy 2.2.6 ships cp313 wheels for all platforms.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@camd camd changed the title Upgrade Python 3.10 to 3.13 BE3: Upgrade Python 3.10 to 3.13 Mar 22, 2026
Ruff's UP017 rule enforces using datetime.UTC (available since
Python 3.11) instead of datetime.timezone.utc when targeting py313.
Also removes the now-unused timezone imports (F401).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.37%. Comparing base (0ae2e99) to head (790634e).

Additional details and impacted files
@@                            Coverage Diff                            @@
##           camd/back-end-package-upgrade-phase-2    #9321      +/-   ##
=========================================================================
- Coverage                                  82.37%   82.37%   -0.01%     
=========================================================================
  Files                                        615      615              
  Lines                                      34999    34999              
  Branches                                    3312     3244      -68     
=========================================================================
- Hits                                       28831    28829       -2     
- Misses                                      5819     6046     +227     
+ Partials                                     349      124     -225     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@camd camd changed the title BE3: Upgrade Python 3.10 to 3.13 Phase 3: Upgrade Python 3.10 to 3.13 Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants