Skip to content

Commit

Permalink
Support and require nptyping 2.1.1 (#232)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Jun 3, 2022
1 parent bff0765 commit 7ee3891
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.18.2

- Support and require `nptyping>=2.1.1`

## 1.18.1

- Fix mocked module import not working when used as guarded import
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ testing =
covdefaults>=2.2
coverage>=6.3
diff-cover>=6.4
nptyping>=2
nptyping>=2.1.1
pytest>=7.1
pytest-cov>=3
sphobjinv>=2
Expand Down
32 changes: 16 additions & 16 deletions tests/test_sphinx_autodoc_typehints.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,42 +241,42 @@ def test_parse_annotation(annotation: Any, module: str, class_name: str, args: t
# Internal tuple with following additional type cannot be flattened (specific to nptyping?)
# These cases will fail if nptyping restructures its internal module hierarchy
(
nptyping.NDArray[nptyping.Shape["*"], nptyping.Float],
nptyping.NDArray[nptyping.Shape["*"], nptyping.Float], # type: ignore # nptyping/issues/77
(
":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Literal`\\['*'], "
":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:class:`~nptyping.base_meta_classes.Shape`\\[*], "
":py:class:`~numpy.float64`]"
),
),
(
nptyping.NDArray[nptyping.Shape["64"], nptyping.Float],
nptyping.NDArray[nptyping.Shape["64"], nptyping.Float], # type: ignore # nptyping/issues/77
(
":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Literal`\\['64'], "
":py:class:`~numpy.float64`]"
":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:class:`~nptyping.base_meta_classes.Shape`\\[64],"
" :py:class:`~numpy.float64`]"
),
),
(
nptyping.NDArray[nptyping.Shape["*, *"], nptyping.Float],
nptyping.NDArray[nptyping.Shape["*, *"], nptyping.Float], # type: ignore # nptyping/issues/77
(
":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Literal`\\['*, "
"*'], :py:class:`~numpy.float64`]"
":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:class:`~nptyping.base_meta_classes.Shape`\\[*, "
"*], :py:class:`~numpy.float64`]"
),
),
(
nptyping.NDArray[nptyping.Shape["*, ..."], nptyping.Float],
(":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Any`, :py:class:`~numpy.float64`]"),
nptyping.NDArray[nptyping.Shape["*, ..."], nptyping.Float], # type: ignore # nptyping/issues/77
(":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:data:`~typing.Any`, :py:class:`~numpy.float64`]"),
),
(
nptyping.NDArray[nptyping.Shape["*, 3"], nptyping.Float],
nptyping.NDArray[nptyping.Shape["*, 3"], nptyping.Float], # type: ignore # nptyping/issues/77
(
":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Literal`\\['*, 3'], "
":py:class:`~numpy.float64`]"
":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:class:`~nptyping.base_meta_classes.Shape`\\[*, 3"
"], :py:class:`~numpy.float64`]"
),
),
(
nptyping.NDArray[nptyping.Shape["3, ..."], nptyping.Float],
nptyping.NDArray[nptyping.Shape["3, ..."], nptyping.Float], # type: ignore # nptyping/issues/77
(
":py:class:`~nptyping.ndarray.NDArray`\\[:py:data:`~typing.Literal`\\['3, ...'], "
":py:class:`~numpy.float64`]"
":py:class:`~nptyping.base_meta_classes.NDArray`\\[:py:class:`~nptyping.base_meta_classes.Shape`\\[3, "
"...], :py:class:`~numpy.float64`]"
),
),
],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ description = run type check on code base
setenv =
{tty:MYPY_FORCE_COLOR = 1}
deps =
mypy==0.942
mypy==0.960
types-docutils
commands =
mypy --python-version 3.10 src
Expand Down

0 comments on commit 7ee3891

Please sign in to comment.