Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08b5824

Browse files
committed
build(type): add types-docutils to type dependency group
ty reads docutils source when stubs are absent and infers option_spec as an instance variable, causing invalid-attribute-override errors. The types-docutils stubs correctly declare it as ClassVar.
1 parent de9a269 commit 08b5824

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

docs/changelog/3932.bugfix.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Correct type annotations for `ArgumentParser.parse_args` and `parse_known_args` overrides following
2-
`typeshed PR #15613 <https://github.com/python/typeshed/pull/15613>`\_, which widened the `args` parameter from
3-
`Sequence[str]` to `Iterable[str]`. The narrower type in tox's overrides violated the Liskov substitution principle and
4-
caused `invalid-method-override` errors with `ty` 0.0.33. Also correct the `option_spec` annotation in
5-
`docs/tox_conf.py` to use `ClassVar[dict[str, Callable[[str], Any]]]` matching the docutils stubs type.
1+
Correct type annotations for ``ArgumentParser.parse_args`` and ``parse_known_args`` overrides following `typeshed PR
2+
#15613 <https://github.com/python/typeshed/pull/15613>`_, which widened the ``args`` parameter from ``Sequence[str]`` to
3+
``Iterable[str]``. The narrower type in tox's overrides violated the Liskov substitution principle and caused
4+
``invalid-method-override`` errors with ``ty`` 0.0.33. Also correct the ``option_spec`` annotation in
5+
``docs/tox_conf.py`` to ``ClassVar[dict[str, Callable[[str], Any]]]`` matching the docutils stubs type.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ test = [
104104
]
105105
type = [
106106
"ty>=0.0.19",
107+
"types-docutils>=0.21",
107108
{ include-group = "docs" },
108109
{ include-group = "release" },
109110
{ include-group = "test" },

0 commit comments

Comments
 (0)