Skip to content

Commit 4d6184c

Browse files
committed
chore(deps): update black and mypy
Signed-off-by: Morgan Epp <60796713+epmog@users.noreply.github.com>
1 parent 9d8f7b8 commit 4d6184c

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ disallow_incomplete_defs = false
8787
disallow_untyped_calls = false
8888
show_error_context = true
8989
strict_equality = false
90-
python_version = 3.9
90+
python_version = "3.10"
9191
warn_redundant_casts = true
9292
warn_unused_configs = true
9393
warn_unused_ignores = false

‎requirements-testing.txt‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ pytest-xdist == 3.8.*
77
types-PyYAML ~= 6.0
88
# Pinned to 25.x because black 26+ produces different formatting output
99
# that is incompatible with black 25 (last version supporting Python 3.9).
10-
black == 25.11.*
10+
black == 25.12.*; python_version >= "3.10"
11+
black == 25.11.*; python_version < "3.10"
1112
ruff == 0.15.*
12-
mypy == 2.2.*; python_version >= "3.10"
13+
mypy == 2.3.*; python_version >= "3.10"
1314
mypy == 1.19.*; python_version < "3.10"
1415
# pydantic: required by the legacy model_v0 (Pydantic) test suite,
1516
# which lives alongside the new Rust-backed model_v1 implementation.
1617
pydantic >= 2.10, < 3
1718
# hypothesis: used by the opt-in fuzz test suites in test/openjd/expr
1819
# and test/openjd/model-v*. conftest.py imports it unconditionally.
19-
hypothesis ~= 6.156; python_version >= "3.10"
20+
hypothesis ~= 6.157; python_version >= "3.10"
2021
hypothesis ~= 6.141; python_version < "3.10"

‎src/openjd/model/_internal/_variable_reference_validation.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,10 @@ def _validate_model_template_variable_references(
349349
):
350350
return []
351351

352+
# _issubclass_for_pydantic isn't a TypeGuard, so mypy only narrows `model` to
353+
# `type[object]` via isclass(). Re-assert the OpenJDModel subclass narrowing.
354+
model = cast(Type[OpenJDModel], model)
355+
352356
# Does this cls change the variable reference scope for itself and its children? If so, then update
353357
# our scope.
354358
model_override_scope = cast(ModelPrivateAttr, model._template_variable_scope).get_default()
@@ -763,6 +767,10 @@ def _collect_variable_definitions( # noqa: C901 (suppress: too complex)
763767
if not isclass(model) or not _issubclass_for_pydantic(model, OpenJDModel):
764768
return {"__export__": ScopedSymtabs()}
765769

770+
# _issubclass_for_pydantic isn't a TypeGuard, so mypy only narrows `model` to
771+
# `type[object]` via isclass(). Re-assert the OpenJDModel subclass narrowing.
772+
model = cast(Type[OpenJDModel], model)
773+
766774
# If the model has no exported variable definitions, prune it
767775
if recursive_pruning and "__export__" not in model._template_variable_sources:
768776
return {"__export__": ScopedSymtabs()}

0 commit comments

Comments
 (0)