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 pyright to 1.1.393 and type-checking python version to 3.11 #4655

Merged
merged 2 commits into from
Feb 3, 2025

Conversation

letitz
Copy link
Collaborator

@letitz letitz commented Jan 31, 2025

Bumps the version of Python used for type-checking to 3.11. That is to say, pyright now supports type-checking idioms that were introduced after 3.7 like FooType | None.

Regenerated Pipfile.lock after updating Pipfile:

$ pipenv lock --dev --keep-outdated
/usr/local/google/home/titouan/.local/share/virtualenvs/clusterfuzz-v_gEHVBD/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted
classes.
  set_closure_cell(cell, cls)
Locking [dev-packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Warning: /usr/local/google/home/titouan/.local/share/virtualenvs/clusterfuzz-v_gEHVBD/lib/python3.11/site-packages/pipenv/resolver.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
/usr/local/google/home/titouan/.local/share/virtualenvs/clusterfuzz-v_gEHVBD/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted
classes.
  set_closure_cell(cell, cls)
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✔ Success!
Warning: /usr/local/google/home/titouan/.local/share/virtualenvs/clusterfuzz-v_gEHVBD/lib/python3.11/site-packages/pipenv/resolver.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
/usr/local/google/home/titouan/.local/share/virtualenvs/clusterfuzz-v_gEHVBD/lib/python3.11/site-packages/pipenv/vendor/attr/_make.py:876: RuntimeWarning: Running interpreter doesn't sufficiently support code object introspection.  Some features like bare super() or accessing __class__ will not work with slotted
classes.
  set_closure_cell(cell, cls)
Updated Pipfile.lock (fbf86a)!

@letitz letitz requested a review from vitorguidi January 31, 2025 15:05
@letitz letitz changed the title Update pyright to 1.1.393 Update pyright to 1.1.393 and type-checking python version to 3.11 Jan 31, 2025
Pipfile Show resolved Hide resolved
@letitz
Copy link
Collaborator Author

letitz commented Jan 31, 2025

Example lint/pyright run (from #4656):

$ python butler.py lint --type-check
Running: git diff --name-only FETCH_HEAD
| Pipfile
| Pipfile.lock
| pyrightconfig.json
| src/clusterfuzz/_internal/cron/grouper.py
Running: pylint --score=no --jobs=0 --ignore=protos,tests,grammars clusterfuzz
Running: yapf -p -d src/clusterfuzz/_internal/cron/grouper.py
Running: isort --dont-order-by-type --force-single-line-imports --force-sort-within-sections --line-length=80 -p handlers -p libs -p clusterfuzz  -c src/clusterfuzz/_internal/cron/grouper.py
Running: pyright src/clusterfuzz/_internal/cron/grouper.py
| /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:68:36 - error: Cannot access attribute "crash_type" for class "TestcaseAttributes"
|     Attribute "crash_type" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:68:59 - error: Cannot access attribute "crash_state" for class "TestcaseAttributes"
|     Attribute "crash_state" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:69:21 - error: Cannot access attribute "security_flag" for class "TestcaseAttributes"
|     Attribute "security_flag" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:69:47 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:70:21 - error: Cannot access attribute "crash_type" for class "TestcaseAttributes"
|     Attribute "crash_type" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:70:44 - error: Cannot access attribute "crash_state" for class "TestcaseAttributes"
|     Attribute "crash_state" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:71:21 - error: Cannot access attribute "security_flag" for class "TestcaseAttributes"
|     Attribute "security_flag" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:71:47 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:75:21 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:75:49 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:77:16 - error: Cannot assign to attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:78:16 - error: Cannot assign to attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:83:17 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:83:45 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:84:16 - error: Cannot assign to attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:84:38 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:86:17 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:86:45 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:87:16 - error: Cannot assign to attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:87:38 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:92:34 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:93:33 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:96:17 - error: Cannot access attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:97:16 - error: Cannot assign to attribute "group_id" for class "TestcaseAttributes"
|     Attribute "group_id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:108:24 - error: Cannot access attribute "id" for class "ModelKey"
|     Attribute "id" is unknown (reportAttributeAccessIssue)
|   /usr/local/google/home/titouan/code/clusterfuzz/src/clusterfuzz/_internal/cron/grouper.py:108:24 - error: Cannot access attribute "id" for class "list[Unknown]"
|     Attribute "id" is unknown (reportAttributeAccessIssue)
| 26 errors, 0 warnings, 0 informations
| Return code is non-zero (1).
Linting failed, see errors above.

Copy link
Collaborator

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

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

lgtm

@letitz
Copy link
Collaborator Author

letitz commented Feb 3, 2025

Thanks! Merging.

@letitz letitz merged commit 6a83937 into google:master Feb 3, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants