mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
🔧 Narrow typing for Builder.build
method (#12357)
This commit is contained in:
parent
799ae16a01
commit
1e297bb8c5
@ -6,7 +6,7 @@ import codecs
|
||||
import pickle
|
||||
import time
|
||||
from os import path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
|
||||
from docutils import nodes
|
||||
from docutils.utils import DependencyList
|
||||
@ -298,9 +298,9 @@ class Builder:
|
||||
self,
|
||||
docnames: Iterable[str] | None,
|
||||
summary: str | None = None,
|
||||
method: str = 'update',
|
||||
method: Literal['all', 'specific', 'update'] = 'update',
|
||||
) -> None:
|
||||
"""Main build method.
|
||||
"""Main build method, usually called by a specific ``build_*`` method.
|
||||
|
||||
First updates the environment, and then calls
|
||||
:meth:`!write`.
|
||||
@ -537,7 +537,7 @@ class Builder:
|
||||
self,
|
||||
build_docnames: Iterable[str] | None,
|
||||
updated_docnames: Sequence[str],
|
||||
method: str = 'update',
|
||||
method: Literal['all', 'specific', 'update'] = 'update',
|
||||
) -> None:
|
||||
if build_docnames is None or build_docnames == ['__all__']:
|
||||
# build_all
|
||||
|
@ -7,7 +7,7 @@ import time
|
||||
from codecs import open
|
||||
from collections import defaultdict
|
||||
from os import getenv, path, walk
|
||||
from typing import TYPE_CHECKING, Any
|
||||
from typing import TYPE_CHECKING, Any, Literal
|
||||
from uuid import uuid4
|
||||
|
||||
from docutils import nodes
|
||||
@ -261,7 +261,7 @@ class MessageCatalogBuilder(I18nBuilder):
|
||||
self,
|
||||
docnames: Iterable[str] | None,
|
||||
summary: str | None = None,
|
||||
method: str = 'update',
|
||||
method: Literal['all', 'specific', 'update'] = 'update',
|
||||
) -> None:
|
||||
self._extract_from_template()
|
||||
super().build(docnames, summary, method)
|
||||
|
Loading…
Reference in New Issue
Block a user