summaryrefslogtreecommitdiff
path: root/sphinx/domains/python.py
Commit message (Collapse)AuthorAgeFilesLines
* Allow multi-line object description signatures (#11011)TLouf2023-05-111-6/+21
| | | | | 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>
* Warn on deprecated Python-specific index types (#11412)Adam Turner2023-05-091-9/+9
|
* Harmonise references to Sphinx versions (#11361)Adam Turner2023-04-271-1/+1
|
* Remove deprecated ``make_old_id`` functions (#11360)Adam Turner2023-04-271-10/+0
|
* Add an option for displaying short ``Literal`` types (#11109)Adam Turner2023-04-051-0/+5
| | | | | | 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.
* Resolve ``flake8-return`` errorsAdam Turner2023-02-181-2/+1
|
* Fix COM812Adam Turner2023-02-181-7/+7
|
* Add ``content_offset`` parameter to ``nested_parse_with_titles`` (#11147)Jeremy Maitin-Shepard2023-02-151-5/+4
| | | | | | | | | | | | | | | | | | | | | | | 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``.
* Resolve Ruff SIM114 violationsAdam Turner2023-02-151-18/+17
|
* Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-2/+6
| | | | This allows using Ruff's import sorting fixers
* De-glob mypy whitelist for 'sphinx.domains.*' (#11064)danieleades2023-01-021-14/+28
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Use PEP 604 display for ``typing.Optional`` and ``typing.Union`` (#11072)Adam Turner2023-01-021-0/+24
|
* Run pyupgrade (#11070)Adam Turner2023-01-021-3/+3
|
* Use PEP 604 typesAdam Turner2023-01-011-5/+5
|
* Use PEP 595 typesAdam Turner2023-01-011-56/+56
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-011-0/+2
|
* Use ``ast.parse`` from the standard libraryAdam Turner2022-10-171-2/+1
|
* Merge branch '5.x'Adam Turner2022-09-301-0/+2
|\ | | | | | | | | # Conflicts: # sphinx/locale/__init__.py
| * Finer grained control over domain ToC entries (#10886)Adam Turner2022-09-301-0/+2
| | | | | | | | | | - Implement `:nocontentsentry:` flag - Use `:nocontentsentry:` in docs - Add domain object table of contents configuration option
* | Drop Python 3.7Adam Turner2022-09-271-15/+2
| |
* | Clean up after dropping Python 3.6Adam Turner2022-09-271-1/+1
| |
* | Merge branch '5.x'Adam Turner2022-09-271-1/+2
|\ \ | |/
| * Restore anchor links to top of module docstringAdam Turner2022-09-271-1/+2
| |
| * Warn on using the `:property:` flag with `.. py:method::` (#10852)Adam Turner2022-09-231-0/+2
| |
* | Merge branch '5.x'Adam Turner2022-09-231-4/+42
|\ \ | |/ | | | | | | | | # Conflicts: # setup.py # sphinx/__init__.py
| * Add contents entries for domain objects (#10807)Adam Turner2022-09-131-4/+42
| | | | | | | | | | | | | | | | | | - Add entries in the table of contents for domain objects (e.g. `py:function`, `rst:role`, etc). Supported domains are Javascript, Python, and reStructuredText. - Support content in `py:module` and `js:module` directives. - Add the `noindexentry` and `noindex` flags to more domains. - Add `toc_object_entries_show_parents` configuration setting - Update documentation and tests
* | Merge branch '5.x'Jean-François B2022-08-061-1/+1
|\ \ | |/
| * Properly support `of` in docstring type specifiers (#10738)ProGamerGov2022-08-021-1/+1
| | | | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* | Merge branch '5.x'Adam Turner2022-07-181-3/+5
|\ \ | |/ | | | | | | | | # Conflicts: # sphinx/ext/autodoc/__init__.py # sphinx/writers/html5.py
| * Improve static typing strictness (#10569)danieleades2022-07-181-3/+5
| |
* | Merge branch '5.x' into masterJean-François B2022-06-301-0/+7
|\ \ | |/ | | | | | | | | | | | | 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)
| * py domain: Ignore aliases for resolving `:any:` cross-references (#10089)Joachim Jablon2022-06-261-0/+7
| | | | | | | | Co-authored-by: Joachim Jablon <joachim.jablon@people-doc.com>
* | Remove more deprecated items in Sphinx 6.0 (#10562)Adam Turner2022-06-261-10/+1
| |
* | Remove deprecated items for Sphinx 6.0 (#10471)Adam Turner2022-06-161-9/+3
|/
* Fix ~Literal referencesAdam Turner2022-06-021-1/+1
|
* fix #10456: fix sphinx.domain.python.filter_meta_fields()Anselm Kruis2022-05-161-2/+2
| | | | The function now removes all "meta"-fields from a field-list.
* Merge branch '4.x' into 5.xTakeshi KOMIYA2022-04-301-1/+1
|\
| * Fix mypy violations (with mypy-0.950)Takeshi KOMIYA2022-04-301-1/+1
| |
* | Remove deprecated code for Sphinx 5.0Adam Turner2022-04-171-13/+0
| |
* | Merge branch '4.x'Takeshi KOMIYA2022-03-191-9/+1
|\ \ | |/
| * 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
| |
* | Merge branch '4.x'Takeshi KOMIYA2022-01-011-1/+1
|\ \ | |/
| * Merge branch '4.3.x' into 4.xTakeshi KOMIYA2022-01-011-1/+1
| |\
| | * A happy new year!Takeshi KOMIYA2022-01-011-1/+1
| | |
* | | Merge branch '4.x'Takeshi KOMIYA2022-01-011-62/+61
|\ \ \ | |/ /
| * | Fix py domain: "typing" types are not hyperlinked in info-field-listTakeshi KOMIYA2021-12-271-41/+23
| | |