From f3ae00fb6319486d4f60fef0aebbdc158c1b3479 Mon Sep 17 00:00:00 2001 From: James Cobb-Walsh Date: Sun, 18 Feb 2024 20:42:30 +0000 Subject: [PATCH 1/3] Minimal mypy config in pyproject.toml --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index db0a6bc..ffb7e5c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -79,6 +79,10 @@ include_trailing_comma = true multi_line_output = 3 use_parentheses = true +[tool.mypy] +follow_imports = "skip" +ignore_errors = true + [tool.pyright] reportUnnecessaryTypeIgnoreComment = true strict = ["**/*"] From 5c83b9b9a82242b88b79ab8579cd1e5aaefa3003 Mon Sep 17 00:00:00 2001 From: James Cobb-Walsh Date: Sun, 18 Feb 2024 22:24:34 +0000 Subject: [PATCH 2/3] Add mypy to noxfile --- noxfile.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/noxfile.py b/noxfile.py index b121263..3a276fb 100644 --- a/noxfile.py +++ b/noxfile.py @@ -101,6 +101,15 @@ def typing(session): session.run("pyright", *session.posargs, REFERENCING) +@session() +def mypy(session): + """ + Check that mypy runs with no blocking errors. + """ + session.install("mypy", ROOT) + session.run("mypy", REFERENCING) + + @session(tags=["docs"]) @nox.parametrize( "builder", From e715da56f33b72f80e79f247046dd08af8211a1d Mon Sep 17 00:00:00 2001 From: James Cobb-Walsh Date: Mon, 19 Feb 2024 07:59:43 +0000 Subject: [PATCH 3/3] Fix invalid type ignore comment syntax --- referencing/jsonschema.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/referencing/jsonschema.py b/referencing/jsonschema.py index ff4b43f..2eb1647 100644 --- a/referencing/jsonschema.py +++ b/referencing/jsonschema.py @@ -432,7 +432,7 @@ def maybe_in_subresource( "properties", }, ), - anchors_in=_anchor_2019, # type: ignore[reportGeneralTypeIssues] TODO: check whether this is real + anchors_in=_anchor_2019, # type: ignore[reportGeneralTypeIssues] # TODO: check whether this is real maybe_in_subresource=_maybe_in_subresource_crazy_items( in_value={ "additionalItems", @@ -474,7 +474,7 @@ def maybe_in_subresource( in_subarray={"allOf", "anyOf", "oneOf"}, in_subvalues={"definitions", "patternProperties", "properties"}, ), - anchors_in=_legacy_anchor_in_dollar_id, # type: ignore[reportGeneralTypeIssues] TODO: check whether this is real + anchors_in=_legacy_anchor_in_dollar_id, # type: ignore[reportGeneralTypeIssues] # TODO: check whether this is real maybe_in_subresource=_maybe_in_subresource_crazy_items_dependencies( in_value={ "additionalItems", @@ -505,7 +505,7 @@ def maybe_in_subresource( in_subarray={"allOf", "anyOf", "oneOf"}, in_subvalues={"definitions", "patternProperties", "properties"}, ), - anchors_in=_legacy_anchor_in_dollar_id, # type: ignore[reportGeneralTypeIssues] TODO: check whether this is real + anchors_in=_legacy_anchor_in_dollar_id, # type: ignore[reportGeneralTypeIssues] # TODO: check whether this is real maybe_in_subresource=_maybe_in_subresource_crazy_items_dependencies( in_value={ "additionalItems",