[reland] add numpy typing plugin to mypy config (#94525)

reland of https://github.com/pytorch/pytorch/pull/92930
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94525
Approved by: https://github.com/huydhn
This commit is contained in:
Wanchao Liang
2023-03-28 03:50:16 +00:00
committed by PyTorch MergeBot
parent 2490ac561f
commit 8a45befcec
5 changed files with 7 additions and 7 deletions

View File

@ -57,12 +57,12 @@ if [ -n "$ANACONDA_PYTHON_VERSION" ]; then
elif [ "$ANACONDA_PYTHON_VERSION" = "3.10" ]; then
conda_install numpy=1.21.2 ${CONDA_COMMON_DEPS}
elif [ "$ANACONDA_PYTHON_VERSION" = "3.9" ]; then
conda_install numpy=1.19.2 ${CONDA_COMMON_DEPS}
conda_install numpy=1.21.2 ${CONDA_COMMON_DEPS}
elif [ "$ANACONDA_PYTHON_VERSION" = "3.8" ]; then
conda_install numpy=1.18.5 ${CONDA_COMMON_DEPS}
conda_install numpy=1.21.2 ${CONDA_COMMON_DEPS}
else
# Install `typing-extensions` for 3.7
conda_install numpy=1.18.5 ${CONDA_COMMON_DEPS} typing-extensions
conda_install numpy=1.21.2 ${CONDA_COMMON_DEPS} typing-extensions
fi
# This is only supported in 3.8 upward

View File

@ -1,6 +1,6 @@
mkl=2021.2.0
mkl-include=2021.2.0
numpy=1.18.5
numpy=1.21.2
pyyaml=5.3
setuptools=46.0.0
cmake=3.22.*

View File

@ -1,5 +1,5 @@
[mypy]
plugins = mypy_plugins/check_mypy_version.py
plugins = mypy_plugins/check_mypy_version.py, numpy.typing.mypy_plugin
cache_dir = .mypy_cache/nofollow
warn_unused_configs = True

View File

@ -7,7 +7,7 @@
[mypy]
python_version = 3.8
plugins = mypy_plugins/check_mypy_version.py
plugins = mypy_plugins/check_mypy_version.py, numpy.typing.mypy_plugin
cache_dir = .mypy_cache/strict
strict_optional = True

View File

@ -2,7 +2,7 @@
# test_run_mypy in test/test_type_hints.py uses this string)
[mypy]
plugins = mypy_plugins/check_mypy_version.py
plugins = mypy_plugins/check_mypy_version.py, numpy.typing.mypy_plugin
cache_dir = .mypy_cache/normal
warn_unused_configs = True