Skip to content

Commit

Permalink
馃敡 Update mypy to use sphinx v7.3 (#917)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell committed Apr 23, 2024
1 parent 167c902 commit 5416b9f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.9"
- uses: pre-commit/action@v3.0.1

tests:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ 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
- id: end-of-file-fixer
- 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]
Expand All @@ -33,8 +33,8 @@ repos:
- id: mypy
args: [--config-file=pyproject.toml]
additional_dependencies:
- sphinx~=6.0
- types-urllib3
- sphinx~=7.3
- markdown-it-py~=3.0
- mdit-py-plugins~=0.4.0
files: >
Expand Down
4 changes: 2 additions & 2 deletions myst_parser/sphinx_ext/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion myst_parser/sphinx_ext/mathjax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down
2 changes: 1 addition & 1 deletion myst_parser/sphinx_ext/myst_refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down

0 comments on commit 5416b9f

Please sign in to comment.