Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Improve languages dirs for docutils #14124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion 1 stubs/docutils/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ docutils.frontend.ConfigParser.read
docutils.frontend.OptionParser.__getattr__
docutils.io.FileOutput.__getattr__
docutils.io.FileOutput.__init__
docutils.languages.LanguageImporter.__getattr__
docutils.nodes.Element.__iter__ # doesn't exist at runtime, but the class is iterable due to __getitem__
docutils.nodes.Element.tagname # class variable is overridden in __init__ method
docutils.nodes.GenericNodeVisitor.__getattr__
Expand Down
13 changes: 10 additions & 3 deletions 13 stubs/docutils/docutils/languages/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
from _typeshed import Incomplete
from typing import Protocol
from typing import ClassVar, Final, Protocol

from docutils.utils import Reporter

__docformat__: Final = "reStructuredText"

class _LanguageModule(Protocol):
labels: dict[str, str]
author_separators: list[str]
bibliographic_fields: list[str]

class LanguageImporter:
packages: ClassVar[tuple[str, ...]]
warn_msg: ClassVar[str]
fallback: ClassVar[str]
cache: dict[str, _LanguageModule]
def __init__(self) -> None: ...
def import_from_packages(self, name: str, reporter: Reporter | None = None): ...
def check_content(self, module: _LanguageModule) -> None: ...
def __call__(self, language_code: str, reporter: Reporter | None = None) -> _LanguageModule: ...
def __getattr__(self, name: str, /) -> Incomplete: ...

get_language: LanguageImporter
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/af.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ar.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal["؛", "،"]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ca.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/cs.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/da.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/de.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/en.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/eo.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from _typeshed import Incomplete

__docformat__: str
labels: Incomplete
bibliographic_fields: Incomplete
author_separators: Incomplete
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/es.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from _typeshed import Incomplete

__docformat__: str
labels: Incomplete
bibliographic_fields: Incomplete
author_separators: Incomplete
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/fa.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal["؛", "،"]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/fi.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/fr.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/gl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/he.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/it.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ja.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ka.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ko.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/lt.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/lv.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/nl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/pl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/pt_br.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/ru.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/sk.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/sv.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/uk.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final, Literal

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[Literal[";", ","]]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/zh_cn.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[str]
6 changes: 6 additions & 0 deletions 6 stubs/docutils/docutils/languages/zh_tw.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from typing import Final

__docformat__: Final = "reStructuredText"
labels: dict[str, str]
bibliographic_fields: dict[str, str]
author_separators: list[str]
15 changes: 15 additions & 0 deletions 15 stubs/docutils/docutils/parsers/rst/languages/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from typing import ClassVar, Final, Protocol

from docutils.languages import LanguageImporter

__docformat__: Final = "reStructuredText"

class _RstLanguageModule(Protocol):
donBarbos marked this conversation as resolved.
Show resolved Hide resolved
directives: dict[str, str]
roles: dict[str, str]

class RstLanguageImporter(LanguageImporter):
fallback: ClassVar[None] # type: ignore[assignment]
def check_content(self, module: _RstLanguageModule) -> None: ... # type: ignore[override]

get_language: RstLanguageImporter
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/af.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ar.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ca.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/cs.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/da.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/de.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/en.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/eo.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/es.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/fa.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/fi.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/fr.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/gl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/he.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/it.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ja.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ka.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ko.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/lt.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/lv.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/nl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/pl.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/pt_br.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
5 changes: 5 additions & 0 deletions 5 stubs/docutils/docutils/parsers/rst/languages/ru.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from typing import Final

__docformat__: Final = "reStructuredText"
directives: dict[str, str]
roles: dict[str, str]
Loading
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.