Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,10 @@ jobs:
# are scoped to the normal dep graph (what actually ships in the
# extension module).
- name: cargo deny check licenses, bans, sources
run: cargo deny --manifest-path rust-bindings/Cargo.toml check --config deny.toml licenses bans sources
run: cargo deny --manifest-path rust-bindings/Cargo.toml --config deny.toml check licenses bans sources

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old commands used the documented cargo-deny form where --config and --exclude-dev are options of the check subcommand (note the previous advisories command placed --exclude-dev after the advisories positional, confirming these are subcommand-level flags, while only --manifest-path is global).

This PR moves both --config deny.toml and --exclude-dev to before the check subcommand. If the installed cargo-deny still treats these as check-subcommand options, clap will reject them in the global position with an "unexpected argument" error and break the CI job. Since cargo install cargo-deny --locked pulls the latest release, please confirm the installed version accepts --config/--exclude-dev before the subcommand; if not, keep them after check (e.g. check --config deny.toml advisories --exclude-dev).


- name: cargo deny check advisories
run: cargo deny --manifest-path rust-bindings/Cargo.toml check --config deny.toml advisories --exclude-dev
run: cargo deny --manifest-path rust-bindings/Cargo.toml --config deny.toml --exclude-dev check advisories

third_party_licenses:
name: THIRD-PARTY-LICENSES check
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ disallow_incomplete_defs = false
disallow_untyped_calls = false
show_error_context = true
strict_equality = false
python_version = 3.9
python_version = "3.10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping mypy's python_version to "3.10" while the package still declares requires-python = ">=3.9" (and keeps the Python :: 3.9 classifier) means mypy will now type-check against 3.10 semantics for all runs — including the 3.9 CI job that pins mypy == 1.19.*. As a result, uses of 3.10-only stdlib/typing features or syntax that would break at runtime on 3.9 will no longer be flagged. If 3.9 is still a supported target, consider leaving this at 3.9 (or dropping 3.9 support altogether); otherwise the 3.9 leg of the test matrix is being type-checked under the wrong assumptions.

warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = false
Expand Down
7 changes: 4 additions & 3 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ pytest-xdist == 3.8.*
types-PyYAML ~= 6.0
# Pinned to 25.x because black 26+ produces different formatting output
# that is incompatible with black 25 (last version supporting Python 3.9).
black == 25.11.*
black == 25.12.*; python_version >= "3.10"
black == 25.11.*; python_version < "3.10"
ruff == 0.15.*
mypy == 2.2.*; python_version >= "3.10"
mypy == 2.3.*; python_version >= "3.10"
mypy == 1.19.*; python_version < "3.10"
# pydantic: required by the legacy model_v0 (Pydantic) test suite,
# which lives alongside the new Rust-backed model_v1 implementation.
pydantic >= 2.10, < 3
# hypothesis: used by the opt-in fuzz test suites in test/openjd/expr
# and test/openjd/model-v*. conftest.py imports it unconditionally.
hypothesis ~= 6.156; python_version >= "3.10"
hypothesis ~= 6.157; python_version >= "3.10"
hypothesis ~= 6.141; python_version < "3.10"
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ def _validate_model_template_variable_references(
):
return []

# _issubclass_for_pydantic isn't a TypeGuard, so mypy only narrows `model` to
# `type[object]` via isclass(). Re-assert the OpenJDModel subclass narrowing.
model = cast(Type[OpenJDModel], model)

# Does this cls change the variable reference scope for itself and its children? If so, then update
# our scope.
model_override_scope = cast(ModelPrivateAttr, model._template_variable_scope).get_default()
Expand Down Expand Up @@ -763,6 +767,10 @@ def _collect_variable_definitions( # noqa: C901 (suppress: too complex)
if not isclass(model) or not _issubclass_for_pydantic(model, OpenJDModel):
return {"__export__": ScopedSymtabs()}

# _issubclass_for_pydantic isn't a TypeGuard, so mypy only narrows `model` to
# `type[object]` via isclass(). Re-assert the OpenJDModel subclass narrowing.
model = cast(Type[OpenJDModel], model)

# If the model has no exported variable definitions, prune it
if recursive_pruning and "__export__" not in model._template_variable_sources:
return {"__export__": ScopedSymtabs()}
Expand Down
Loading