summaryrefslogtreecommitdiff
path: root/sphinx/util/typing.py
Commit message (Collapse)AuthorAgeFilesLines
* Expand the mypy whitelist for 'sphinx.util' (#11406)danieleades2023-05-121-1/+1
|
* Improve static typing in ``intersphinx`` et alAdam Turner2023-03-171-1/+6
|
* Fix COM812Adam Turner2023-02-181-2/+2
|
* Resolve Ruff SIM114 violationsAdam Turner2023-02-151-12/+11
|
* Replace deprecation tooling with module level ``__getattr__`` (#11054)Adam Turner2023-01-081-10/+15
|
* Use PEP 604 display for ``typing.Optional`` and ``typing.Union`` (#11072)Adam Turner2023-01-021-68/+84
|
* Run pyupgrade (#11070)Adam Turner2023-01-021-23/+20
|
* Use PEP 604 typesAdam Turner2023-01-011-3/+3
|
* Use PEP 595 typesAdam Turner2023-01-011-18/+24
|
* Insert ``from __future__ import annotations``Adam Turner2023-01-011-0/+2
|
* Merge ``_py37`` functions in ``util.typing``Adam Turner2022-10-171-245/+54
| | | | | - restify and _restify_py37 - stringify and _stringify_py37
* Clean up after dropping Python 3.6Adam Turner2022-09-271-18/+5
|
* Merge branch '5.x'Adam Turner2022-09-271-8/+8
|\
| * Fix mypy violations for v0.981 (#10875)Adam Turner2022-09-271-8/+8
| |
* | Merge branch '5.x'Jean-François B2022-08-061-1/+2
|\ \ | |/
| * Fix flake8 5.0.0 reported formatting errorsdaniel.eades2022-08-011-1/+2
| |
* | Merge branch '5.x'Adam Turner2022-07-181-1/+3
|\ \ | |/ | | | | | | | | # Conflicts: # sphinx/ext/autodoc/__init__.py # sphinx/writers/html5.py
| * Improve static typing strictness (#10569)danieleades2022-07-181-1/+3
| |
* | Merge branch '5.x'Adam Turner2022-06-161-5/+0
|\ \ | |/ | | | | | | | | | | # 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/+0
| |
* | Remove deprecated items for Sphinx 6.0 (#10471)Adam Turner2022-06-161-9/+1
| |
* | Drop python 3.6 support (#10468)Takeshi KOMIYA2022-06-161-9/+9
|/
* Fix test_restifyAdam Turner2022-04-091-0/+3
|
* 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
|
* Fix #9971: autodoc: TypeError for annotation with unhashable objectTakeshi KOMIYA2022-02-111-2/+10
| | | | | restify() and stringify() fails with TypeError when unhashable object is given.
* Fix #10133: autodoc: Crashed when mocked module is used for type annotationTakeshi KOMIYA2022-01-301-0/+10
|
* Merge pull request #10034 from tk0miya/10027_autodoc_typehints_format_for_basesTakeshi KOMIYA2022-01-021-37/+60
|\ | | | | Fix #10027: autodoc_typehints_format does not work with :show-inheritance:
| * Add `mode` parameter to sphinx.util.typing:restify()Takeshi KOMIYA2022-01-011-37/+60
| | | | | | | | | | | | To make the typehints in "Bases" field simple, this adds a new parameter `mode` to sphinx.util.typing:restify() to suppress the leading module name from typehints in "Bases" field.
* | Merge branch '4.3.x' into 4.xTakeshi KOMIYA2022-01-011-1/+1
|\ \ | |/ |/|
| * A happy new year!Takeshi KOMIYA2022-01-011-1/+1
| |
* | refactor: Merge arguments of sphinx.util.typing:stringify()Takeshi KOMIYA2021-12-261-41/+43
| |
* | Fix #9194: autodoc: Prepend the "typing" module name on the signatureTakeshi KOMIYA2021-12-261-21/+31
|/ | | | | To create hyperlinks to container types automatically, this prepends the module names for the types under "typing" module.
* Add `smartref` parameter to sphinx.util.typing:stringify()Takeshi KOMIYA2021-12-031-46/+72
| | | | | | 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.
* ntersphinx_disabled_refs, type renameJakob Lykke Andersen2021-10-311-2/+2
|
* Intersphinx, refactoringJakob Lykke Andersen2021-10-311-1/+2
| | | | Also, when a reference is unresolved, don't strip the inventory prefix.
* Make util.typing.restify sanitise unreproducible output (eg. memory addresses)Chris Lamb2021-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Whilst working on the Reproducible Builds effort [0] I noticed that sphinx generates output that is not reproducible, causing a number of packages in Debian to unreproducible. Specifically, when Sphinx locates an alias of an instance when generating 'autodoc' documentation, it uses the raw Python repr(...) of the object and does not sanitise it for memory addresses (etc.) like elsewhere in Sphinx. This can result in documentation like this: -<dd><p>alias of &lt;webob.client.SendRequest object at 0x7fd769189df0&gt;</p> +<dd><p>alias of &lt;webob.client.SendRequest object at 0x7f0f02233df0&gt;</p> Patch attached that uses the object_description method, which was added to fix precisely this kind of issue. I originally filed this in Debian as bug #996948 [1]. [0] https://reproducible-builds.org/ [1] https://bugs.debian.org/996948
* Close #9664: autodoc: autodoc-process-bases supports reST snippetTakeshi KOMIYA2021-09-231-0/+2
| | | | | | This allows to inject a reST snippet through autodoc-process-bases event. It helps to modify the base classes of any class to the expected mark-up'ed text by custom extension.
* Fix #9630: autodoc: Failed to build xrefs if primary_domain is not 'py'Takeshi KOMIYA2021-09-141-34/+34
| | | | | | | | Autodoc generates reST code that uses raw `:obj:` and `:class:` xrefs to refer the classes and types. But they're fragile because they assume the primary_domain=='py'. This adds `:py:` prefix to these xrefs to make them robust.
* Merge pull request #9611 from tk0miya/9560_NewType_moduleTakeshi KOMIYA2021-09-111-3/+11
|\ | | | | Close #9560: autodoc: Allow to refer NewType with modname in py310+
| * Close #9560: autodoc: Allow to refer NewType with modname in py310+Takeshi KOMIYA2021-09-051-3/+11
| | | | | | | | | | | | Before 3.10, an instance of NewType has incorrect module name. But it was fixed on 3.10. This starts to use the module info if the interpreter is 3.10+.
* | Fix typos discovered by codespellChristian Clauss2021-09-081-1/+1
|/
* Merge pull request #9590 from tk0miya/9589_AnnotatedTakeshi KOMIYA2021-08-291-0/+2
|\ | | | | Fix #9589: autodoc: typing.Annotated has wrongly been rendered
| * Fix #9589: autodoc: typing.Annotated has wrongly been renderedTakeshi KOMIYA2021-08-291-0/+2
| | | | | | | | | | At the HEAD of 3.10, the implementation of `typing.Annotated` has been changed to have __qualname__.
* | Merge branch '4.1.x' into 4.xTakeshi KOMIYA2021-08-111-8/+6
|\ \ | |/
| * Fix #9537: autodoc: Some typing.* objects are brokenTakeshi KOMIYA2021-08-111-2/+4
| | | | | | | | | | At the HEAD of 3.10, the implementation of `typing._GenericAlias` has been changed to have correct _name and __name__.
| * Fix #9504: autodoc: generate incorrect reference to the parent classTakeshi KOMIYA2021-07-311-6/+2
| | | | | | | | | | | | | | | | | | Autodoc generates incorrect references to the parent class the target class inherites the class having `_name` attribute. It conciders the parent is a kind of SpecialForm'ed class by mistake. This uses `isinstance(X, SpecialForm)` to check that. Note: SpecialForm became a class since Python 3.7.