summaryrefslogtreecommitdiff
path: root/sphinx/ext/autodoc
Commit message (Collapse)AuthorAgeFilesLines
* Support type comments in ``PropertyDocumenter`` (#11298)picnixz2023-04-061-23/+36
|
* Fix typos found by codespellDimitri Papadopoulos2023-03-271-1/+1
|
* Drop OrderedDictAdam Turner2023-03-051-2/+1
| | | | Since Python 3.7, dicts maintain insertion order.
* Resolve ``flake8-return`` errorsAdam Turner2023-02-182-35/+30
|
* Unescape quotation marks where possibleAdam Turner2023-02-181-1/+1
|
* Fix COM812Adam Turner2023-02-185-28/+28
|
* Add ``content_offset`` parameter to ``nested_parse_with_titles`` (#11147)Jeremy Maitin-Shepard2023-02-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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-152-21/+14
|
* Fix various Ruff errorsAdam Turner2023-01-311-1/+2
|
* Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-072-6/+26
| | | | This allows using Ruff's import sorting fixers
* Document ``typing.NewType`` as a class (#10700)Adam Turner2023-01-021-113/+78
|
* Use PEP 604 display for ``typing.Optional`` and ``typing.Union`` (#11072)Adam Turner2023-01-022-15/+19
|
* Address SIM103 lints (#11052)danieleades2023-01-021-8/+2
| | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Run pyupgrade (#11070)Adam Turner2023-01-023-20/+20
|
* Use PEP 604 typesAdam Turner2023-01-016-56/+56
|
* Use PEP 595 typesAdam Turner2023-01-017-90/+90
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-017-0/+14
|
* Tighten mypy 'strict optional' whitelist (#11038)danieleades2022-12-293-20/+41
| | | Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* Deactivate (provisorily) Python12-dev testing (#11035)Jean-François B2022-12-161-2/+2
| | | | | | | | | | | | | * fix flake8 warnings * Deactivate (provisorily) testing with 3.12-dev (refs: https://github.com/sphinx-doc/sphinx/pull/10995#issuecomment-1330310586 ) * Escape # in tox.ini for tox 4 compatibility ('du-latest' tests) Co-authored-by: Daniel Eades <danieleades@hotmail.com>
* Use ``ast.parse`` from the standard libraryAdam Turner2022-10-172-8/+6
|
* Merge branch '5.x'Adam Turner2022-10-162-2/+4
|\ | | | | | | | | | | | | | | # Conflicts: # .github/workflows/main.yml # CHANGES # sphinx/__init__.py # sphinx/domains/c.py
| * Ensure non-builtin extensions use the proper versionAdam Turner2022-09-302-2/+4
| |
* | Drop Python 3.7Adam Turner2022-09-272-13/+8
| |
* | Clean up after dropping Python 3.6Adam Turner2022-09-272-7/+4
| |
* | Merge branch '5.x'Adam Turner2022-09-251-1/+2
|\ \ | |/ | | | | | | | | | | | | | | | | # Conflicts: # CHANGES # doc/conf.py # sphinx/__init__.py # sphinx/builders/html/__init__.py # sphinx/domains/python.py # tests/test_build_html.py
| * Define extra indent as a class attributeAdam Turner2022-09-251-1/+2
| |
* | Merge branch '5.x'Adam Turner2022-09-231-0/+9
|\ \ | |/ | | | | | | | | # Conflicts: # setup.py # sphinx/__init__.py
| * Add contents entries for domain objects (#10807)Adam Turner2022-09-131-0/+9
| | | | | | | | | | | | | | | | | | - 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'Adam Turner2022-09-092-3/+3
|\ \ | |/ | | | | | | | | | | | | | | # Conflicts: # setup.py # sphinx/application.py # sphinx/environment/__init__.py # sphinx/ext/autodoc/directive.py # tests/test_build_html.py
| * Fix more strict static typing errors (#10681)danieleades2022-08-282-3/+3
| |
* | Merge branch '5.x'Adam Turner2022-07-181-2/+1
|\ \ | |/ | | | | | | | | # Conflicts: # sphinx/ext/autodoc/__init__.py # sphinx/writers/html5.py
| * Improve static typing strictness (#10569)danieleades2022-07-181-3/+2
| |
* | Merge branch '5.x' into masterJean-François B2022-06-301-1/+1
|\ \ | |/ | | | | | | | | | | | | 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)
| * Use the `flake8-comprehensions` lint plugin (#10601)danieleades2022-06-261-1/+1
| |
* | Merge branch '5.x'Adam Turner2022-06-161-5/+2
|\ \ | |/ | | | | | | | | | | # Conflicts: # .github/workflows/builddoc.yml # .github/workflows/lint.yml # sphinx/registry.py
| * Remove traces of Python 2 and 3.5 (#10560)Adam Turner2022-06-161-5/+2
| |
* | Remove deprecated items for Sphinx 6.0 (#10471)Adam Turner2022-06-162-48/+3
|/
* Fix documenting inherited attributesAdam Turner2022-06-082-3/+9
|
* Set the docstring attribute of class members. Fixes #8180.Anselm Kruis2022-05-231-1/+8
| | | | | Change ext.autodoc.importer.get_class_members to set ObjectMember.docstring the docstring found by the source code analyzer.
* Merge branch '5.0.x' into 9648_autodoc_typehints_description_and_stared_argsTakeshi KOMIYA2022-05-221-2/+10
|\
| * Fix #9575: autodoc: Return annotation should not be shownTakeshi KOMIYA2022-05-151-2/+10
| |
* | Fix #9648: autodoc: *args and **kwargs entries are duplicatedTakeshi KOMIYA2022-05-151-3/+17
|/ | | | | | | | | In basic usage of autodoc (docstring), `args` and `kwargs` arguments are marked up without stars. But numpydoc style recommends to mark them up with stars. This adds support for starred arguments in docstrings to `autodoc_typehints` feature.
* Merge pull request #10427 from ↵Takeshi KOMIYA2022-05-081-1/+12
|\ | | | | | | | | tk0miya/10421_autodoc_preserve_defaults_for_classmethod Fix #10421: autodoc_preserve_defaults doesn't work on class methods
| * Fix #10421: autodoc_preserve_defaults doesn't work on class methodsTakeshi KOMIYA2022-05-081-1/+12
| |
* | Merge remote-tracking branch 'origin/5.x' into HEADTakeshi KOMIYA2022-05-074-274/+41
|\ \ | |/
| * Remove a trailing whitespaceTakeshi KOMIYA2022-04-241-1/+1
| |
| * Correct autodoc docstringsOscar Gustafsson2022-04-201-3/+5
| | | | | | | | | | A bit too much copy and paste in the earlier ones. `*-members` also includes `inherited-members` and `exclude-members` which are not dealt with.
| * Review commentsAdam Turner2022-04-171-1/+1
| |
| * Remove deprecated code for Sphinx 5.0Adam Turner2022-04-174-270/+35
| |
* | Apply `autodoc_typehints_format` to all type hintszuqq2022-04-081-4/+18
|/ | | | Specifically: attributes, data, properties, and type variable bounds.