File tree Expand file tree Collapse file tree
src/openjd/model/_internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ disallow_incomplete_defs = false
8787disallow_untyped_calls = false
8888show_error_context = true
8989strict_equality = false
90- python_version = 3.9
90+ python_version = " 3.10 "
9191warn_redundant_casts = true
9292warn_unused_configs = true
9393warn_unused_ignores = false
Original file line number Diff line number Diff line change @@ -7,14 +7,15 @@ pytest-xdist == 3.8.*
77types-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"
1112ruff == 0.15.*
12- mypy == 2.2 .*; python_version >= "3.10"
13+ mypy == 2.3 .*; python_version >= "3.10"
1314mypy == 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.
1617pydantic >= 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"
2021hypothesis ~= 6.141; python_version < "3.10"
Original file line number Diff line number Diff 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 ()}
You can’t perform that action at this time.
0 commit comments