diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a7626ac4..125d1e7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ exclude: > repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-json - id: check-yaml @@ -21,7 +21,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.3.4 + rev: v0.4.1 hooks: - id: ruff args: [--fix] @@ -33,8 +33,8 @@ repos: - id: mypy args: [--config-file=pyproject.toml] additional_dependencies: - - sphinx~=6.0 - types-urllib3 + - sphinx~=7.0 - markdown-it-py~=3.0 - mdit-py-plugins~=0.4.0 files: > diff --git a/myst_parser/sphinx_ext/main.py b/myst_parser/sphinx_ext/main.py index 0948386f..c6945f22 100644 --- a/myst_parser/sphinx_ext/main.py +++ b/myst_parser/sphinx_ext/main.py @@ -57,7 +57,7 @@ def setup_sphinx(app: Sphinx, load_parser: bool = False) -> None: for name, default, field in MdParserConfig().as_triple(): if "sphinx" not in field.metadata.get("omit", []): # TODO add types? - app.add_config_value(f"myst_{name}", default, "env", types=Any) + app.add_config_value(f"myst_{name}", default, "env", types=Any) # type: ignore[arg-type] app.connect("builder-inited", create_myst_config) app.connect("builder-inited", override_mathjax) @@ -68,7 +68,7 @@ def create_myst_config(app): from sphinx.util import logging # Ignore type checkers because the attribute is dynamically assigned - from sphinx.util.console import bold # type: ignore[attr-defined] + from sphinx.util.console import bold from myst_parser import __version__ from myst_parser.config.main import MdParserConfig diff --git a/myst_parser/sphinx_ext/mathjax.py b/myst_parser/sphinx_ext/mathjax.py index b3d8cb72..59fb9af0 100644 --- a/myst_parser/sphinx_ext/mathjax.py +++ b/myst_parser/sphinx_ext/mathjax.py @@ -48,7 +48,7 @@ def override_mathjax(app: Sphinx): and "mathjax" in app.registry.html_block_math_renderers ): app.registry.html_block_math_renderers["mathjax"] = ( - html_visit_displaymath, # type: ignore[assignment] + html_visit_displaymath, None, ) diff --git a/myst_parser/sphinx_ext/myst_refs.py b/myst_parser/sphinx_ext/myst_refs.py index e8a836f9..913a4f8d 100644 --- a/myst_parser/sphinx_ext/myst_refs.py +++ b/myst_parser/sphinx_ext/myst_refs.py @@ -228,7 +228,7 @@ def resolve_myst_ref_any( key = (objtype, target.lower()) if key in stddomain.objects: docname, labelid = stddomain.objects[key] - domain_role = "std:" + stddomain.role_for_objtype(objtype) + domain_role = "std:" + (stddomain.role_for_objtype(objtype) or "") ref_node = make_refnode( self.app.builder, refdoc, docname, labelid, contnode )