chore(deps): upgrade mypy and pytest with Python 3.9 version markers#325
Merged
Conversation
| show_error_context = true | ||
| strict_equality = false | ||
| python_version = 3.9 | ||
| warn_redundant_casts = true |
There was a problem hiding this comment.
Removing python_version = 3.9 means mypy now targets whatever interpreter it runs under (Python 3.10+ per the new mypy == 2.1.* split) instead of the minimum supported version. As a result type-checking will no longer catch code that uses 3.10+-only syntax/APIs but must still run on 3.9 (which is still in requires-python = ">=3.9" and the classifiers). Consider keeping the target pinned to the floor, e.g. python_version = "3.9" (quoted, since mypy 2.x is stricter about the value type), so 3.9 incompatibilities are still flagged.
Upgrade deps per dependabot PRs: - mypy: 1.19.* for Python 3.9, 2.1.* for Python >=3.10 - pytest: 8.4.* for Python 3.9, 9.1.* for Python >=3.10 mypy 2.x and pytest 9.x both dropped Python 3.9 support. Use environment markers so Python 3.9 CI stays on the last compatible versions while 3.10+ gets the latest. Also remove python_version = 3.9 from [tool.mypy] so mypy infers the target from the running Python — required because mypy 2.x dropped support for targeting 3.9. Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
mypy 2.x is stricter about Mapping | None — add an explicit assertion before accessing session._logger.extra. Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
jericht
force-pushed
the
jericht/pin_39_deps
branch
from
July 2, 2026 23:55
c803bd3 to
fae5496
Compare
leongdl
approved these changes
Jul 3, 2026
mwiebe
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrade mypy (to 2.1.), pytest (to 9.1.), and black (to 26.*) per dependabot PRs #322, #320, and #323, while maintaining Python 3.9 compatibility using environment markers.
Changes
requirements-testing.txt:
mypy == 1.19.*; python_version == "3.9"/mypy == 2.1.*; python_version >= "3.10"pytest == 8.4.*; python_version == "3.9"/pytest == 9.1.*; python_version >= "3.10"black == 25.*; python_version == "3.9"/black == 26.*; python_version >= "3.10"pyproject.toml:
python_version = 3.9from[tool.mypy]— mypy now infers the target from the running Python. Required because mypy 2.x dropped support for targeting 3.9.test/openjd/sessions_v0/test_session.py:
assert session._logger.extra is not Noneto satisfy mypy 2.x stricter nullable type checking.Context
mypy 2.x, pytest 9.x, and black 26.x all dropped Python 3.9 support. Rather than blocking the upgrades entirely, this uses pip environment markers to install the last compatible version on Python 3.9 and the latest on 3.10+.
Supersedes #320, #322, and #323.