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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pinned dependencies #3019

Closed
wants to merge 1 commit into from
Closed

Conversation

Zac-HD
Copy link
Member

@Zac-HD Zac-HD commented Jun 13, 2021

I've closed this PR since the main change is to update mypy, and I'd rather do that after some fixes for new bugs are released in the upcoming 0.910 version. When that's available, see master...Zac-HD:mypy-0.910 for the expected changes.

The long-awaited part is improved inference for unions of covariant generics - one_of(...) should then infer SearchStrategy[... | ...] with the correct union of element types automatically, since Ex is a covariant typevar. See #1270 (comment) and the linked issues, plus python/mypy#9994 for the fix 馃榿

If other typecheckers (e.g. pyright, pyre, pytype) don't handle this, we might want to (a) restore the overloads as a mitigation, and (b) add them to our CI so that we can detect future breakage for those users.

@Zac-HD Zac-HD force-pushed the create-pull-request/patch branch 2 times, most recently from 1706ebe to db817d2 Compare June 14, 2021 14:24
Copy link
Member Author

@Zac-HD Zac-HD left a comment

Choose a reason for hiding this comment

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

Mostly needs some upstream patches before I'll be happy merging this.

@@ -103,7 +103,7 @@ class HypothesisFixComplexMinMagnitude(VisitorBasedCodemodCommand):
METADATA_DEPENDENCIES = (cst.metadata.QualifiedNameProvider,)

@m.call_if_inside(
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers"))
m.Call(metadata=match_qualname("hypothesis.strategies.complex_numbers")) # type: ignore
Copy link
Member Author

@Zac-HD Zac-HD Jun 14, 2021

Choose a reason for hiding this comment

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

This is a mypy bug, confusing m.Call with builtins.Call (which does't accept a metadata= kwarg).

hypothesis/extra/codemods.py:106: error: Unexpected keyword argument "metadata" for "Call"
...python3.8/site-packages/mypy/typeshed/stdlib/builtins.pyi:95: note: "Call" defined here

I think python/mypy#10617 is the same underlying bug.

@@ -28,7 +28,7 @@
import datetime as dt

import pytz
from pytz.tzfile import StaticTzInfo
from pytz.tzinfo import StaticTzInfo # type: ignore # incomplete stubs
Copy link
Member Author

@Zac-HD Zac-HD Jun 14, 2021

Choose a reason for hiding this comment

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

Unclear if this is meant to be public or not, but it's missing from the typeshed stubs and installing them complains with the same error. At minimum, mypy should not recommend installing stubs which are already installed! See also python/mypy#10645

@Zac-HD Zac-HD force-pushed the create-pull-request/patch branch from ccce896 to db817d2 Compare June 15, 2021 03:59
@Zac-HD Zac-HD force-pushed the create-pull-request/patch branch from db817d2 to 065b89b Compare June 15, 2021 04:49
@Zac-HD Zac-HD closed this Jun 15, 2021
This was referenced Jun 23, 2021
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.

None yet

1 participant