Skip to content

Commit 5416b9f

Browse files
authored
🔧 Update mypy to use sphinx v7.3 (#917)
1 parent 167c902 commit 5416b9f

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v4
17-
- name: Set up Python 3.8
17+
- name: Set up Python 3.9
1818
uses: actions/setup-python@v5
1919
with:
20-
python-version: "3.8"
20+
python-version: "3.9"
2121
- uses: pre-commit/[email protected]
2222

2323
tests:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ exclude: >
1313
repos:
1414

1515
- repo: https://github.com/pre-commit/pre-commit-hooks
16-
rev: v4.5.0
16+
rev: v4.6.0
1717
hooks:
1818
- id: check-json
1919
- id: check-yaml
2020
- id: end-of-file-fixer
2121
- id: trailing-whitespace
2222

2323
- repo: https://github.com/astral-sh/ruff-pre-commit
24-
rev: v0.3.4
24+
rev: v0.4.1
2525
hooks:
2626
- id: ruff
2727
args: [--fix]
@@ -33,8 +33,8 @@ repos:
3333
- id: mypy
3434
args: [--config-file=pyproject.toml]
3535
additional_dependencies:
36-
- sphinx~=6.0
3736
- types-urllib3
37+
- sphinx~=7.3
3838
- markdown-it-py~=3.0
3939
- mdit-py-plugins~=0.4.0
4040
files: >

myst_parser/sphinx_ext/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def setup_sphinx(app: Sphinx, load_parser: bool = False) -> None:
5757
for name, default, field in MdParserConfig().as_triple():
5858
if "sphinx" not in field.metadata.get("omit", []):
5959
# TODO add types?
60-
app.add_config_value(f"myst_{name}", default, "env", types=Any)
60+
app.add_config_value(f"myst_{name}", default, "env", types=Any) # type: ignore[arg-type]
6161

6262
app.connect("builder-inited", create_myst_config)
6363
app.connect("builder-inited", override_mathjax)
@@ -68,7 +68,7 @@ def create_myst_config(app):
6868
from sphinx.util import logging
6969

7070
# Ignore type checkers because the attribute is dynamically assigned
71-
from sphinx.util.console import bold # type: ignore[attr-defined]
71+
from sphinx.util.console import bold
7272

7373
from myst_parser import __version__
7474
from myst_parser.config.main import MdParserConfig

myst_parser/sphinx_ext/mathjax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def override_mathjax(app: Sphinx):
4848
and "mathjax" in app.registry.html_block_math_renderers
4949
):
5050
app.registry.html_block_math_renderers["mathjax"] = (
51-
html_visit_displaymath, # type: ignore[assignment]
51+
html_visit_displaymath,
5252
None,
5353
)
5454

myst_parser/sphinx_ext/myst_refs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def resolve_myst_ref_any(
228228
key = (objtype, target.lower())
229229
if key in stddomain.objects:
230230
docname, labelid = stddomain.objects[key]
231-
domain_role = "std:" + stddomain.role_for_objtype(objtype)
231+
domain_role = "std:" + (stddomain.role_for_objtype(objtype) or "")
232232
ref_node = make_refnode(
233233
self.app.builder, refdoc, docname, labelid, contnode
234234
)

0 commit comments

Comments
 (0)