Skip to content

Add Python 3.14 support#425

Draft
MaxGhenis wants to merge 8 commits intoPolicyEngine:masterfrom
MaxGhenis:add-python-3.14-support
Draft

Add Python 3.14 support#425
MaxGhenis wants to merge 8 commits intoPolicyEngine:masterfrom
MaxGhenis:add-python-3.14-support

Conversation

@MaxGhenis
Copy link
Contributor

@MaxGhenis MaxGhenis commented Jan 24, 2026

Summary

Add Python 3.14 support to policyengine-core.

Status: Blocked on tables

⚠️ Waiting on PyTables/PyTables#1262 — tables doesn't have Python 3.14 wheels yet, and source builds fail. This blocks microsimulation functionality (loading CPS/microdata).

Once tables 3.11.0 ships with Python 3.14 support, this PR can be merged.

Changes

  • Add Python 3.14 to classifiers in setup.py
  • Add Python 3.14 to Test matrix in pr.yaml (3.12, 3.13, 3.14)
  • Add Python 3.14 to SmokeTestForMultipleVersions matrix (3.10-3.14)
  • Handle Python 3.14 like 3.13 for tables package workaround

What works now

  • policyengine-core installs and runs on Python 3.14 ✅
  • Household-level calculations work ✅

What's blocked

  • Microsimulation (requires tables → policyengine-us-data → HDF5 microdata)

Dependencies

The numpy compatibility fix for Python 3.14 was already merged in PR #409.

Test plan

  • CI runs tests on Python 3.10, 3.11, 3.12, 3.13, and 3.14
  • Core tests pass on all versions
  • Smoke tests with policyengine-us will pass once tables has 3.14 wheels

Related issue

Fixes #399

🤖 Generated with Claude Code

- Add Python 3.14 to classifiers in setup.py
- Add Python 3.14 to Test matrix in pr.yaml
- Add Python 3.14 to SmokeTestForMultipleVersions matrix
- Handle Python 3.14 like 3.13 for tables package workaround

The numpy compatibility fix for Python 3.14 was already merged in PR PolicyEngine#409.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.45%. Comparing base (58c2fca) to head (e162b83).
⚠️ Report is 31 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #425      +/-   ##
==========================================
+ Coverage   81.14%   82.45%   +1.31%     
==========================================
  Files         197      202       +5     
  Lines       10228    10585     +357     
  Branches     1057     1066       +9     
==========================================
+ Hits         8299     8728     +429     
+ Misses       1640     1582      -58     
+ Partials      289      275      -14     

☔ 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.

MaxGhenis and others added 3 commits January 24, 2026 17:24
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
tables doesn't have Python 3.14 wheels yet, so the smoke tests with
policyengine-us will fail. The core tests pass on Python 3.14.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Will merge when tables has Python 3.14 wheels.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@MaxGhenis MaxGhenis marked this pull request as draft January 24, 2026 23:05
MaxGhenis and others added 4 commits January 24, 2026 18:08
tables 3.11+ will have Python 3.14 wheels (PyTables/PyTables#1262).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Core tests still run on 3.14 (and pass). Smoke tests with policyengine-us
excluded until tables has Python 3.14 support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CI failure signals PR is blocked. When tables 3.11 releases,
CI will auto-pass and PR is ready to merge.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The old workaround installed unnecessary deps (synthimpute, etc.).
Just let policyengine-us install normally - it will fail on Python 3.14
until tables 3.11 releases, then auto-work.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@nikhilwoodruff
Copy link
Contributor

@MaxGhenis I've implemented a workaround to unblock this PR! 🎉

What changed

Instead of waiting for PyTables 3.11.0 to be released, I've updated the CI workflow to install PyTables directly from GitHub master for Python 3.14. This is similar to the existing Python 3.13 workaround, but uses:

pip install git+https://github.com/PyTables/PyTables.git@master

PyTables PR #1286 already merged Python 3.14 support on January 7, 2026, so the master branch has everything we need.

Changes made

Branch: claude/python-3.14-pytables-support-4cG3O

Updated .github/workflows/pr.yaml:

  • Added Python 3.14 workaround that installs PyTables from GitHub
  • Kept the existing Python 3.13 workaround intact
  • Both test matrices now include Python 3.14

Updated setup.py:

  • Added "Programming Language :: Python :: 3.14" classifier
  • Updated comments to reflect Python 3.13+ requirements

Why this works

✅ PyTables master has Python 3.14 support (merged in PR #1286)
✅ Linux builds should work fine
⚠️ Windows 3.14 builds might have issues (PyTables excluded them due to test failures)
✅ Once PyTables 3.11.0 releases, we can remove the workaround and use the official wheels

Next steps

You can either:

  1. Cherry-pick my commit (62f84e8e) into your add-python-3.14-support branch
  2. Use my branch to update this PR
  3. Wait for PyTables 3.11.0 if you prefer (but this workaround lets us test now)

The workaround follows the same pattern as the Python 3.13 handling, so it should be safe and maintainable until the official release.

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.

Upgrade to Python 3.14

2 participants

Comments