summaryrefslogtreecommitdiff
path: root/sphinx/util/typing.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10Takeshi KOMIYA2021-07-301-6/+6
| | | | | | | | | | | | Recently, `types.Union` was renamed to `types.UnionType` on the HEAD of 3.10 (refs: python/cpython#27342). After this change, sphinx-build has been crashed because of ImportError.
* | Merge branch '4.x' into 4.xJames2021-08-021-12/+15
|\ \
| * \ Merge branch '4.x' into bugfix/get-type-hintsyanyongyu2021-07-301-6/+6
| |\ \
| | * \ Merge pull request #9513 from tk0miya/9512_types.UnionTypesTakeshi KOMIYA2021-07-301-6/+6
| | |\ \ | | | | | | | | | | Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10
| | | * | Fix #9512: sphinx-build: crashed with the HEAD of Python 3.10Takeshi KOMIYA2021-07-301-6/+6
| | | |/ | | | | | | | | | | | | | | | | | | | | Recently, `types.Union` was renamed to `types.UnionType` on the HEAD of 3.10 (refs: python/cpython#27342). After this change, sphinx-build has been crashed because of ImportError.
| * | | Fix uncatched exception in get type hintsyanyongyu2021-07-291-0/+3
| |/ /
| * | Merge branch '4.1.x' into 4.xTakeshi KOMIYA2021-07-231-6/+6
| |\ \ | | |/
| | * Fix #9490: autodoc: Some typing.* objects are brokenTakeshi KOMIYA2021-07-231-6/+6
| | | | | | | | | | | | | | | At the HEAD of 3.10, the implementation of `typing._SpecialForm` and `typing._BaseGenericAlias` has been changed to support __qualname__.
* | | Appease linterJames2021-08-011-1/+4
| | |
* | | Match formatting of other recursive typesJames2021-08-011-1/+1
| | |
* | | Recursively resolve PEP 585 builtinsJames2021-08-011-1/+4
|/ /
* | Respond to feedbackJames2021-07-181-1/+2
| |
* | Add support for PEP 585 genericsJames2021-07-171-0/+2
|/
* Fix #9404: autodoc: autoclass raises TypeError for dict-like objectTakeshi KOMIYA2021-07-111-1/+1
| | | | | The autoclass directive raises TypeError when dict-like object (not a class) is given as a subject.
* Merge pull request #9415 from ↵Takeshi KOMIYA2021-07-091-20/+23
|\ | | | | | | | | tk0miya/9362_AttributeError_for_subclass_of_empty_tuple Fix #9362: autodoc: AttributeError is raised for a subclass of Tuple[()]
| * Fix #9362: autodoc: AttributeError is raised for a subclass of Tuple[()]Takeshi KOMIYA2021-07-071-20/+23
| |
* | Fix typoEisuke Kawashima2021-07-081-1/+1
|/
* Merge branch '4.0.x' into 4.xTakeshi KOMIYA2021-06-131-6/+6
|\
| * Fix mypy violations (delete type: ignore ) (with mypy-0.900)Junya Fukuda2021-06-131-6/+6
| |
* | Fix #9195: autodoc: The args of `typing.Literal` are wrongly renderedTakeshi KOMIYA2021-05-111-0/+6
| | | | | | | | They should be rendered as "repr" form.
* | refactor: Add Optional to type annotationsTakeshi KOMIYA2021-05-031-1/+1
|/
* Fix #8818: autodoc: Super class having ``Any`` arguments causes nit-picky ↵Takeshi KOMIYA2021-04-181-19/+36
| | | | | | | | 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.
* refactor: use raw Type for type annotationsTakeshi KOMIYA2021-04-041-4/+4
|
* Fix #8992: autodoc: Failed to resolve types.TracebackType type annotationTakeshi KOMIYA2021-03-171-6/+12
| | | | | The builtin module, ``types.TracebackType`` does not have correct module name. This allows to refer it automatically.
* refactor: Add a type alias for the option_spec of directives; OptionSpecTakeshi KOMIYA2021-03-131-3/+12
|
* autodoc: an imported TypeVar is not resolved (refs: #8415)Takeshi KOMIYA2021-02-281-1/+4
| | | | | | | | | | 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)
* Merge branch '3.x' into master_with_merged_3.xjfbu2021-02-021-1/+22
|\
| * Fix #8775: Avoid the crash of autodoc caused by type union operatorTakeshi KOMIYA2021-02-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | The type union operator (PEP-604) causes autodoc crashed in python 3.9 or below because of the syntax is not suppoerted yet in the interpreters. Internally, `typing.get_type_hints()` raises TypeError on evaluating the annotation by BitOr operator for types. To avoid the crash, this adds a fallback not to evaluate the annotations and keep as is. As a side effect, `autodoc_type_aliases` will not work for the modules and classes that uses type union operator for their annotations.
| * autodoc: Support type union operator (PEP-604) (refs: #8775)Takeshi KOMIYA2021-01-311-0/+19
| | | | | | | | | | Upgrade autodoc to support type union operator introduced in PEP-604. It's available only with python 3.10+.
* | Merge branch '3.x'Takeshi KOMIYA2021-01-011-1/+1
|\ \ | |/
| * 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
* | | Merge branch '3.x'Takeshi KOMIYA2021-01-011-0/+7
|\ \ \ | |/ /
| * | Fix #8315: autodoc: Failed to resolve struct.Struct type annotationTakeshi KOMIYA2020-12-311-0/+7
| |/ | | | | | | | | The builtin module, ``struct.Struct`` does not have correct module name since Python 3.8. This allows to refer it automatically.
* | Merge branch '3.x'Takeshi KOMIYA2020-12-291-0/+2
|\ \ | |/
| * Fix #8559: AttributeError is raised when using ForwardRefTakeshi KOMIYA2020-12-221-0/+2
| | | | | | | | The restify() helper crashes when ForwardRef is passed.
* | Merge branch '3.x'Takeshi KOMIYA2020-12-141-1/+1
|\ \ | |/
| * refactored code and tests, prepared for numpy featureQuentin Soubeyran2020-11-251-1/+1
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-11-221-0/+9
|\ \ | |/
| * Add NewType support to typing.stringify() and restify()Takeshi KOMIYA2020-11-211-0/+9
| |
* | Remove code for python3.5Takeshi KOMIYA2020-11-211-3/+0
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-11-211-0/+23
|\ \ | |/
| * refactor: Add sphinx.util.typing.get_type_hints()Takeshi KOMIYA2020-11-181-0/+23
| | | | | | | | | | Add a simple wrapper of `typing.get_type_hints()` that does not raise an error on runtime.
* | Merge branch '3.x'Takeshi KOMIYA2020-11-121-1/+0
|\ \ | |/
| * Merge pull request #8408 from francoisfreitag/isortTakeshi KOMIYA2020-11-121-1/+0
| |\ | | | | | | Sort imports with isort
| | * Sort imports with isortFrançois Freitag2020-11-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge branch '3.x'Takeshi KOMIYA2020-11-101-1/+1
|\ \ \ | |/ /
| * | test: Adjust type annotataions in python 3.10Takeshi KOMIYA2020-11-101-1/+1
| |/
* | Drop code for py35Takeshi KOMIYA2020-11-091-53/+10
| |
* | Merge branch '3.x'Takeshi KOMIYA2020-11-091-1/+194
|\ \ | |/