Skip to content
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

Update sources to pass typecheck with mypy==1.11.1 #6705

Closed
pavoljuhas opened this issue Aug 19, 2024 · 1 comment · Fixed by #6707
Closed

Update sources to pass typecheck with mypy==1.11.1 #6705

pavoljuhas opened this issue Aug 19, 2024 · 1 comment · Fixed by #6707
Assignees
Labels
kind/health For CI/testing/release process/refactoring/technical debt items triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@pavoljuhas
Copy link
Collaborator

Description of the issue

The check/mypy script reports 97 errors when run with the latest mypy-1.11.1 (released July 30, 2024).
The CI checks are executed with mypy-1.2.0 which is 16 months old.

This issues is to track PRs to get the code in sync with mypy-1.11.1

Cirq version

1.5.0.dev at d94c457

@pavoljuhas pavoljuhas added the kind/health For CI/testing/release process/refactoring/technical debt items label Aug 19, 2024
@pavoljuhas pavoljuhas self-assigned this Aug 19, 2024
@pavoljuhas
Copy link
Collaborator Author

Here is how to run the type check in a fresh virtual environment for Python 3.10:

pip install -r dev_tools/requirements/mypy.env.txt
pip install "mypy==1.11.1"
check/mypy

@NoureldinYosri NoureldinYosri added the triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add label Aug 21, 2024
pavoljuhas added a commit that referenced this issue Aug 23, 2024
- typecheck - purge unused ignore comments
- typecheck - address complaints about _ComplexLike expressions
- typecheck - fix errors on missing return statement
- typecheck - tell mypy it has a callable in inner function
- typecheck - fix redundant cast to "str"
- typecheck - fix type annotation to kwargs to dataclasses.replace
- typecheck - fix signature of the replacement function and restore
  the original function after the test
- typecheck - tell mypy about type when extracted from a zip tuple
- typecheck - fix incompatible types in assignment
- typecheck - fix type complaint due to unnecessary use of functools.partial
- Pick up easy lint from the cirq_google/cloud file
- Excise unused stub dependencies in mypy.txt

Fixes #6705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/health For CI/testing/release process/refactoring/technical debt items triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants