Skip to content

Remove mypy --next #5763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 2 additions & 8 deletions check/mypy
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
27 changes: 0 additions & 27 deletions dev_tools/conf/mypy-next.ini

This file was deleted.

19 changes: 9 additions & 10 deletions dev_tools/conf/mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines 22 to 27
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we can move this under the first Google block?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it has a slightly different structure for the flags it is changing


# ruamel is a downstream dependency of cirq-rigetti through pyquil.
[mypy-ruamel.*]
ignore_missing_imports = true