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
5 changes: 2 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ jobs:
- name: Format with Ruff
run: ruff format . --diff

# - name: Type check with MyPy
# run: mypy
# Skip MyPy check for now, see https://github.com/sphinx-doc/sphinx-argparse/issues/85
- name: Type check with MyPy
run: mypy

twine:
name: "Check packing with Twine"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ multi_line_output = 3

[tool.mypy]
files = ["sphinxarg", "test"]
python_version = "3.10"
python_version = "3.13"
exclude = '''(?x)( ^test/roots | ^docs )'''

[[tool.mypy.overrides]]
Expand Down
6 changes: 2 additions & 4 deletions sphinxarg/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import sys
from argparse import ArgumentParser
from typing import TYPE_CHECKING, ClassVar, cast
from typing import TYPE_CHECKING, cast

from docutils import nodes
from docutils.frontend import get_default_settings
Expand Down Expand Up @@ -892,9 +892,7 @@ class ArgParseDomain(Domain):
'command': XRefRole(),
}
indices = []
initial_data: ClassVar[
dict[str, list[_ObjectDescriptionTuple] | dict[str, list[_ObjectDescriptionTuple]]]
] = {
initial_data = {
'commands': [],
'commands-by-group': {},
}
Expand Down
5 changes: 3 additions & 2 deletions test/test_default_html.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test the HTML builder and check output against XPath."""

import posixpath
from typing import Any

import pytest
from sphinx.util.inventory import InventoryFile
Expand Down Expand Up @@ -90,8 +91,8 @@ def test_index_is_optional(app, cached_etree_parse):
assert command_index_file.exists() is False


def get_inv_command_uri(inv: dict, field: str) -> str:
command = inv.get('commands:command')
def get_inv_command_uri(inv: dict[str, dict[str, Any]], field: str) -> str:
command = inv['commands:command']
value = command.get(field, None)
assert value is not None
if isinstance(value, tuple):
Expand Down