Uh oh!
There was an error while loading. Please reload this page.
Use typing_extensions.Self in the stubs/ directory - #9702
Conversation
This comment has been minimized.
This comment has been minimized.
AlexWaygood
commented
Feb 9, 2023
I'm not sure I understand the pyright failures in the |
srittau
commented
Feb 9, 2023
We probably need to have a conversation how we can better signal type checker compatibility to our users, but for now I'm fine with breaking compatibility when a new type checker version comes out. Automatically upgrading type stub packages is dangerous in any case. |
erictraut
commented
Feb 9, 2023
@AlexWaygood, this looks like a bug in pyright. I'll try to get it fixed by the end of the day. If this is blocking you, I could do a hot fix release, or we could wait until next Tuesday for the normal weekly release. |
AlexWaygood
commented
Feb 9, 2023
Don't worry, I can easily revert the changes on the affected files for now. No need for a hotfix release, I don't think. |
This comment has been minimized.
This comment has been minimized.
erictraut
commented
Feb 10, 2023
I've fixed the pyright bug. It will be included in the next weekly release (1.1.294). |
AlexWaygood
commented
Feb 10, 2023
Thank you very much! |
AlexWaygood
commented
Feb 15, 2023
7fc50c6 of this PR can be reverted now that we've updated to the latest pyright in CI, but I don't have access to a computer right now and it doesn't seem possible to revert a commit on your phone |
This comment has been minimized.
This comment has been minimized.
This reverts commit 7fc50c6.
srittau
commented
Feb 15, 2023
I've reverted 7fc50c6 |
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
srittau
left a comment
There was a problem hiding this comment.
Spot checking looks good.
AlexWaygood
commented
Feb 15, 2023
Thank you very much! |
types-tqdm broke compatibility with mypy < 1 and looks like we will start running into other typeshed packages soon python/typeshed#9702
This is necessary since fresh environment builds (including CI) appear to pull a version of types-requests that is broken with mypy < 1.0, types-requests being the broken-out 3rd-party package of stubs for requests, but that is still maintained in typeshed. This appears to be python/typeshed#9702. The mypy version is updated to ~=1.0.0 versioning now that it has moved to a major/minor/point versioning scheme.
This is necessary since fresh environment builds (including CI) appear to pull a version of types-requests that is broken with mypy < 1.0, types-requests being the broken-out 3rd-party package of stubs for requests, but that is still maintained in typeshed. This appears to be python/typeshed#9702. The mypy version is updated to ~=1.0.0 versioning now that it has moved to a major/minor/point versioning scheme.
…py on 3.6 mypy 0.971 is the last version to support Python 3.6, so this is what pip installs on 3.6. types-requests 2.28.11.12 is the last version to support mypy <1.0.0, due to changes in how the "Self" type is handled.¹ However, there's no way to declare that in package metadata (without requiring mypy, which is inappropriate for a typeshed package), so we have to resolve this dependency ourselves.² With a too-new types-requests, mypy fails on 3.6 with errors like: nextstrain/cli/remote/nextstrain_dot_org.py:230: error: Self? has no attribute "auth" which we saw in CI failures.³ We'll drop support for Python 3.6 sooner than later, but for now, keep it going. ¹ <python/typeshed@7180d02> <python/typeshed#9702> ² It would be possible if, for example, Python package metadata supported a "Conflicts" field, as many packaging systems do. ³ <https://github.com/nextstrain/cli/actions/runs/4266385449/jobs/7426841852#step:5:78>
tsibley
commented
Feb 27, 2023
End user here. Better signaling would be nice. It's too bad there's no "Conflicts" field for Python package metadata, since it would be ~perfect for the third-party typeshed stub packages to declare which versions of type checkers they aren't compatible with. |
Note that this will mean that the changed third-party packages are no longer compatible with mypy <1.0. However, we've already broken compatibility with mypy <1.0 in several third-party stubs in #9689 and #9695
¯\_(ツ)_/¯.I used the same script as in #9694 to create the first commit in this PR.