mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '5.x'
This commit is contained in:
commit
51927bb6e4
@ -1,10 +1,14 @@
|
||||
version: 2
|
||||
|
||||
build:
|
||||
os: ubuntu-22.04
|
||||
tools:
|
||||
python: "3"
|
||||
|
||||
formats:
|
||||
- pdf
|
||||
|
||||
python:
|
||||
version: 3
|
||||
install:
|
||||
- method: pip
|
||||
path: .
|
||||
|
8
CHANGES
8
CHANGES
@ -42,7 +42,13 @@ Bugs fixed
|
||||
Testing
|
||||
--------
|
||||
|
||||
Release 5.2.1 (released Sep 24, 2022)
|
||||
Release 5.2.2 (released Sep 27, 2022)
|
||||
=====================================
|
||||
|
||||
* #10872: Restore link targets for autodoc modules to the top of content.
|
||||
Patch by Dominic Davis-Foster.
|
||||
|
||||
Release 5.2.1 (released Sep 25, 2022)
|
||||
=====================================
|
||||
|
||||
Bugs fixed
|
||||
|
@ -34,6 +34,7 @@ classifiers = [
|
||||
"Programming Language :: Python :: 3.8",
|
||||
"Programming Language :: Python :: 3.9",
|
||||
"Programming Language :: Python :: 3.10",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
"Framework :: Setuptools Plugin",
|
||||
@ -85,7 +86,7 @@ lint = [
|
||||
"flake8-bugbear",
|
||||
"flake8-simplify",
|
||||
"isort",
|
||||
"mypy>=0.971",
|
||||
"mypy>=0.981",
|
||||
"sphinx-lint",
|
||||
"docutils-stubs",
|
||||
"types-typed-ast",
|
||||
|
@ -337,13 +337,10 @@ class Sphinx:
|
||||
self.phase = BuildPhase.READING
|
||||
try:
|
||||
if force_all:
|
||||
self.builder.compile_all_catalogs()
|
||||
self.builder.build_all()
|
||||
elif filenames:
|
||||
self.builder.compile_specific_catalogs(filenames)
|
||||
self.builder.build_specific(filenames)
|
||||
else:
|
||||
self.builder.compile_update_catalogs()
|
||||
self.builder.build_update()
|
||||
|
||||
self.events.emit('build-finished', None)
|
||||
|
@ -252,6 +252,7 @@ class Builder:
|
||||
message = __('targets for %d po files that are specified') % len(catalogs)
|
||||
self.compile_catalogs(catalogs, message)
|
||||
|
||||
# TODO(stephenfin): This would make more sense as 'compile_outdated_catalogs'
|
||||
def compile_update_catalogs(self) -> None:
|
||||
repo = CatalogRepository(self.srcdir, self.config.locale_dirs,
|
||||
self.config.language, self.config.source_encoding)
|
||||
@ -263,37 +264,44 @@ class Builder:
|
||||
|
||||
def build_all(self) -> None:
|
||||
"""Build all source files."""
|
||||
self.compile_all_catalogs()
|
||||
|
||||
self.build(None, summary=__('all source files'), method='all')
|
||||
|
||||
def build_specific(self, filenames: List[str]) -> None:
|
||||
"""Only rebuild as much as needed for changes in the *filenames*."""
|
||||
# bring the filenames to the canonical format, that is,
|
||||
# relative to the source directory and without source_suffix.
|
||||
dirlen = len(self.srcdir) + 1
|
||||
to_write = []
|
||||
suffixes: Tuple[str] = tuple(self.config.source_suffix) # type: ignore
|
||||
docnames: List[str] = []
|
||||
|
||||
for filename in filenames:
|
||||
filename = path.normpath(path.abspath(filename))
|
||||
|
||||
if not path.isfile(filename):
|
||||
logger.warning(__('file %r given on command line does not exist, '),
|
||||
filename)
|
||||
continue
|
||||
|
||||
if not filename.startswith(self.srcdir):
|
||||
logger.warning(__('file %r given on command line is not under the '
|
||||
'source directory, ignoring'), filename)
|
||||
continue
|
||||
if not path.isfile(filename):
|
||||
logger.warning(__('file %r given on command line does not exist, '
|
||||
'ignoring'), filename)
|
||||
|
||||
docname = self.env.path2doc(filename)
|
||||
if not docname:
|
||||
logger.warning(__('file %r given on command line is not a valid '
|
||||
'document, ignoring'), filename)
|
||||
continue
|
||||
filename = filename[dirlen:]
|
||||
for suffix in suffixes:
|
||||
if filename.endswith(suffix):
|
||||
filename = filename[:-len(suffix)]
|
||||
break
|
||||
filename = filename.replace(path.sep, SEP)
|
||||
to_write.append(filename)
|
||||
self.build(to_write, method='specific',
|
||||
summary=__('%d source files given on command line') % len(to_write))
|
||||
|
||||
docnames.append(docname)
|
||||
|
||||
self.compile_specific_catalogs(filenames)
|
||||
|
||||
self.build(docnames, method='specific',
|
||||
summary=__('%d source files given on command line') % len(docnames))
|
||||
|
||||
def build_update(self) -> None:
|
||||
"""Only rebuild what was changed or added since last build."""
|
||||
self.compile_update_catalogs()
|
||||
|
||||
to_build = self.get_outdated_docs()
|
||||
if isinstance(to_build, str):
|
||||
self.build(['__all__'], to_build)
|
||||
|
@ -209,16 +209,7 @@ def build_main(argv: List[str] = sys.argv[1:]) -> int:
|
||||
if not args.doctreedir:
|
||||
args.doctreedir = os.path.join(args.outputdir, '.doctrees')
|
||||
|
||||
# handle remaining filename arguments
|
||||
filenames = args.filenames
|
||||
missing_files = []
|
||||
for filename in filenames:
|
||||
if not os.path.isfile(filename):
|
||||
missing_files.append(filename)
|
||||
if missing_files:
|
||||
parser.error(__('cannot find files %r') % missing_files)
|
||||
|
||||
if args.force_all and filenames:
|
||||
if args.force_all and args.filenames:
|
||||
parser.error(__('cannot combine -a option and filenames'))
|
||||
|
||||
if args.color == 'no' or (args.color == 'auto' and not color_terminal()):
|
||||
@ -276,7 +267,7 @@ def build_main(argv: List[str] = sys.argv[1:]) -> int:
|
||||
warning, args.freshenv, args.warningiserror,
|
||||
args.tags, args.verbosity, args.jobs, args.keep_going,
|
||||
args.pdb)
|
||||
app.build(args.force_all, filenames)
|
||||
app.build(args.force_all, args.filenames)
|
||||
return app.statuscode
|
||||
except (Exception, KeyboardInterrupt) as exc:
|
||||
handle_exception(app, args, exc, error)
|
||||
|
@ -298,7 +298,7 @@ class JSModule(SphinxDirective):
|
||||
content_node.document = self.state.document
|
||||
nested_parse_with_titles(self.state, self.content, content_node)
|
||||
|
||||
ret: List[Node] = [*content_node.children]
|
||||
ret: List[Node] = []
|
||||
if not noindex:
|
||||
domain = cast(JavaScriptDomain, self.env.get_domain('js'))
|
||||
|
||||
@ -315,6 +315,7 @@ class JSModule(SphinxDirective):
|
||||
indextext = _('%s (module)') % mod_name
|
||||
inode = addnodes.index(entries=[('single', indextext, node_id, '', None)])
|
||||
ret.append(inode)
|
||||
ret.extend(content_node.children)
|
||||
return ret
|
||||
|
||||
def make_old_id(self, modname: str) -> str:
|
||||
|
@ -1007,7 +1007,7 @@ class PyModule(SphinxDirective):
|
||||
content_node.document = self.state.document
|
||||
nested_parse_with_titles(self.state, self.content, content_node)
|
||||
|
||||
ret: List[Node] = [*content_node.children]
|
||||
ret: List[Node] = []
|
||||
if not noindex:
|
||||
# note module to the domain
|
||||
node_id = make_id(self.env, self.state.document, 'module', modname)
|
||||
@ -1028,6 +1028,7 @@ class PyModule(SphinxDirective):
|
||||
indextext = '%s; %s' % (pairindextypes['module'], modname)
|
||||
inode = addnodes.index(entries=[('pair', indextext, node_id, '', None)])
|
||||
ret.append(inode)
|
||||
ret.extend(content_node.children)
|
||||
return ret
|
||||
|
||||
def make_old_id(self, name: str) -> str:
|
||||
|
@ -47,7 +47,7 @@ class GenericObject(ObjectDescription[str]):
|
||||
A generic x-ref directive registered with Sphinx.add_object_type().
|
||||
"""
|
||||
indextemplate: str = ''
|
||||
parse_node: Callable[["GenericObject", "BuildEnvironment", str, desc_signature], str] = None # NOQA
|
||||
parse_node: Callable[["BuildEnvironment", str, desc_signature], str] = None # NOQA
|
||||
|
||||
def handle_signature(self, sig: str, signode: desc_signature) -> str:
|
||||
if self.parse_node:
|
||||
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user