summaryrefslogtreecommitdiff
path: root/tests/test_domain_py.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow multi-line object description signatures (#11011)TLouf2023-05-111-0/+303
| | | | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com> Co-authored-by: Jean-François B <2589111+jfbu@users.noreply.github.com> Co-authored-by: TLouf <loufthomas@gmail.com>
* Add an option for displaying short ``Literal`` types (#11109)Adam Turner2023-04-051-0/+67
| | | | | | The new ``python_display_short_literal_types`` configuration option for the ``py`` domain controls display of PEP 586 ``Literal`` types. The 'short' format is inspired by PEP 604, using the bitwise OR operator to distinguish the possible legal values for the argument.
* Fix COM812Adam Turner2023-02-181-6/+6
|
* Add ``content_offset`` parameter to ``nested_parse_with_titles`` (#11147)Jeremy Maitin-Shepard2023-02-151-0/+12
| | | | | | | | | | | | | | | | | | | | | | | Previously, ``nested_parse_with_titles`` always passed ``0`` as the input offset when invoking ``nested_parse``. When parsing the content of a directive, as is a common use case for ``nested_parse_with_titles``, this leads to incorrect source file/line number information, as it does not take into account the directive's ``content_offset``, which is always non-zero. This issue affects *all* object descriptions due to GH-10887. It also affects the ``sphinx.ext.ifconfig`` extension. The ``py:module`` and ``js:module`` directives employed a workaround for this issue, by wrapping the calls to ``nested_parse_with_title`` with ``switch_source_input``. That worked, but was more complicated (and likely less efficient) than necessary. This commit adds an optional ``content_offset`` parameter to ``nested_parse_with_titles``, and fixes callers to pass the appropriate content offset when needed. This commit eliminates the now-unnecessary calls to ``switch_source_input`` and instead specifies the correct ``content_offset``.
* Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-8/+27
| | | | This allows using Ruff's import sorting fixers
* Use PEP 604 display for ``typing.Optional`` and ``typing.Union`` (#11072)Adam Turner2023-01-021-4/+5
|
* Drop Python 3.7Adam Turner2022-09-271-34/+27
|
* Clean up after dropping Python 3.6Adam Turner2022-09-271-3/+3
|
* Merge branch '5.x'Adam Turner2022-09-091-4/+4
|\ | | | | | | | | | | | | | | | | # Conflicts: # setup.py # sphinx/application.py # sphinx/environment/__init__.py # sphinx/ext/autodoc/directive.py # tests/test_build_html.py
| * Remove unneeded `noqa` lint suppression comments (#10772)danieleades2022-08-281-4/+4
| |
* | Merge branch '5.x'Jean-François B2022-08-061-0/+72
|\ \ | |/
| * Properly support `of` in docstring type specifiers (#10738)ProGamerGov2022-08-021-0/+72
| | | | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* | Merge branch '5.x' into masterJean-François B2022-06-301-0/+14
|\ \ | |/ | | | | | | | | | | | | Resolved merge conflicts: sphinx/ext/extlinks.py sphinx/ext/napoleon/docstring.py (and removed from the latter a now unused import for flake8 F401 compliance)
| * Ensure ObjectDescription signature nodes include line numbers (#10249)Jeremy Maitin-Shepard2022-06-231-0/+14
| | | | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* | Remove more deprecated items in Sphinx 6.0 (#10562)Adam Turner2022-06-261-21/+8
|/
* Show the repr of the value in some warnings (#10439)Ezio Melotti2022-06-161-3/+3
| | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* Special case `**`Adam Turner2022-06-151-0/+9
|
* Add higher level testAdam Turner2022-06-151-0/+18
|
* Test for issue #10456: removing meta-fieldsAnselm Kruis2022-05-161-0/+2
| | | | | | Add two meta-fields to an appropriate test case. Currently the test fails, because of bug #10456. The next commit fixes the issue.
* `.read_text()` -> `.read_text(encoding='utf8')`Adam Turner2022-04-271-5/+5
|
* Collapse single line docstringsAdam Turner2022-02-201-2/+1
|
* Remove copyright and licence fieldsAdam Turner2022-02-201-3/+0
|
* Fix module docstring indentationAdam Turner2022-02-201-2/+2
|
* Fix module docstring first lineAdam Turner2022-02-201-2/+1
|
* Remove module titles in docstringsAdam Turner2022-02-191-3/+0
|
* test: Migrate to Node.findall() from Node.traverse()Takeshi KOMIYA2022-01-031-3/+3
|
* Merge branch '4.3.x' into 4.xTakeshi KOMIYA2022-01-011-1/+1
|\
| * A happy new year!Takeshi KOMIYA2022-01-011-1/+1
| |
* | Fix py domain: "typing" types are not hyperlinked in info-field-listTakeshi KOMIYA2021-12-271-1/+22
| |
* | py domain: Suppress the leading "typing." module from typehintsTakeshi KOMIYA2021-12-251-2/+2
| | | | | | | | | | | | | | 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.
* | Fix #9194: autodoc: types in typing module are not hyperlinkedTakeshi KOMIYA2021-12-251-1/+3
| | | | | | | | | | This converts types in typing module to valid references when `autodoc_unqualified_typehints` option enabled.
* | Fix autodoc: Failed to parse Literal type in py36 and py37Takeshi KOMIYA2021-12-251-0/+9
|/
* test: Remove debug printTakeshi KOMIYA2021-12-191-1/+0
|
* py domain: Allow "~" prefix as a prefix of typehints in signatureTakeshi KOMIYA2021-11-301-0/+12
| | | | | | | | | | 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`).
* Fix #9899: py domain: Allows cross-reference specifier to :type: optionTakeshi KOMIYA2021-11-291-0/+22
|
* Fix #9775: py domain: Literal typehint was converted to a cross referenceTakeshi KOMIYA2021-10-301-0/+36
|
* Merge branch '4.x' into 9697_property_with_parensTakeshi KOMIYA2021-10-091-68/+101
|\
| * js/py nodes, update arglist renderingJakob Lykke Andersen2021-10-031-3/+3
| |
| * py nodes, isort fixJakob Lykke Andersen2021-10-021-3/+4
| |
| * py nodes, PyObject annoJakob Lykke Andersen2021-10-021-7/+8
| |
| * py nodes, PyProperty get_signature_prefixJakob Lykke Andersen2021-10-021-2/+4
| |
| * py nodes, PyMethod get_signature_prefixJakob Lykke Andersen2021-10-021-8/+8
| |
| * py nodes, PyClassLike, get_signature_prefixJakob Lykke Andersen2021-10-021-12/+15
| |
| * py nodes, PyFunction get_signature_prefixJakob Lykke Andersen2021-10-021-1/+3
| |
| * py nodes, PyPropertyJakob Lykke Andersen2021-10-021-2/+4
| |
| * py nodes, PyAttribute valueJakob Lykke Andersen2021-10-021-1/+5
| |
| * py nodes, PyAttribute typeJakob Lykke Andersen2021-10-021-3/+4
| |
| * py nodes, PyVariable valueJakob Lykke Andersen2021-10-021-1/+6
| |
| * py nodes, PyVariable typeJakob Lykke Andersen2021-10-021-4/+7
| |
| * py nodes, arglistJakob Lykke Andersen2021-10-021-13/+13
| |