mypy icon indicating copy to clipboard operation
mypy copied to clipboard

Mypy 1.5 Release Planning

Open svalentin opened this issue 1 year ago • 5 comments

Planning to make the 1.5 release around middle of July.

Please post here any issues you'd like to see fixed in the release, or PRs you'd like to have merged. Will make the release branch as release-1.5.

svalentin avatar Jul 04 '23 16:07 svalentin

Looks like typeshed syncing is having a conflict when cherry picking "Remove use of LiteralString in builtins" (6f913a148) https://github.com/python/mypy/actions/workflows/sync_typeshed.yml

svalentin avatar Jul 04 '23 17:07 svalentin

Looks like typeshed syncing is having a conflict when cherry picking "Remove use of LiteralString in builtins" (6f913a148) https://github.com/python/mypy/actions/workflows/sync_typeshed.yml

Here you go:

  • #15590

I'm pretty seasoned with these by now 😆

AlexWaygood avatar Jul 04 '23 17:07 AlexWaygood

Ah, thanks! :D

svalentin avatar Jul 04 '23 17:07 svalentin

I would like to see this included. It's just missing a final review.

  • #15512

cdce8p avatar Jul 05 '23 10:07 cdce8p

Small fix for a sqlalchemy issue with the PEP 681 implementation

  • #15628

cdce8p avatar Jul 09 '23 11:07 cdce8p

Fixes a crash introduced in 1.4:

  • https://github.com/python/mypy/pull/15629

ikonst avatar Jul 12 '23 05:07 ikonst

Looks like we have a typeshed bug:

from unittest.mock import patch

def addition(a: int, b:int) -> int:
    return a+b

@patch('test.addition')
def patch_test(mock):
    print(mock)

if __name__ == "__main__":
    patch_test()

In this simple example mypy says:

test.py:12: error: Missing positional argument "mock" in call to "patch_test"  [call-arg]

Undoing https://github.com/python/typeshed/commit/9e86c6026a00a7bcc6c77ec8f7925a99930ee983 fixes it Filed https://github.com/python/typeshed/issues/10457 for record keeping

svalentin avatar Jul 13 '23 18:07 svalentin

A usability improvement with invalid generic instances. This PR reuses existing args whenever possible instead of replacing everything with Any. This would match the pyright behavior.

  • #15656

cdce8p avatar Jul 13 '23 20:07 cdce8p

I think that this is important enough to have a special note: https://github.com/python/mypy/pull/15668

sobolevn avatar Jul 14 '23 10:07 sobolevn

I think it's best if we leave https://github.com/python/mypy/pull/15668 for the next release

svalentin avatar Jul 14 '23 10:07 svalentin

Created the release-1.5 branch

svalentin avatar Jul 14 '23 11:07 svalentin

Hmm, I think we have an issue, but can't find out what changed. Did we remove typeshed for attr or something like that?

For this example

import attr

@attr.s(frozen=True)
class SomeProperties(object):
    x = attr.ib(type=str)
    y = attr.ib(type=int)

for field in attr.fields(SomeProperties):
    print(field.name)
    print(field.metadata)

mypy-1.4.1 finds no issues, but master (and release-1.5):

test2.py:9: error: "object" has no attribute "name"  [attr-defined]
test2.py:10: error: "object" has no attribute "metadata"  [attr-defined]
Found 2 errors in 1 file (checked 1 source file)

The issue is type should be attr.Attribute, not object

svalentin avatar Jul 14 '23 13:07 svalentin

Hmm, I think we have an issue, but can't find out what changed. Did we remove typeshed for attr or something like that?

You might want to revert #15021 for 1.5, too. That was one of the first commits in the release-1.4 branch. https://github.com/python/mypy/commit/3bf9fdc347ff1d27baead7660442d645a77cb2c6

cdce8p avatar Jul 14 '23 13:07 cdce8p

Ah, thanks!

svalentin avatar Jul 14 '23 13:07 svalentin

Did we remove typeshed for attr or something like that?

(attrs hasn't had stubs in typeshed for quite a while; they're a py.typed package and bundle their own stubs :)

AlexWaygood avatar Jul 14 '23 13:07 AlexWaygood

I made https://github.com/python/mypy/pull/15674 to revert it for 1.5 too. But we should probably figure out a more permanent solution. If we are going to keep reverting the change for every release, might as well revert it in master too.

svalentin avatar Jul 14 '23 13:07 svalentin

This PR fixes a new stubtest false positive that would be somewhat annoying for typeshed -- would be great to get it (or an alternative fix) in for v1.5:

  • #15689

AlexWaygood avatar Jul 16 '23 15:07 AlexWaygood

This PR fixes a new stubtest false positive that would be somewhat annoying for typeshed -- would be great to get it (or an alternative fix) in for v1.5:

There's some discussion on the PR about whether this is the correct fix or not. It would only cause two false positives for typeshed's CI, which can be fairly easily suppressed, so maybe it shouldn't block the release. (Having said that, it might also cause false positives for other projects using stubtest as well, if they're using dataclasses.)

AlexWaygood avatar Jul 17 '23 17:07 AlexWaygood

FYI The build failure on master today was related to the cython 3.0 release and a build issue with PyYAML==6.0.0 (required through pre-commit). That was resolved with PyYAML==6.0.1. Restarting the any failed workflows should be enough if necessary.

cdce8p avatar Jul 18 '23 01:07 cdce8p

I think the release will be postponed until early August since I'm on vacation for three weeks.

JukkaL avatar Jul 19 '23 09:07 JukkaL

It would be great if we could cherry-pick https://github.com/python/typeshed/commit/f577c4c133ae6bb57cade534179b41ef04b5731f onto the 1.5 release branch, so that mypy users will be able to use the latest typing_extensions features -- typing_extensions 4.7.0 has been out for about a month now

AlexWaygood avatar Jul 22 '23 11:07 AlexWaygood

It would be great if we could cherry-pick python/typeshed@f577c4c onto the 1.5 release branch, so that mypy users will be able to use the latest typing_extensions features -- typing_extensions 4.7.0 has been out for about a month now

Opened #15745 to do that

AlexWaygood avatar Jul 22 '23 12:07 AlexWaygood

I merged your cherry pick, but it looks like the tag was already made. We'll see what happens, worst case we can do a 1.5.1

hauntsaninja avatar Jul 22 '23 18:07 hauntsaninja

I merged your cherry pick

Thanks!

but it looks like the tag was already made.

Ah, I didn't spot that :/ there's also the unresolved issue of the stubtest regression I mentioned in https://github.com/python/mypy/issues/15588#issuecomment-1637124243...

AlexWaygood avatar Jul 22 '23 18:07 AlexWaygood

Ah, sorry, I didn't realize that creating the tag could cause problems. Thinking about it now, it makes sense. Some people might follow the git tags for releases instead of blog announcements.

svalentin avatar Jul 22 '23 20:07 svalentin

Anything release related you could use help with?

hauntsaninja avatar Aug 10 '23 09:08 hauntsaninja

Thanks for the offer, but we should be good to go. I was waiting for Jukka to help with the blog post as he has context on all the mypy works. He was on vacation until recently. Yesterday he did finish the blog post and we’re unblocked. I’m looking to finish the release today!

svalentin avatar Aug 10 '23 09:08 svalentin

mypy 1.5 is out! Read the blog post here - https://mypy-lang.blogspot.com/2023/08/mypy-15-released.html Also updated the news on the website https://mypy-lang.org/

svalentin avatar Aug 10 '23 13:08 svalentin

Closing this issue as the release is "done". Of course, if there's any issues please post them and we can reopen for a point release!

svalentin avatar Aug 10 '23 13:08 svalentin

@svalentin I think something's gone wrong with https://github.com/python/mypy/pull/15751 (which backported a stubtest fix to the release-1.5 branch).

I can see the change included in the 1.5.0 tag and the release-1.5 branch on GitHub. But if I actually pip install mypy==1.5 into a virtual environment and then open up Lib/site-packages/mypy/stubtest.py in the directory of the virtual environment, the change isn't there. That means I've got a very red CI for my PR trying to upgrade typeshed's mypy pin :(

  • https://github.com/python/typeshed/pull/10559

AlexWaygood avatar Aug 11 '23 10:08 AlexWaygood