File tree Expand file tree Collapse file tree 6 files changed +22
-16
lines changed
src/sphinx_autodoc_typehints Expand file tree Collapse file tree 6 files changed +22
-16
lines changed Original file line number Diff line number Diff line change 1313 rev : v2.4.1
1414 hooks :
1515 - id : codespell
16- additional_dependencies : ["tomli>=2.2.1 "]
16+ additional_dependencies : ["tomli>=2.3 "]
1717 - repo : https://github.com/tox-dev/tox-ini-fmt
1818 rev : " 1.7.0"
1919 hooks :
3434 hooks :
3535 - id : prettier
3636 additional_dependencies :
37- - prettier@3.6.2
37+ - prettier@3.7.4
3838 - " @prettier/plugin-xml@3.4.2"
3939 - repo : meta
4040 hooks :
Original file line number Diff line number Diff line change 22build-backend = " hatchling.build"
33requires = [
44 " hatch-vcs>=0.5" ,
5- " hatchling>=1.27 " ,
5+ " hatchling>=1.28 " ,
66]
77
88[project ]
@@ -41,17 +41,17 @@ dynamic = [
4141 " version" ,
4242]
4343dependencies = [
44- " sphinx>=8.2.3 " ,
44+ " sphinx>=9.0.4 " ,
4545]
4646optional-dependencies.docs = [
4747 " furo>=2025.9.25" ,
4848]
4949optional-dependencies.testing = [
5050 " covdefaults>=2.3" ,
51- " coverage>=7.10.7 " ,
51+ " coverage>=7.13 " ,
5252 " defusedxml>=0.7.1" , # required by sphinx.testing
53- " diff-cover>=9.7.1 " ,
54- " pytest>=8.4 .2" ,
53+ " diff-cover>=9.7.2 " ,
54+ " pytest>=9.0 .2" ,
5555 " pytest-cov>=7" ,
5656 " sphobjinv>=2.3.1.3" ,
5757 " typing-extensions>=4.15" ,
Original file line number Diff line number Diff line change @@ -25,12 +25,16 @@ def fix_autodoc_typehints_for_overloaded_methods() -> None:
2525 Normally, `FunctionDocumenter.format_signature` and `MethodDocumenter.format_signature` call
2626 `super().format_signature` which ends up going to `Documenter.format_signature`, and this last method emits the
2727 `autodoc-process-signature` event. However, if there are overloads, `FunctionDocumenter.format_signature` does
28- something else and the event never occurs. Here we remove this alternative code path by brute force.
28+ something else and the event never occurs.
29+
30+ We delete the format_signature methods to force using the parent implementation, which emits the event.
2931
3032 See https://github.com/tox-dev/sphinx-autodoc-typehints/issues/296
3133 """
3234 from sphinx .ext .autodoc import FunctionDocumenter , MethodDocumenter # noqa: PLC0415
3335
36+ # Delete the format_signature methods that add overloads
37+ # This forces everything to use Documenter.format_signature which emits the event
3438 del FunctionDocumenter .format_signature
3539 del MethodDocumenter .format_signature
3640
Original file line number Diff line number Diff line change 1414 "sphinx.ext.napoleon" ,
1515 "sphinx_autodoc_typehints" ,
1616]
17+
18+ autodoc_use_legacy_class_based = True
Original file line number Diff line number Diff line change @@ -746,7 +746,7 @@ class mod.TestClassAttributeDocs
746746
747747 A class
748748
749- code: " CodeType" | " None"
749+ code: CodeType | None
750750
751751 An attribute
752752""" ,
@@ -1013,7 +1013,7 @@ class mod.ParamAndAttributeHaveSameName(blah)
10131013 Parameters:
10141014 **blah** ("CodeType") -- Description of parameter blah
10151015
1016- blah: " ModuleType"
1016+ blah: ModuleType
10171017
10181018 Description of attribute blah
10191019
Original file line number Diff line number Diff line change 11[tox]
22requires =
3- tox>=4.30.2
4- tox-uv>=1.28
3+ tox>=4.32
4+ tox-uv>=1.29
55env_list =
66 fix
77 3.14
@@ -39,15 +39,15 @@ commands =
3939description = format the code base to adhere to our styles, and complain about what we cannot do automatically
4040skip_install = true
4141deps =
42- pre-commit-uv>=4.1.5
42+ pre-commit-uv>=4.2
4343commands =
4444 pre-commit run --all-files --show-diff-on-failure
4545
4646[testenv:type]
4747description = run type check on code base
4848deps =
49- mypy ==1.18.2
50- types-docutils>=0.22.2.20250924
49+ mypy ==1.19
50+ types-docutils>=0.22.3.20251115
5151commands =
5252 mypy src
5353 mypy tests
@@ -58,7 +58,7 @@ skip_install = true
5858deps =
5959 check-wheel-contents>=0.6.3
6060 twine>=6.2
61- uv>=0.8.22
61+ uv>=0.9.16
6262commands =
6363 uv build --sdist --wheel --out-dir {env_tmp_dir} .
6464 twine check {env_tmp_dir}{/}*
You can’t perform that action at this time.
0 commit comments