Skip to content

Require Python 3.11 or newer - #455

Merged
vinitkumar merged 4 commits into
masterfrom
fix/3.11
Oct 12, 2026
Merged

vinitkumar merged 4 commits into
masterfrom
fix/3.11

Conversation

@vinitkumar

@vinitkumar vinitkumar commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Require Python 3.11+ for both json2xml and its optional Rust extension. Remove older interpreters from CI and wheel tests, update installation docs, and regenerate the lockfile without Python 3.10 compatibility dependencies.

Set the pre-commit hook to pyupgrade --py311-plus. Ran pyupgrade 3.19.1 across all tracked Python sources and stubs under Python 3.11; no source rewrites were needed. This branch also retains its existing Python 3.15 stable CI update.

Validation:

  • make check-all on Python 3.11.17: Ruff and ty passed; 509 tests passed, 149 optional Rust integration tests skipped, 100% coverage.
  • make test-rust: 47 passed.
  • uv build: wheel and sdist built; both declare Requires-Python: >=3.11.
  • lat check and git diff --check: passed.

Summary by Sourcery

Require Python 3.11 or newer across the packages and supported development and CI environments.

Enhancements:

  • Raise the minimum supported Python version to 3.11 for the Python package and optional Rust extension.
  • Align source modernization, documentation, and dependency locking with Python 3.11+ support.

CI:

  • Remove Python 3.10 from Python, Rust, and wheel CI matrices while retaining stable Python 3.15 coverage and updating wheel discovery to Python 3.11.

Documentation:

  • Update installation, benchmark, architecture, and Rust extension documentation to reflect Python 3.11+ requirements.

Align package metadata, CI, wheel builds, and documentation with the
Python 3.11 minimum. Regenerate the lockfile and enforce pyupgrade
--py311-plus; the existing Python sources already pass its checks.
@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (6b346da) to head (209ab92).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #455   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines         1032      1032           
=========================================
  Hits          1032      1032           
Flag Coverage Δ
unittests 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@sourcery-ai

sourcery-ai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR makes Python 3.11 the minimum supported version for json2xml and its optional Rust extension, propagating the requirement through packaging metadata, lockfile, documentation, tooling, and CI. Older interpreter jobs and wheel discovery are removed or updated, while Python 3.15 coverage remains enabled.

File-Level Changes

Change Details Files
Raise the minimum supported Python version to 3.11 across package metadata, the Rust extension, documentation, and development tooling.
  • Set both distributions to require Python 3.11 or newer and remove the Python 3.10 classifier.
  • Update installation, benchmark, architecture, and Rust prerequisite documentation.
  • Configure pyupgrade to enforce Python 3.11-compatible syntax and regenerate the lockfile without 3.10 compatibility dependencies.
pyproject.toml
rust/pyproject.toml
uv.lock
.pre-commit-config.yaml
docs/installation.rst
BENCHMARKS.md
lat.md/architecture.md
rust/README.md
Align CI and wheel discovery with the new interpreter floor while retaining stable Python 3.15 coverage.
  • Remove Python 3.10 from Python, Rust, and wheel-test matrices.
  • Switch the macOS wheel build toolcache setup from Python 3.10 to 3.11.
  • Continue testing CPython and PyPy from 3.11 onward, including stable Python 3.15.
.github/workflows/build-rust-wheels.yml
.github/workflows/pythonpackage.yml
.github/workflows/rust-ci.yml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="rust/pyproject.toml" line_range="10" />
<code_context>
 description = "Simple Python Library to convert JSON to XML"
 readme = "README.rst"
-requires-python = ">=3.10"
+requires-python = ">=3.11"
 license = { text = "Apache Software License 2.0" }
 keywords = ["json2xml"]
</code_context>
<issue_to_address>
**Locked Rust setup fails**

When a contributor runs a locked uv command from `rust/`, `rust/pyproject.toml` requires Python `>=3.11` while `rust/uv.lock` still records `>=3.9`, so uv reports the lock as stale and stops the locked setup.

Regenerate `rust/uv.lock` so its `requires-python` matches the project requirement.
</issue_to_address>

### Comment 2
<location path=".github/workflows/build-rust-wheels.yml" line_range="190" />
<code_context>
       matrix:
         os: [ubuntu-latest, windows-latest, macos-latest]
-        python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
+        python-version: ['3.11', '3.12', '3.13', '3.14']
         include:
           - os: ubuntu-latest
</code_context>
<issue_to_address>
**Rust CI still tests 3.15 beta**

When CI runs after Python 3.15 has become stable, the Rust wheel tests and extension CI run against 3.15.0-beta.3 rather than the stable interpreter, so those checks can pass while the supported stable 3.15 runtime is broken.

Replace the beta interpreter entries in both Rust workflows with the stable 3.15 version.

Also at `.github/workflows/rust-ci.yml:65`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread rust/pyproject.toml
description = "Fast native JSON to XML conversion - Rust extension for json2xml"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"

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.

🟡 Medium · Locked Rust setup fails

When a contributor runs a locked uv command from rust/, rust/pyproject.toml requires Python >=3.11 while rust/uv.lock still records >=3.9, so uv reports the lock as stale and stops the locked setup.

Regenerate rust/uv.lock so its requires-python matches the project requirement.

Prompt for AI agents
In `rust/pyproject.toml` at line 10:

**Locked Rust setup fails**

When a contributor runs a locked uv command from `rust/`, `rust/pyproject.toml` requires Python `>=3.11` while `rust/uv.lock` still records `>=3.9`, so uv reports the lock as stale and stops the locked setup.

Regenerate `rust/uv.lock` so its `requires-python` matches the project requirement.

Comment thread .github/workflows/build-rust-wheels.yml
Replace the beta interpreter pins so native extension and wheel checks exercise the supported stable runtime.
@vinitkumar
vinitkumar merged commit d2f3454 into master Oct 12, 2026
54 checks passed
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.

1 participant