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

Mypy 0.980 Release Planning #13385

Closed
jhance opened this issue Aug 11, 2022 · 36 comments
Closed

Mypy 0.980 Release Planning #13385

jhance opened this issue Aug 11, 2022 · 36 comments
Assignees
Labels
meta Issues tracking a broad area of work

Comments

@jhance
Copy link
Collaborator

jhance commented Aug 11, 2022

I am planning to make a 0.980 release around late August.

Please post here any issues you'd like to see fixed in the release, or PRs you'd like to have merged. There is no release branch yet - I will update the issue once it exists.

@jhance jhance self-assigned this Aug 11, 2022
@hauntsaninja
Copy link
Collaborator

Would be good to have a fix for #13227 (comment)
(note: I see Jukka happened to fix the message in #13382 )

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Aug 11, 2022

As mentioned in that issue, it would also be good for mypyc docs to be built, they're getting really stale: mypyc/mypyc#920

@ilevkivskyi
Copy link
Member

I would prefer my generic PRs included: #13389, #13396 (I mean I could just merge them, but ideally it would be great if someone looked at them)

@ilevkivskyi
Copy link
Member

Thanks @JelleZijlstra for stepping up and reviewing the PRs!

@hauntsaninja
Copy link
Collaborator

Regression on master with subtyping of Type: #13303 (comment)

@ilevkivskyi
Copy link
Member

ilevkivskyi commented Aug 19, 2022

Hm, it is not really about Type[...] by itself, it rather uncovered some existing inconsistencies. There actually two things: inconsistent type inference, and inconsistent overlapping for <nothing>.

On the first one, there are three ways a type inference can fail:

  • Impossible to satisfy pair, like List[T] <: int
  • Always satisfied pair, like List[T] <: object
  • Pair that can't be satisfied because of type variable upper bound, like Lits[T] <: List[int], where T <: str.

The problem is that which way it goes may depend on whether T appears in a nested position and/or inside a union. For general call checking it is not very important, we just get different error messages. But the problem is that we use constraints inference for various other things, e.g. overload consistency checks. To illustrate, here is a minimal repro:

T = TypeVar("T", bound=str)
@overload
def foo(x: Type[T] | int) -> int: ...  # Bogus error: Overloaded function signatures 1 and 2 overlap with incompatible return types
@overload
def foo(x: Callable[[int], bool]) -> str: ...

What is weird here, is that if I remove the | int part, it passes, while it is obvious that int can't be the reason for overlap. And indeed the reason is that without the union we get Cannot infer type variable code path, and with the union we get T = <nothing> code path.

Another inconsistency is that is_overlapping_types() returns True if is_proper_subtype() returns True for some pair. This is peoblematic w.r.t. <nothing>. Namely, [] == [42] is a totally safe thing, so we should say list[<nothing>] and list[int] are overlapping. But for overload checks, we could say the are not overlapping, because we already ignore empty lists for e.g. list[int] vs list[str]. Another repro to illustrate:

T = TypeVar("T", bound=str)

@overload
def foo(x: List[T]) -> str: ...  # Same bogus error here.
@overload
def foo(x: Sequence[int]) -> int: ...

While it passes if I put a plain List[str] there.

Fixing either of issues will fix the bug. I am not sure what is the best way. On one hand, union inference is known to cause many problems (e.g. @jhance discovered another false positive in a similar situation just couple days ago), but on other hand it is a very dangerous thing to touch. So I will probably go with fixing the second, unless there are other ideas.

@ilevkivskyi
Copy link
Member

OK, since I didn't hear any other ideas here is #13461 for the above issue.

@hauntsaninja hauntsaninja added the meta Issues tracking a broad area of work label Aug 21, 2022
@ilevkivskyi
Copy link
Member

Btw #13471 would be great to include (it is low risk because it is behind --enable-incomplete-features anyway, and fixes currently most upvoted issue).

@ilevkivskyi
Copy link
Member

Also I think #13381 would be good to include (fixes an annoying crash).

@cdce8p
Copy link
Collaborator

cdce8p commented Aug 27, 2022

New crash on master #13536. Bisects to #13494

@ilevkivskyi
Copy link
Member

Fix #13538 (but also I think will be after this release branch base)

@hauntsaninja
Copy link
Collaborator

Oh have we cut the release branch base? I don't see it in https://github.com/python/mypy/branches...
If you post the commit here I can mention if I think there are things on master that are important that didn't make it in

@ilevkivskyi
Copy link
Member

I talked to @jhance privately few days ago, and he told me he is thinking about making 4d4326a the base of release branch.

@ilevkivskyi
Copy link
Member

Hm, actually I am not sure now, he said "last typeshed sync", but I am not sure which one he meant.

@hauntsaninja
Copy link
Collaborator

We should make sure to include #13500 in the next release. Currently users of Python 3.10.7 and numpy are broken.

If you create the release branch, I can make sure to backport any necessary changes.

@AlexWaygood
Copy link
Member

We should make sure to include #13500 in the next release. Currently users of Python 3.10.7 and numpy are broken.

+1, we've had two duplicates reported today

@zevisert
Copy link

zevisert commented Sep 8, 2022

We should make sure to include #13500 in the next release. Currently users of Python 3.10.7 and numpy are broken.

Yes please! I spent almost two hours before finding the closed issues for this today (my project's mypy version didn't change (still 0.942, just the python version bump). The longer we wait for #13500, the more people will have adopted 3.10.7 and come reporting this here again

Edit: Thank you for pinning, I think that's actually a great way to spread awareness

@tdsmith
Copy link
Contributor

tdsmith commented Sep 9, 2022

#13425 is causing a lot of noise for my group and it ended up landing juuuuuust the wrong side of the line; we'd be grateful to see it in this release.

@hauntsaninja
Copy link
Collaborator

Backport PR for tdsmith's change here: #13644

@AlexWaygood
Copy link
Member

Typeshed's test suite is currently quite badly broken on the master and release-0.980 branches:

@hauntsaninja
Copy link
Collaborator

Backport PR for the custom typeshed dir regression here: #13658

@ilevkivskyi
Copy link
Member

@hauntsaninja Thanks for fixing this!

@cdce8p
Copy link
Collaborator

cdce8p commented Sep 14, 2022

Backport PR to fix tests with 3.10.7: #13665

@intgr
Copy link
Contributor

intgr commented Sep 19, 2022

Maybe also backport #13687, tweaks the error message of a new check added in 0.980.

@J08nY
Copy link

J08nY commented Sep 19, 2022

Is there any updated ETA on this? Original comment mentions late August while it is mid-September now and at least the #13500 issue is biting more and more users as they update to Python 3.10.7.

@jhance
Copy link
Collaborator Author

jhance commented Sep 26, 2022

Released: https://mypy-lang.blogspot.com/2022/09/mypy-0981-released.html

@hauntsaninja
Copy link
Collaborator

Typo in the blogpost: I think add_button("OK", tight) # This works as well should be add_button("OK", **tight)

@jhance
Copy link
Collaborator Author

jhance commented Sep 26, 2022

Ugh, I fixed that for the kwargs elsewhere. It seems like the script we use to convert to html has some bug

I fixed the tight

@jhance jhance closed this as completed Sep 26, 2022
@hauntsaninja
Copy link
Collaborator

If we make a 0.982, we should take #13461

Caused issue reported here: #13750 and regression on typeshed: python/typeshed#8796 (comment) / #13303 (comment)

@JohnVillalovos
Copy link

Just curious what will be the release version after 0.990? 1.0?

@AlexWaygood
Copy link
Member

Just curious what will be the release version after 0.990? 1.0?

Yes; see #13685 for details

@hauntsaninja
Copy link
Collaborator

hauntsaninja commented Sep 29, 2022

Two regressions in 0.980 at #13756 and #13760. Both repro on master / I link the PRs that introduced the regressions

Also we could cherry pick #13730 to help with some questions like #13765

@ilevkivskyi
Copy link
Member

I think we can also CP #13784

@ilevkivskyi
Copy link
Member

An also #13778. I will probably CP the three mentioned PRs (in addition to the one I already CPed) and will bump the minor version so everything will be ready for the bugfix release on Monday.

@ilevkivskyi
Copy link
Member

Oh wait, modules as protocol implementations were not included in the release, so we don't need the last one.

@ilevkivskyi
Copy link
Member

Done, everything is ready for the point release. cc @jhance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Issues tracking a broad area of work
Projects
None yet
Development

No branches or pull requests

10 participants