Commit Graph

4063 Commits

Author SHA1 Message Date
Takeshi KOMIYA
7da429924e Fix testcase in py36 case 2021-12-26 20:34:05 +09:00
Takeshi KOMIYA
2ea9118181 refactor: Merge arguments of sphinx.util.typing:stringify() 2021-12-26 03:11:39 +09:00
Takeshi KOMIYA
bdbad40f57 Fix #9194: autodoc: Prepend the "typing" module name on the signature
To create hyperlinks to container types automatically, this prepends the
module names for the types under "typing" module.
2021-12-26 01:04:40 +09:00
Takeshi KOMIYA
b5bf745f68 Close #10013: html: Allow to change the loading method of JavaScript 2021-12-25 23:41:02 +09:00
Takeshi KOMIYA
0a5783f75b py domain: Suppress the leading "typing." module from typehints
To support creating hyperlinks to container types naturally, py domain
should take fully-qualified typehints for them.  But nobody wants to
show "typing." module name on the signature. So this suppresses them
automatically.
2021-12-25 02:50:31 +09:00
Takeshi KOMIYA
94cbce69da Fix #9194: autodoc: types in typing module are not hyperlinked
This converts types in typing module to valid references when
`autodoc_unqualified_typehints` option enabled.
2021-12-25 02:50:31 +09:00
Takeshi KOMIYA
49f576569c Fix autodoc: Failed to parse Literal type in py36 and py37 2021-12-25 02:41:38 +09:00
Takeshi KOMIYA
a87153c018 autodoc: Rename autodoc_unqualified_typehints to autodoc_typehints_format (refs: #9931) 2021-12-24 10:14:19 +09:00
Takeshi KOMIYA
e3ee8b378a Close #9993: std domain: Allow to refer an inline target via ref role 2021-12-21 02:51:59 +09:00
Takeshi KOMIYA
40db5694fa
Merge pull request #9992 from tk0miya/debug_print
test: Remove debug print
2021-12-19 18:31:52 +09:00
Takeshi KOMIYA
627d73a683 test: Remove debug print 2021-12-19 18:15:56 +09:00
Takeshi KOMIYA
cacbca6dd4
Merge pull request #9987 from tk0miya/9968_ivar_not_shown
Fix #9968: autodoc: ivars are not shown if __init__ has posonlyargs
2021-12-19 13:18:58 +09:00
Takeshi KOMIYA
e7e08d2a78 Fix #9968: autodoc: ivars are not shown if __init__ has posonlyargs 2021-12-19 12:53:15 +09:00
Takeshi KOMIYA
a9a9bd2563 Fix #9979: Error level messages were displayed as warning messages 2021-12-17 02:10:21 +09:00
Takeshi KOMIYA
8d0fd9e74a Merge branch '4.3.x' into 4.x 2021-12-17 02:09:04 +09:00
Takeshi KOMIYA
3626c75de0
Merge pull request #9957 from tk0miya/refactor_DeprecationWarnings
Reduce DeprecationWarnings
2021-12-16 01:38:32 +09:00
Takeshi KOMIYA
8e23b03263 refactor: texinfo: Remove CR char from output
The CR character was added for readability of output.  But it makes the
texinfo writer a bit complicated.  This removes it from output to keep
our code simple (reducing conditions).
2021-12-11 23:05:36 +09:00
Takeshi KOMIYA
5563f672ec Merge branch '4.x' into fix-footnote-in-info 2021-12-11 22:59:56 +09:00
Takeshi KOMIYA
dcfc3f60ec refactor: ssl.wrap_context() has been deprecated now 2021-12-11 11:38:24 +09:00
Takeshi KOMIYA
555e74b8ca refactor: app.html_themes was replaced by registry.html_themes 2021-12-11 11:38:24 +09:00
Takeshi KOMIYA
4c7df3f09a
Merge pull request #9793 from samdoran/enable-parallel-on-macos
Set multiprocessing start method to `fork`
2021-12-11 11:23:34 +09:00
Takeshi KOMIYA
d3162d1ff2
Merge pull request #9931 from tk0miya/9075_autodoc_unqualified_typehints
Close #9075: autodoc: Add a config variable autodoc_unqualified_typehints
2021-12-11 10:59:23 +09:00
Takeshi KOMIYA
9c6ebdf347 Fix flake8 warnings 2021-12-11 10:33:07 +09:00
Takeshi KOMIYA
8d071a8e8f
Merge branch '4.x' into texinfo-add-texinfo_emit_document_references 2021-12-11 10:27:50 +09:00
Takeshi KOMIYA
b232b00cf8
Merge pull request #9391 from marxin/info-samp-with-variable
texinfo: improve variable in :samp: directives
2021-12-11 10:25:07 +09:00
Christian Roth
10023da895 linkcheck: Exclude links from matched documents 2021-12-08 10:01:45 +01:00
Takeshi KOMIYA
c71ff1cd21 Close #9075: autodoc: Add a config variable autodoc_unqualified_typehints
If autodoc_unqualified_typehints feature enabled, autodoc suppresses the
leading module names of typehints of function signatures (ex.
`io.StringIO` -> `StringIO`)
2021-12-03 18:05:49 +09:00
Takeshi KOMIYA
5aa6cbbca8 Add unqualified_typehints parameter to stringify_signature()
To make the generated function signatures simple, this adds a new
parameter `unqualified_typehints` to sphinx.util.inspect:
stringify_signature() to suppress the leading module name of
typehints.
2021-12-03 18:05:49 +09:00
Takeshi KOMIYA
80f79aef91 Add smartref parameter to sphinx.util.typing:stringify()
To make the generated function signatures simple, this adds a new
parameter `smartref` to sphinx.util.typing:stringify() to suppress the
leading module name from typehints.
2021-12-03 18:05:49 +09:00
Jakob Lykke Andersen
f8f26286ad C, simple type specifier parsing, handling macro-keywords 2021-12-01 19:33:23 +01:00
Jakob Lykke Andersen
c09643c21f C, fix parsing of fundamental types
When multiple simple type specifiers are part of the type,
then they may appear in any order.
2021-11-30 22:00:54 +01:00
Jakob Lykke Andersen
67d673406f C++, fix parsing of fundamental types
When multiple simple type specifiers are part of the type,
then they may appear in any order.
2021-11-30 22:00:20 +01:00
Kian-Meng, Ang
5161341b3e Fix typos 2021-11-30 05:48:44 +08:00
Takeshi KOMIYA
5eaed2bed7 py domain: Allow "~" prefix as a prefix of typehints in signature
Now python domain supports the "~" prefix at the beginning of the
typehints of the function signatures:

  .. py:function:: func(x: ~typing.Dict)

It's rescognized as the same as python reference roles do
(ex. :py:class:`~typing.Dict`).
2021-11-30 01:54:23 +09:00
Takeshi KOMIYA
a3edc982c1
Merge pull request #9902 from tk0miya/9899_pydomain_crossref_specifier_in_typefield
Fix #9899: py domain: Allows cross-reference specifier to :type: option
2021-11-30 01:43:51 +09:00
Takeshi KOMIYA
e8e45a3678
Merge pull request #9905 from tk0miya/9883_ismock
Fix #9883: autodoc: doccomment for the alias to mocked object was ignored
2021-11-30 01:37:41 +09:00
Takeshi KOMIYA
e25589ca1d
Merge branch '4.x' into 9899_pydomain_crossref_specifier_in_typefield 2021-11-30 01:37:04 +09:00
Takeshi KOMIYA
74d912133a
Merge pull request #9800 from hoefling/extlinks/replacements-check
Proposal: check if hardcoded URLs can be replaced with extlinks
2021-11-29 09:36:55 +09:00
Takeshi KOMIYA
f88ac53e51 Fix #9883: autodoc: doccomment for the alias to mocked object was ignored 2021-11-29 02:06:16 +09:00
Takeshi KOMIYA
acaf70596e Fix #9899: py domain: Allows cross-reference specifier to :type: option 2021-11-29 00:32:56 +09:00
Takeshi KOMIYA
17467b7ae2 test: Try to import nodes.meta first (for the latest docutils) 2021-11-28 13:01:50 +09:00
Takeshi KOMIYA
2b0ba5089b Merge remote-tracking branch 'origin/4.x' into 4.x 2021-11-26 02:55:56 +09:00
Takeshi KOMIYA
f2295d2f07 Merge branch '4.3.x' into 4.x 2021-11-26 02:55:41 +09:00
Takeshi KOMIYA
15d834e4d8
Merge pull request #9831 from Yoshanuikabundi/autosummary___all__
Allow autosummary to respect __all__
2021-11-26 02:15:43 +09:00
Takeshi KOMIYA
c8f019ab50 Fix #9868: ImportError on testing sphinx.util.inspect
In some Linux distribution, ImportError is raised on testing
sphinx.util.inspect because _testcapi is not installed.
2021-11-23 18:22:08 +09:00
Takeshi KOMIYA
259de307ca Merge branch '4.3.x' into 4.x 2021-11-23 18:17:13 +09:00
Josh Mitchell
73b7cd51ea Fix lints and reorder args of members_of 2021-11-22 13:57:56 +11:00
Takeshi KOMIYA
fb92547b91 Fix #9866: autodoc: doccoment for the imported class was ignored
Autodoc tried to scan doccomment on the module where the class defined.
But it failed to get it if the class is imported from other module.

This analyzes the target module to obtain the doccomment.
2021-11-21 18:50:54 +09:00
Takeshi KOMIYA
e2c6146b3e Fix #9864: mathjax: Failed to render equations via MathJax v2
MathJax library has been loaded via "defer" method since v4.3.0.  But
it prevents to work MathJax v2.  This rollbacks the change and use
"async" method as default again.

To support changing the loading method, this allows to specify it via
mathjax_options.
2021-11-21 18:27:35 +09:00
Matt Ficke
2ed4bed33a Update RFC base url
The tools.ietf.org subdomain is being wound down and services are moving to
datatracker.ietf.org. Links to RFC documents using the old subdomain are being
redirected to datatracker; this updates the configured `rfc_base_url` to
point to the current subdomain.

Discussion: https://mailarchive.ietf.org/arch/msg/ietf/0n-6EXEmkTp3Uv_vj-5Vnm3o0bo/
2021-11-16 10:52:02 -05:00
Josh Mitchell
8e45229fee Fixed missed ignore___all__ -> ignore_module_all 2021-11-15 13:27:26 +11:00
Josh Mitchell
79089b5fa4 Corrections from review by tk0miya 2021-11-15 13:18:47 +11:00
Josh Mitchell
ad0071ddb7 #2021: Allow autosummary to respect __all__ 2021-11-15 13:16:33 +11:00
Martin Liska
9ec829fb50 texinfo: simplify reference emission.
The commit adds a new config value 'texinfo_emit_document_references'
that blocks the emission of inline references and make it better readable
with legacy stand-alone reader ``info``.

Before the change we emit:
Default option value for @ref{e,,-Wshift-overflow3}.

while with texinfo_emit_document_references == True:
Default option value for -Wshift-overflow3.

It addresses limitations mentioned in Sphinx' FAQ:
https://www.sphinx-doc.org/en/master/faq.html#texinfo-info
2021-11-12 14:00:48 +01:00
oleg.hoefling
8356260554
extlinks: replacement suggestions for hardcoded links
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
2021-11-12 09:38:59 +01:00
Takeshi KOMIYA
1317eeedae
Merge pull request #9828 from tk0miya/9618_gettext_allow_fuzzy_translations
Close #9618: i18n: Add gettext_allow_fuzzy_translations
2021-11-10 01:45:07 +09:00
Takeshi KOMIYA
563936b969
Merge pull request #9829 from tk0miya/9450_load_mathjax_as_defer
Close #9450: mathjax: Load MathJax via "defer" strategy
2021-11-10 01:32:43 +09:00
Takeshi KOMIYA
203094b4c3 Close #9618: i18n: Add gettext_allow_fuzzy_translations 2021-11-10 01:32:02 +09:00
Takeshi KOMIYA
4cd19b8274 Close #9450: mathjax: Load MathJax via "defer" strategy
To allow configure MathJax via static JS file, it should be loaded via
"defer" strategy.
2021-11-09 01:54:56 +09:00
Martin Liska
faed8cb8db texinfo: improve variable in :samp: directives
The following snippet:
Show :samp:`Samp with a {variable}.`

Ends in .info as:
Show ‘Samp with a `variable'.’

Which is suboptimal and @var{variable} should be rather used.
That results in ‘Samp with a VARIABLE.’.
2021-11-08 11:30:44 +01:00
Takeshi KOMIYA
ee1cae8c1c Replace distutils.versions.LooseVersion by packaging.version.Version
Distutils module are now deprecated and will be removed in Python 3.12.
This replaces it by packaging module and reduces the dependency to it.

refs: #9820
2021-11-07 20:15:07 +09:00
Takeshi KOMIYA
1f91a0f8bd
Merge pull request #9799 from tk0miya/9781_autodoc_preserve_hexadecimal
Fix #9781: autodoc_preserve_defaults does not support hexadecimal
2021-11-01 00:58:33 +09:00
Jakob Lykke Andersen
56002be5e1 rename intersphinx_disabled_{refs -> reftypes}
And change format for domains to {name}:*
2021-10-31 13:56:26 +01:00
Jakob Lykke Andersen
cfbac2ceaa intersphinx_disabled_refs, rename 'all' to '*' 2021-10-31 13:23:23 +01:00
Jakob Lykke Andersen
0d9f4cd469 Generalize to disable specific refs as well. 2021-10-31 13:15:47 +01:00
Jakob Lykke Andersen
f22faa7e06 Add intersphinx_disabled_domains
Fixes sphinx-doc/sphinx#2068
Replaces sphinx-doc/sphinx#8981
2021-10-31 13:15:47 +01:00
Jakob Lykke Andersen
961f5af096 Intersphinx, refactoring
Also, when a reference is unresolved, don't strip the inventory prefix.
2021-10-31 13:15:46 +01:00
Takeshi KOMIYA
4475dab99e
Merge pull request #9656 from sdhiscocks/suppress_warning_subtype_none
Fix issue with warnings without subtype being incorrectly suppressed
2021-10-31 15:51:14 +09:00
Takeshi KOMIYA
cda266333e
Merge pull request #9798 from tk0miya/9775_Literal
Fix #9775: py domain: Literal typehint was converted to a cross reference
2021-10-31 15:43:19 +09:00
Takeshi KOMIYA
b8844eb339 Fix #9781: autodoc_preserve_defaults does not support hexadecimal 2021-10-31 01:11:56 +09:00
Takeshi KOMIYA
52787deb32 Fix #9775: py domain: Literal typehint was converted to a cross reference 2021-10-30 16:57:33 +09:00
Takeshi KOMIYA
3c5b31b50d Fix #9757: autodoc_inherit_docstrings does not effect to overriden classmethods 2021-10-30 02:01:38 +09:00
Sam Doran
83225767cb Set multiprocessing start method to fork
Since the current code requires forking, set it explicitly rather than disabling
parallelization on macOS.
2021-10-28 12:38:56 -04:00
Takeshi KOMIYA
b778ee806e Fix #9752: autodoc: Failed to detect type annotation for slots attribute 2021-10-23 14:59:36 +09:00
Takeshi KOMIYA
179e0bf8a2 refactor: Node.traverse() will returns generator since 0.18 2021-10-10 15:50:39 +09:00
Takeshi KOMIYA
2e36027474
Merge branch '4.x' into 9708_needs_extension_logic 2021-10-09 15:17:23 +09:00
Takeshi KOMIYA
3c9e53852d Fix #9708: needs_extension failed to check double-digit version correctly 2021-10-09 14:59:05 +09:00
Takeshi KOMIYA
2a7775dbb8 Merge branch '4.x' into 9697_property_with_parens 2021-10-09 14:49:57 +09:00
Takeshi KOMIYA
2760b3bb79 test: Support python-3.11 2021-10-09 14:41:39 +09:00
Takeshi KOMIYA
34f957f131
Merge branch '4.x' into 9697_property_with_parens 2021-10-09 14:00:39 +09:00
Takeshi KOMIYA
7f6d8e97cb
Merge pull request #9701 from tk0miya/docutils-0.18
Follow new structure of docutils-0.18
2021-10-09 13:55:32 +09:00
Takeshi KOMIYA
335f95afde Support docutils-0.18; Meta directive and meta node has moved 2021-10-03 19:18:53 +09:00
Jakob Lykke Andersen
a64196f048 js/py nodes, update arglist rendering 2021-10-03 10:17:31 +02:00
Jakob Lykke Andersen
06d3d7356e js nodes, update name rendering 2021-10-03 10:17:31 +02:00
Jakob Lykke Andersen
37083fcc1a js nodes, update display_prefix 2021-10-03 10:17:31 +02:00
Takeshi KOMIYA
b9204186f0 Fix #9697: An index entry with parens was registered for py:method 2021-10-03 13:03:23 +09:00
Jakob Lykke Andersen
fb45dba61e py nodes, isort fix 2021-10-02 12:42:17 +02:00
Jakob Lykke Andersen
01ef6a437f py nodes, PyObject anno 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
ae7865aaf8 py nodes, PyProperty get_signature_prefix 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
5a3b7f130d py nodes, PyMethod get_signature_prefix 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
51e7b6d2aa py nodes, PyClassLike, get_signature_prefix 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
83fcc98dbc py nodes, PyFunction get_signature_prefix 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
8cd0847590 py nodes, PyProperty 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
73ade60654 py nodes, PyAttribute value 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
2e37c5719d py nodes, PyAttribute type 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
e008b43683 py nodes, PyVariable value 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
3979bbad7f py nodes, PyVariable type 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
3a1bd32665 py nodes, arglist 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
92a9df7451 py nodes, Tuple 2021-10-02 12:41:40 +02:00
Jakob Lykke Andersen
c00e608783 py nodes, List 2021-10-02 12:41:40 +02:00