summaryrefslogtreecommitdiff
path: root/tests/test_util_typing.py
Commit message (Collapse)AuthorAgeFilesLines
* Resolve lint errors from Ruff 0.0.260Adam Turner2023-03-311-1/+1
|
* Adopt ``profile = "black"`` for ``isort``Adam Turner2023-01-071-2/+12
| | | | This allows using Ruff's import sorting fixers
* Use PEP 604 display for ``typing.Optional`` and ``typing.Union`` (#11072)Adam Turner2023-01-021-142/+147
|
* Adopt the Ruff code linting toolAdam Turner2022-12-291-1/+1
| | | | https://github.com/charliermarsh/ruff
* Drop Python 3.7Adam Turner2022-09-271-2/+0
|
* Clean up after dropping Python 3.6Adam Turner2022-09-271-18/+20
|
* Merge branch '5.x'Adam Turner2022-09-091-2/+2
|\ | | | | | | | | | | | | | | | | # 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-2/+2
| |
* | Drop python 3.6 support (#10468)Takeshi KOMIYA2022-06-161-87/+38
|/
* Merge branch '4.4.x' into 4.xTakeshi KOMIYA2022-03-191-4/+14
|\
| * test: empty tuple type is now repesented w/o args since py3.11Takeshi KOMIYA2022-03-191-4/+14
| | | | | | | | refs: https://github.com/python/cpython/commit/15df8f8d89a0e563bdd15e4cd6734298736a5a1d
* | 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 #10133: autodoc: Crashed when mocked module is used for type annotationTakeshi KOMIYA2022-01-301-0/+2
|/
* Merge pull request #10034 from tk0miya/10027_autodoc_typehints_format_for_basesTakeshi KOMIYA2022-01-021-0/+40
|\ | | | | Fix #10027: autodoc_typehints_format does not work with :show-inheritance:
| * Add `mode` parameter to sphinx.util.typing:restify()Takeshi KOMIYA2022-01-011-0/+40
| | | | | | | | | | | | 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-153/+153
| |
* | Fix #9194: autodoc: Prepend the "typing" module name on the signatureTakeshi KOMIYA2021-12-261-0/+26
|/ | | | | 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-64/+173
| | | | | | 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.
* Merge branch '4.x' into 9657_qualname_of_mockTakeshi KOMIYA2021-09-271-0/+1
|\
| * Close #9664: autodoc: autodoc-process-bases supports reST snippetTakeshi KOMIYA2021-09-231-0/+1
| | | | | | | | | | | | 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 #9657: autodoc: basecls for a subclass of mocked object is incorrectTakeshi KOMIYA2021-09-211-0/+13
|/
* Fix #9630: autodoc: Failed to build xrefs if primary_domain is not 'py'Takeshi KOMIYA2021-09-141-64/+70
| | | | | | | | 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.
* Close #9560: autodoc: Allow to refer NewType with modname in py310+Takeshi KOMIYA2021-09-051-2/+9
| | | | | | 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+.
* Merge branch '4.x' into 4.xJames2021-08-021-9/+9
|\
| * Merge pull request #9464 from Gobot1234/4.xTakeshi KOMIYA2021-07-201-0/+12
| |\ | | | | | | Add support for PEP 585 generics
| * | Fix testcases that failed in python3.10.0b4Takeshi KOMIYA2021-07-201-4/+4
| | |
* | | Add some testsJames2021-08-021-2/+10
| |/ |/|
* | Respond to feedbackJames2021-07-181-0/+12
|/
* Fix #9362: autodoc: AttributeError is raised for a subclass of Tuple[()]Takeshi KOMIYA2021-07-071-0/+2
|
* Fix #9195: autodoc: The args of `typing.Literal` are wrongly renderedTakeshi KOMIYA2021-05-111-0/+12
| | | | They should be rendered as "repr" form.
* Fix #8818: autodoc: Super class having ``Any`` arguments causes nit-picky ↵Takeshi KOMIYA2021-04-181-23/+37
| | | | | | | | warning On generating the base class information, unexpected nit-picky warning for ``typing.Any`` was emitted. This fixes it by using `~` prefix on generating a cross-reference to make it valid.
* Fix #8992: autodoc: Failed to resolve types.TracebackType type annotationTakeshi KOMIYA2021-03-171-1/+4
| | | | | The builtin module, ``types.TracebackType`` does not have correct module name. This allows to refer it automatically.
* autodoc: an imported TypeVar is not resolved (refs: #8415)Takeshi KOMIYA2021-02-281-4/+11
| | | | | | | | | | So far, a TypeVar is rendered without module name. As a result, it could not be resolved if it is imported from other modules. This prepends its module name and make it resolvable. This is available only in Python 3.7 or above. As a side effect, all of TypeVars are displayed with module name. It should be fixed in latter step (refs: #7119)
* autodoc: Support type union operator (PEP-604) (refs: #8775)Takeshi KOMIYA2021-01-311-0/+14
| | | | | Upgrade autodoc to support type union operator introduced in PEP-604. It's available only with python 3.10+.
* Merge branch '3.4.x' into 3.xTakeshi KOMIYA2021-01-011-1/+1
|\
| * A happy new year!Takeshi KOMIYA2021-01-011-1/+1
| | | | | | | | | | | | | | .. note:: $ find sphinx tests LICENSE doc/conf.py -type f -exec sed -i '' -e 's/2007\-20../2007-2021/' {} \; $ git co sphinx/locale/**/*.js sphinx/templates/epub3/mimetype
* | Fix #8315: autodoc: Failed to resolve struct.Struct type annotationTakeshi KOMIYA2020-12-311-0/+3
|/ | | | | The builtin module, ``struct.Struct`` does not have correct module name since Python 3.8. This allows to refer it automatically.
* Fix #8559: AttributeError is raised when using ForwardRefTakeshi KOMIYA2020-12-221-0/+6
| | | | The restify() helper crashes when ForwardRef is passed.
* Add NewType support to typing.stringify() and restify()Takeshi KOMIYA2020-11-211-1/+5
|
* Make tests/ a Python packageFrançois Freitag2020-11-201-16/+16
| | | | Allows relative imports.
* refactor: Fix flake8 violations under tests/ directoryTakeshi KOMIYA2020-11-151-4/+5
|
* Sort imports with isortFrançois Freitag2020-11-111-3/+2
| | | | | | | | | | | | Keep imports alphabetically sorted and their order homogeneous across Python source files. The isort project has more feature and is more active than the flake8-import-order plugin. Most issues caught were simply import ordering from the same module. Where imports were purposefully placed out of order, tag with isort:skip.
* Fix #8219: autodoc: Parameters for generic base class are not shownTakeshi KOMIYA2020-11-091-1/+75
|
* Fix #8157: autodoc: TypeError is raised when annotation has invalid __args__Takeshi KOMIYA2020-10-041-0/+8
| | | | | | | | | Typically, the __args__ attribute of type annotations is a tuple containing arguments for the types (ex. The __args__ of `List[int]` is `(int,)`). But some kind of types has non tuple __args__ attribute. For example, `nptyping.NDArray` is one of them. This fixes the TypeError when the invalid __args__ attribute found.