Skip to content

Update mypy to 1.18.1 - #14699

Merged
srittau merged 7 commits into
mainfrom
sobolevn-patch-1
Sep 14, 2025
Merged

srittau merged 7 commits into
mainfrom
sobolevn-patch-1

Conversation

@sobolevn

Copy link
Copy Markdown
Member

Let's see how it goes!

@sobolevn

Copy link
Copy Markdown
Member Author

There are many stubtest failures. What do @JelleZijlstra and @srittau think about adding them to allowlist.txt for now with a special comment?

@srittau

srittau commented Sep 12, 2025

Copy link
Copy Markdown
Collaborator

As a first step, I think we should add --ignore-disjoint-bases to the stubtest call (with a FIXME comment). This should get rid of some of the failures.

@srittau

srittau commented Sep 12, 2025

Copy link
Copy Markdown
Collaborator

There are also quite a few entries that were stubtest bugs that were fixed and can be removed, which is good of course. I'm okay with adding the remaining entries (with FIXMEs to look at them more closely).

@brianschubert

Copy link
Copy Markdown
Collaborator

I'm working on patches for the __new__ and @disjoint_base related errors. I could try adding them to this branch if you'd like to save some allowlist churn, else I'll open separate PRs

@sobolevn

Copy link
Copy Markdown
Member Author

@brianschubert awesome! Thank you, please feel free to push them here :)

error: grpc.aio.ClientCallDetails.__new__ is inconsistent, stub parameter "cls" differs from runtime parameter "_cls"
For reference:
https://github.com/python-excel/xlrd/blob/3a19d22014d7b3f3041b7188d21a653c18c709bf/xlrd/formula.py#L675

```
/home/runner/work/typeshed/typeshed/stubs/xlrd/xlrd/formula.pyi
  /home/runner/work/typeshed/typeshed/stubs/xlrd/xlrd/formula.pyi:66:9 - error: Mismatch between signature of __new__ and __init__ in class "Ref3D"
    Signature of __init__ is "(atuple: tuple[int, int, int, int, int, int, int, int, int, int, int, int]) -> None"
    Signature of __new__ is "(iterable: Iterable[int] = ..., /) -> Ref3D" (reportInconsistentConstructor)
1 error, 0 warnings, 0 informations
```

```
$ uv run -w xlrd python -c 'import xlrd; print(xlrd.formula.Ref3D.__new__ is tuple.__new__)'
True
```
@brianschubert

Copy link
Copy Markdown
Collaborator

I pushed some commits which fix the __new__-related errors, remove the unused allowlist entries, and add allowlist entries for the remaining errors. I'll open a separate PR for the @disjoint_base errors to keep this diff smaller.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@sobolevn

Copy link
Copy Markdown
Member Author

Amazing work, thank you!

@srittau
srittau merged commit 4b0623f into main Sep 14, 2025
103 checks passed
@srittau
srittau deleted the sobolevn-patch-1 branch September 14, 2025 01:33
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