Add Python 3.14 support#206
Conversation
rtibbles
left a comment
There was a problem hiding this comment.
Concerned you might be overcomplicating this - did you try a simpler way forward?
tests/test_ast_compat.py
Outdated
| @@ -0,0 +1,105 @@ | |||
| """Tests for the ast compatibility monkey patch in conftest.py.""" | |||
There was a problem hiding this comment.
This feels like overkill - either the ast monkey patch fixes the tests in Python 3.14 or it doesn't - that's the test of whether it works or not.
There was a problem hiding this comment.
Agreed — removed the dedicated test file in a2ce302. The existing test suite already validates whether the monkey patch works.
conftest.py
Outdated
| @@ -0,0 +1,68 @@ | |||
| # Monkey patch to restore deprecated ast node types removed in Python 3.14. | |||
There was a problem hiding this comment.
Could we not just use pytest>=6.2.5,<8 in the test requirements to avoid all this extra work?
There was a problem hiding this comment.
The acceptance criteria on the issue specifies: "Conflicting dependency versions should be fixed by way of monkey patching. Do not use Python-version-specific dependency ranges." That's why this uses a monkey patch rather than updating the pytest version constraint.
There was a problem hiding this comment.
That's only a concern for production dependencies, the wording is imprecise. This is a test only dependency, and as long as the pytest API is sufficiently similar between version 6 and 7 this is a very minor concern.
There was a problem hiding this comment.
You're right — the constraint in the acceptance criteria is about production dependencies, not test-only ones. Replaced the monkey patch with pytest>=6.2.5,<8 in requirements-test.txt and squashed to a single commit.
There was a problem hiding this comment.
Agreed — pytest is test-only, so the version-range constraint doesn't apply here. Replaced the monkey patch with pytest>=6.2.5,<8 in requirements-test.txt and squashed to a single commit. All 64 tests pass.
There was a problem hiding this comment.
Agreed — pytest is test-only, so the version-range constraint doesn't apply here. Replaced the monkey patch with pytest>=6.2.5,<8 in requirements-test.txt and squashed to a single commit. All 64 tests pass.
conftest.py
Outdated
There was a problem hiding this comment.
Addressed the overcomplexity concern: removed the dedicated test file (the existing suite is sufficient validation). The monkey-patch approach itself is required by the issue's acceptance criteria — it mandates fixing via monkey patching rather than changing dependency versions.
rtibbles
left a comment
There was a problem hiding this comment.
I think the acceptance criteria are imprecise. Make this change, then squash the commit history to one commit.
conftest.py
Outdated
| @@ -0,0 +1,68 @@ | |||
| # Monkey patch to restore deprecated ast node types removed in Python 3.14. | |||
There was a problem hiding this comment.
That's only a concern for production dependencies, the wording is imprecise. This is a test only dependency, and as long as the pytest API is sufficiently similar between version 6 and 7 this is a very minor concern.
Upgrade pytest from ==6.2.5 to >=6.2.5,<8 to resolve ast module incompatibilities on Python 3.14. Update python_requires upper bound, tox environments, and GitHub Actions test matrix to include Python 3.14. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
a85fa8e to
8150c6c
Compare
Summary
Upgrades pytest from
==6.2.5to>=6.2.5,<8so tests pass on Python 3.14 (the pinned version used removedastnode types). Updatespython_requires, tox, and CI matrix to include Python 3.14.References
Reviewer guidance
>=6.2.5,<8keeps compatibility with the existing test suite while picking up Python 3.14 support from pytest 7.2+AI usage
Claude Code implemented the changes. All generated code was reviewed for correctness and tested against the full test suite.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?