Skip to content

Fix Python 3.9 fastjsonschema compatibility#1678

Merged
sbryngelson merged 1 commit into
masterfrom
agent/pin-fastjsonschema-python39
Jul 25, 2026
Merged

Fix Python 3.9 fastjsonschema compatibility#1678
sbryngelson merged 1 commit into
masterfrom
agent/pin-fastjsonschema-python39

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

Description

Constrain fastjsonschema to versions below 2.22 on Python 3.9 while leaving Python 3.10 and newer unconstrained.

fastjsonschema 2.22.0 introduced PEP 604 type annotations such as dict | bool, which require Python 3.10, but the release does not declare a corresponding Requires-Python constraint. As a result, MFC's Python 3.9 compatibility job installs 2.22.0 and fails while importing fastjsonschema.

Upstream issue: horejsek/python-fastjsonschema#211

Observed MFC failure: https://github.com/MFlowCode/MFC/actions/runs/30178357153/job/89730733375

Type of change (delete unused ones)

  • Bug fix

Testing

  • uv pip compile toolchain/pyproject.toml --python-version 3.9 resolves fastjsonschema==2.21.2.
  • uv pip compile toolchain/pyproject.toml --python-version 3.10 resolves fastjsonschema==2.22.0.
  • ./mfc.sh lint -- 350 tests and 4 subtests passed.
  • Commit precheck -- all seven checks passed.

Checklist

Check these like this [x] to indicate which of the below applies.

  • I added or updated tests for new behavior
  • I updated documentation if user-facing behavior changed

See the developer guide for full coding standards.

GPU changes (expand if you modified src/simulation/)
  • GPU results match CPU results
  • Tested on NVIDIA GPU or AMD GPU

AI code reviews

Reviews are not retriggered automatically. To request a review, comment on the PR:

  • @claude full review — Claude full review (also triggers on PR open/reopen/ready)
  • Or add label claude-full-review — Claude full review via label

@sbryngelson
sbryngelson marked this pull request as ready for review July 25, 2026 23:09
Copilot AI review requested due to automatic review settings July 25, 2026 23:09
@sbryngelson
sbryngelson merged commit aaecc47 into master Jul 25, 2026
36 of 73 checks passed
@sbryngelson
sbryngelson deleted the agent/pin-fastjsonschema-python39 branch July 25, 2026 23:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes MFC’s Python 3.9 toolchain compatibility by preventing fastjsonschema versions that use Python 3.10-only PEP 604 type syntax from being installed on Python 3.9, while keeping Python 3.10+ unconstrained.

Changes:

  • Add environment-marked fastjsonschema requirements to pin <2.22 on Python <3.10.
  • Keep fastjsonschema unpinned for Python >=3.10.

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.49%. Comparing base (76f8f51) to head (e653dab).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1678   +/-   ##
=======================================
  Coverage   60.49%   60.49%           
=======================================
  Files          84       84           
  Lines       21189    21189           
  Branches     3134     3134           
=======================================
  Hits        12819    12819           
  Misses       6303     6303           
  Partials     2067     2067           

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants