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
|
version: 2
|
||||||
|
|
||||||
|
build:
|
||||||
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
|
python: "3"
|
||||||
|
|
||||||
formats:
|
formats:
|
||||||
- pdf
|
- pdf
|
||||||
|
|
||||||
python:
|
python:
|
||||||
version: 3
|
|
||||||
install:
|
install:
|
||||||
- method: pip
|
- method: pip
|
||||||
path: .
|
path: .
|
||||||
|
8
CHANGES
8
CHANGES
@ -42,7 +42,13 @@ Bugs fixed
|
|||||||
Testing
|
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
|
Bugs fixed
|
||||||
|
@ -34,6 +34,7 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: 3.8",
|
"Programming Language :: Python :: 3.8",
|
||||||
"Programming Language :: Python :: 3.9",
|
"Programming Language :: Python :: 3.9",
|
||||||
"Programming Language :: Python :: 3.10",
|
"Programming Language :: Python :: 3.10",
|
||||||
|
"Programming Language :: Python :: 3.11",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Programming Language :: Python :: Implementation :: PyPy",
|
"Programming Language :: Python :: Implementation :: PyPy",
|
||||||
"Framework :: Setuptools Plugin",
|
"Framework :: Setuptools Plugin",
|
||||||
@ -85,7 +86,7 @@ lint = [
|
|||||||
"flake8-bugbear",
|
"flake8-bugbear",
|
||||||
"flake8-simplify",
|
"flake8-simplify",
|
||||||
"isort",
|
"isort",
|
||||||
"mypy>=0.971",
|
"mypy>=0.981",
|
||||||
"sphinx-lint",
|
"sphinx-lint",
|
||||||
"docutils-stubs",
|
"docutils-stubs",
|
||||||
"types-typed-ast",
|
"types-typed-ast",
|
||||||
|
@ -337,13 +337,10 @@ class Sphinx:
|
|||||||
self.phase = BuildPhase.READING
|
self.phase = BuildPhase.READING
|
||||||
try:
|
try:
|
||||||
if force_all:
|
if force_all:
|
||||||
self.builder.compile_all_catalogs()
|
|
||||||
self.builder.build_all()
|
self.builder.build_all()
|
||||||
elif filenames:
|
elif filenames:
|
||||||
self.builder.compile_specific_catalogs(filenames)
|
|
||||||
self.builder.build_specific(filenames)
|
self.builder.build_specific(filenames)
|
||||||
else:
|
else:
|
||||||
self.builder.compile_update_catalogs()
|
|
||||||
self.builder.build_update()
|
self.builder.build_update()
|
||||||
|
|
||||||
self.events.emit('build-finished', None)
|
self.events.emit('build-finished', None)
|
||||||
|
@ -252,6 +252,7 @@ class Builder:
|
|||||||
message = __('targets for %d po files that are specified') % len(catalogs)
|
message = __('targets for %d po files that are specified') % len(catalogs)
|
||||||
self.compile_catalogs(catalogs, message)
|
self.compile_catalogs(catalogs, message)
|
||||||
|
|
||||||
|
# TODO(stephenfin): This would make more sense as 'compile_outdated_catalogs'
|
||||||
def compile_update_catalogs(self) -> None:
|
def compile_update_catalogs(self) -> None:
|
||||||
repo = CatalogRepository(self.srcdir, self.config.locale_dirs,
|
repo = CatalogRepository(self.srcdir, self.config.locale_dirs,
|
||||||
self.config.language, self.config.source_encoding)
|
self.config.language, self.config.source_encoding)
|
||||||
@ -263,37 +264,44 @@ class Builder:
|
|||||||
|
|
||||||
def build_all(self) -> None:
|
def build_all(self) -> None:
|
||||||
"""Build all source files."""
|
"""Build all source files."""
|
||||||
|
self.compile_all_catalogs()
|
||||||
|
|
||||||
self.build(None, summary=__('all source files'), method='all')
|
self.build(None, summary=__('all source files'), method='all')
|
||||||
|
|
||||||
def build_specific(self, filenames: List[str]) -> None:
|
def build_specific(self, filenames: List[str]) -> None:
|
||||||
"""Only rebuild as much as needed for changes in the *filenames*."""
|
"""Only rebuild as much as needed for changes in the *filenames*."""
|
||||||
# bring the filenames to the canonical format, that is,
|
docnames: List[str] = []
|
||||||
# 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
|
|
||||||
for filename in filenames:
|
for filename in filenames:
|
||||||
filename = path.normpath(path.abspath(filename))
|
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):
|
if not filename.startswith(self.srcdir):
|
||||||
logger.warning(__('file %r given on command line is not under the '
|
logger.warning(__('file %r given on command line is not under the '
|
||||||
'source directory, ignoring'), filename)
|
'source directory, ignoring'), filename)
|
||||||
continue
|
continue
|
||||||
if not path.isfile(filename):
|
|
||||||
logger.warning(__('file %r given on command line does not exist, '
|
docname = self.env.path2doc(filename)
|
||||||
'ignoring'), filename)
|
if not docname:
|
||||||
|
logger.warning(__('file %r given on command line is not a valid '
|
||||||
|
'document, ignoring'), filename)
|
||||||
continue
|
continue
|
||||||
filename = filename[dirlen:]
|
|
||||||
for suffix in suffixes:
|
docnames.append(docname)
|
||||||
if filename.endswith(suffix):
|
|
||||||
filename = filename[:-len(suffix)]
|
self.compile_specific_catalogs(filenames)
|
||||||
break
|
|
||||||
filename = filename.replace(path.sep, SEP)
|
self.build(docnames, method='specific',
|
||||||
to_write.append(filename)
|
summary=__('%d source files given on command line') % len(docnames))
|
||||||
self.build(to_write, method='specific',
|
|
||||||
summary=__('%d source files given on command line') % len(to_write))
|
|
||||||
|
|
||||||
def build_update(self) -> None:
|
def build_update(self) -> None:
|
||||||
"""Only rebuild what was changed or added since last build."""
|
"""Only rebuild what was changed or added since last build."""
|
||||||
|
self.compile_update_catalogs()
|
||||||
|
|
||||||
to_build = self.get_outdated_docs()
|
to_build = self.get_outdated_docs()
|
||||||
if isinstance(to_build, str):
|
if isinstance(to_build, str):
|
||||||
self.build(['__all__'], to_build)
|
self.build(['__all__'], to_build)
|
||||||
|
@ -209,16 +209,7 @@ def build_main(argv: List[str] = sys.argv[1:]) -> int:
|
|||||||
if not args.doctreedir:
|
if not args.doctreedir:
|
||||||
args.doctreedir = os.path.join(args.outputdir, '.doctrees')
|
args.doctreedir = os.path.join(args.outputdir, '.doctrees')
|
||||||
|
|
||||||
# handle remaining filename arguments
|
if args.force_all and args.filenames:
|
||||||
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:
|
|
||||||
parser.error(__('cannot combine -a option and filenames'))
|
parser.error(__('cannot combine -a option and filenames'))
|
||||||
|
|
||||||
if args.color == 'no' or (args.color == 'auto' and not color_terminal()):
|
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,
|
warning, args.freshenv, args.warningiserror,
|
||||||
args.tags, args.verbosity, args.jobs, args.keep_going,
|
args.tags, args.verbosity, args.jobs, args.keep_going,
|
||||||
args.pdb)
|
args.pdb)
|
||||||
app.build(args.force_all, filenames)
|
app.build(args.force_all, args.filenames)
|
||||||
return app.statuscode
|
return app.statuscode
|
||||||
except (Exception, KeyboardInterrupt) as exc:
|
except (Exception, KeyboardInterrupt) as exc:
|
||||||
handle_exception(app, args, exc, error)
|
handle_exception(app, args, exc, error)
|
||||||
|
@ -298,7 +298,7 @@ class JSModule(SphinxDirective):
|
|||||||
content_node.document = self.state.document
|
content_node.document = self.state.document
|
||||||
nested_parse_with_titles(self.state, self.content, content_node)
|
nested_parse_with_titles(self.state, self.content, content_node)
|
||||||
|
|
||||||
ret: List[Node] = [*content_node.children]
|
ret: List[Node] = []
|
||||||
if not noindex:
|
if not noindex:
|
||||||
domain = cast(JavaScriptDomain, self.env.get_domain('js'))
|
domain = cast(JavaScriptDomain, self.env.get_domain('js'))
|
||||||
|
|
||||||
@ -315,6 +315,7 @@ class JSModule(SphinxDirective):
|
|||||||
indextext = _('%s (module)') % mod_name
|
indextext = _('%s (module)') % mod_name
|
||||||
inode = addnodes.index(entries=[('single', indextext, node_id, '', None)])
|
inode = addnodes.index(entries=[('single', indextext, node_id, '', None)])
|
||||||
ret.append(inode)
|
ret.append(inode)
|
||||||
|
ret.extend(content_node.children)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def make_old_id(self, modname: str) -> str:
|
def make_old_id(self, modname: str) -> str:
|
||||||
|
@ -1007,7 +1007,7 @@ class PyModule(SphinxDirective):
|
|||||||
content_node.document = self.state.document
|
content_node.document = self.state.document
|
||||||
nested_parse_with_titles(self.state, self.content, content_node)
|
nested_parse_with_titles(self.state, self.content, content_node)
|
||||||
|
|
||||||
ret: List[Node] = [*content_node.children]
|
ret: List[Node] = []
|
||||||
if not noindex:
|
if not noindex:
|
||||||
# note module to the domain
|
# note module to the domain
|
||||||
node_id = make_id(self.env, self.state.document, 'module', modname)
|
node_id = make_id(self.env, self.state.document, 'module', modname)
|
||||||
@ -1028,6 +1028,7 @@ class PyModule(SphinxDirective):
|
|||||||
indextext = '%s; %s' % (pairindextypes['module'], modname)
|
indextext = '%s; %s' % (pairindextypes['module'], modname)
|
||||||
inode = addnodes.index(entries=[('pair', indextext, node_id, '', None)])
|
inode = addnodes.index(entries=[('pair', indextext, node_id, '', None)])
|
||||||
ret.append(inode)
|
ret.append(inode)
|
||||||
|
ret.extend(content_node.children)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def make_old_id(self, name: str) -> str:
|
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().
|
A generic x-ref directive registered with Sphinx.add_object_type().
|
||||||
"""
|
"""
|
||||||
indextemplate: str = ''
|
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:
|
def handle_signature(self, sig: str, signode: desc_signature) -> str:
|
||||||
if self.parse_node:
|
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