summaryrefslogtreecommitdiff
path: root/sphinx/builders/manpage.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+aa-turner@users.noreply.github.com>2022-12-30 21:13:29 +0000
committerAdam Turner <9087854+aa-turner@users.noreply.github.com>2023-01-01 20:48:38 +0000
commit26f79b0d2dd88b353ac65623897bdfbe8bc07cab (patch)
tree0d2f0c752cf1f49a45cde1d7f414d75a6114f1ce /sphinx/builders/manpage.py
parentf4c8a0a68e0013808d169357c9f77ebdf19d0f4e (diff)
downloadsphinx-git-26f79b0d2dd88b353ac65623897bdfbe8bc07cab.tar.gz
Use PEP 595 types
Diffstat (limited to 'sphinx/builders/manpage.py')
-rw-r--r--sphinx/builders/manpage.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py
index 24e9f398c..5252d0418 100644
--- a/sphinx/builders/manpage.py
+++ b/sphinx/builders/manpage.py
@@ -4,7 +4,7 @@ from __future__ import annotations
import warnings
from os import path
-from typing import Any, Dict, List, Optional, Set, Tuple, Union
+from typing import Any, Optional, Union
from docutils.frontend import OptionParser
from docutils.io import FileOutput
@@ -32,14 +32,14 @@ class ManualPageBuilder(Builder):
epilog = __('The manual pages are in %(outdir)s.')
default_translator_class = ManualPageTranslator
- supported_image_types: List[str] = []
+ supported_image_types: list[str] = []
def init(self) -> None:
if not self.config.man_pages:
logger.warning(__('no "man_pages" config value found; no manual pages '
'will be written'))
- def get_outdated_docs(self) -> Union[str, List[str]]:
+ def get_outdated_docs(self) -> Union[str, list[str]]:
return 'all manpages' # for now
def get_target_uri(self, docname: str, typ: Optional[str] = None) -> str:
@@ -87,7 +87,7 @@ class ManualPageBuilder(Builder):
encoding='utf-8')
tree = self.env.get_doctree(docname)
- docnames: Set[str] = set()
+ docnames: set[str] = set()
largetree = inline_all_toctrees(self, docnames, docname, tree,
darkgreen, [docname])
largetree.settings = docsettings
@@ -103,14 +103,14 @@ class ManualPageBuilder(Builder):
pass
-def default_man_pages(config: Config) -> List[Tuple[str, str, str, List[str], int]]:
+def default_man_pages(config: Config) -> list[tuple[str, str, str, list[str], int]]:
""" Better default man_pages settings. """
filename = make_filename_from_project(config.project)
return [(config.root_doc, filename, '%s %s' % (config.project, config.release),
[config.author], 1)]
-def setup(app: Sphinx) -> Dict[str, Any]:
+def setup(app: Sphinx) -> dict[str, Any]:
app.add_builder(ManualPageBuilder)
app.add_config_value('man_pages', default_man_pages, False)