From 0d7d52805f44a922cd11954c4a1e3ce18bb649ae Mon Sep 17 00:00:00 2001 From: Dave Bacon Date: Thu, 14 Jul 2022 10:00:42 -0700 Subject: [PATCH] Remove mypy --next (#5763) --- .github/workflows/ci.yml | 13 ------------- check/mypy | 10 ++-------- dev_tools/conf/mypy-next.ini | 27 --------------------------- dev_tools/conf/mypy.ini | 19 +++++++++---------- 4 files changed, 11 insertions(+), 58 deletions(-) delete mode 100644 dev_tools/conf/mypy-next.ini diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60c39245f72..380dc569b1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,19 +65,6 @@ jobs: run: pip install -r dev_tools/requirements/mypy.env.txt - name: Type check run: check/mypy - mypy-next: - name: Type check (next) - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v1 - with: - python-version: '3.8' - architecture: 'x64' - - name: Install mypy - run: pip install -r dev_tools/requirements/mypy.env.txt - - name: Type check (for logging only) - run: check/mypy --next || true changed_files: name: Changed files test runs-on: ubuntu-20.04 diff --git a/check/mypy b/check/mypy index 3818c0378ac..f19f4f06a67 100755 --- a/check/mypy +++ b/check/mypy @@ -11,18 +11,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")" cd "$(git rev-parse --show-toplevel)" -config_file='mypy.ini' -for arg in "$@"; do - if [[ "${arg}" == "--next" ]]; then - config_file='mypy-next.ini' - shift - fi -done +CONFIG_FILE='mypy.ini' CIRQ_PACKAGES=$(env PYTHONPATH=. python dev_tools/modules.py list --mode package-path) echo -e -n "\033[31m" -mypy --config-file=dev_tools/conf/$config_file "$@" $CIRQ_PACKAGES dev_tools examples +mypy --config-file=dev_tools/conf/$CONFIG_FILE "$@" $CIRQ_PACKAGES dev_tools examples result=$? echo -e -n "\033[0m" diff --git a/dev_tools/conf/mypy-next.ini b/dev_tools/conf/mypy-next.ini deleted file mode 100644 index ba0d8e0afb5..00000000000 --- a/dev_tools/conf/mypy-next.ini +++ /dev/null @@ -1,27 +0,0 @@ -[mypy] -show_error_codes = true -plugins = duet.typing - -[mypy-__main__] -follow_imports = silent -ignore_missing_imports = true - -# 3rd-party libs for which we don't have stubs -[mypy-apiclient.*,freezegun.*,matplotlib.*,mpl_toolkits,multiprocessing.dummy,oauth2client.*,pandas.*,proto.*,pytest.*,scipy.*,sortedcontainers.*,setuptools.*,pylatex.*,networkx.*,qiskit.*,pypandoc.*,ply.*,_pytest.*,google.api.*,google.api_core.*,grpc.*,google.auth.*,google.oauth2.*,google.protobuf.text_format.*,quimb.*,pyquil.*,google.cloud.*,filelock.*,codeowners.*,tqdm.*,importlib_metadata.*,google.colab.*,IPython.*,astroid.*,pylint.*,qcs_api_client.*] -follow_imports = silent -ignore_missing_imports = true - -#Adding "sympy.* or mypy-sympy to the above list (3rd-party libs for which we don't have stubs) doesn't ignore "cannot find module 'sympy' error -[mypy-sympy.*] -ignore_missing_imports = True - -# Treat symbols imported from Google's protobuf library as type Any. -# This suppresses errors due to attributes not known to typeshed, -# e.g. Descriptor._options. -[mypy-google.protobuf.*] -follow_imports = skip -follow_imports_for_stubs = true - -# ruamel is a downstream dependency of cirq-rigetti through pyquil. -[mypy-ruamel.*] -ignore_missing_imports = true diff --git a/dev_tools/conf/mypy.ini b/dev_tools/conf/mypy.ini index 864bdd48e6f..90db2d4ee51 100644 --- a/dev_tools/conf/mypy.ini +++ b/dev_tools/conf/mypy.ini @@ -7,22 +7,21 @@ follow_imports = silent ignore_missing_imports = true # 3rd-party libs for which we don't have stubs -[mypy-apiclient.*,freezegun.*,matplotlib.*,mpl_toolkits,multiprocessing.dummy,oauth2client.*,pandas.*,proto.*,pytest.*,scipy.*,sortedcontainers.*,setuptools.*,pylatex.*,networkx.*,qiskit.*,pypandoc.*,ply.*,_pytest.*,google.api.*,google.api_core.*,grpc.*,google.auth.*,google.oauth2.*,google.protobuf.text_format.*,quimb.*,pyquil.*,google.cloud.*,filelock.*,codeowners.*,tqdm.*,importlib_metadata.*,google.colab.*,IPython.*,astroid.*,pylint.*] + +# Google +[mypy-google.api_core.*,google.auth.*,google.colab.*,google.protobuf.text_format.*,google.cloud.*] +follow_imports = silent +ignore_missing_imports = true + +# Non-Google +[mypy-sympy.*,matplotlib.*,proto.*,pandas.*,scipy.*,freezegun.*,mpl_toolkits.*,networkx.*,ply.*,astroid.*,pytest.*,_pytest.*,pylint.*,setuptools.*,qiskit.*,quimb.*,pylatex.*,filelock.*,sortedcontainers.*,tqdm.*] follow_imports = silent ignore_missing_imports = true -# There was no type information before numpy 1.20, so there are numpy mypy issues in the codebase -[mypy-numpy.*] -follow_imports = skip -follow_imports_for_stubs = true # Treat symbols imported from Google's protobuf library as type Any. -# This supresses errors due to attributes not known to typeshed, +# This suppresses errors due to attributes not known to typeshed, # e.g. Descriptor._options. [mypy-google.protobuf.*] follow_imports = skip follow_imports_for_stubs = true - -# ruamel is a downstream dependency of cirq-rigetti through pyquil. -[mypy-ruamel.*] -ignore_missing_imports = true