Skip to content

Commit 50cc323

Browse files
authored
chore(deps): upgrade mypy and pytest with Python 3.9 version markers (#325)
* chore(deps): upgrade mypy and pytest with Python 3.9 version markers 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> * fix(test): add None check for logger.extra to satisfy mypy 2.x 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> --------- Signed-off-by: Jericho Tolentino <68654047+jericht@users.noreply.github.com>
1 parent 06c30f1 commit 50cc323

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎pyproject.toml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ disallow_incomplete_defs = false
8888
disallow_untyped_calls = false
8989
show_error_context = true
9090
strict_equality = false
91-
python_version = 3.9
9291
warn_redundant_casts = true
9392
warn_unused_configs = true
9493
warn_unused_ignores = false

‎requirements-testing.txt‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
coverage[toml] == 7.*
22
coverage-conditional-plugin == 0.9.*
3-
pytest == 8.4.*
3+
pytest == 8.4.*; python_version == "3.9"
4+
pytest == 9.1.*; python_version >= "3.10"
45
pytest-cov == 7.1.*
56
pytest-timeout == 2.4.*
67
pytest-xdist == 3.8.*
78
black == 25.*
89
ruff == 0.15.*
910
psutil >= 5.9,< 7.3
10-
mypy == 1.19.*
11+
mypy == 1.19.*; python_version == "3.9"
12+
mypy == 2.1.*; python_version >= "3.10"

‎test/openjd/sessions_v0/test_session.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def test_initiaize_basic(self) -> None:
130130
assert session._job_parameter_values == job_params
131131
assert session._job_parameter_values is not job_params
132132
assert isinstance(session._logger, LoggerAdapter)
133+
assert session._logger.extra is not None
133134
assert "session_id" in session._logger.extra
134135
assert session._logger.extra["session_id"] == session_id
135136
assert session._log_filter in LOG.filters

0 commit comments

Comments
 (0)