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

Bump mypy from 1.10.1 to 1.11.0 #1887

Merged
merged 4 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
467 changes: 236 additions & 231 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ _ = "returns.contrib.hypothesis._entrypoint"
python = "^3.9"

typing-extensions = ">=4.0,<5.0"
mypy = { version = ">=1.10,<1.11", optional = true }
pytest = { version = "^8.0", optional = true }
hypothesis = { version = "^6.98", optional = true }
mypy = {version = ">=1.11,<1.12", optional = true}

[tool.poetry.group.dev.dependencies]
anyio = "^4.3"
Expand Down
2 changes: 1 addition & 1 deletion typesafety/test_converters/test_flatten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

flatten(returns_result())
out: |
main:7: error: Argument 1 to "flatten" has incompatible type "Result[int, Result[int, str]]"; expected "KindN[Result[Any, Any], KindN[Result[Any, Any], Never, Result[int, str], NoReturn], Result[int, str], NoReturn]" [arg-type]
main:7: error: Argument 1 to "flatten" has incompatible type "Result[int, Result[int, str]]"; expected "KindN[Result[Any, Any], KindN[Result[Any, Any], Never, Result[int, str], Never], Result[int, str], Never]" [arg-type]


- case: flatten_io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@

my_pair = Pair.from_paired(1, 'a')
my_pair.pair(function) # this should and will error
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
out: |
sobolevn marked this conversation as resolved.
Show resolved Hide resolved
main:9: error: Argument 1 to "pair" of "Pair" has incompatible type "Callable[[str, int], Pair[float, bool]]"; expected "Callable[[int, str], KindN[Pair[Any, Any], float, bool, Any]]" [arg-type]
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
) -> 'MyClass[N, E]':
...
out: |
main:10: error: Return type "MyClass[N, E]" of "alt" incompatible with return type "KindN[MyClass[V, E], V, _UpdatedType, NoReturn]" in supertype "AltableN" [override]
main:10: error: Return type "MyClass[N, E]" of "alt" incompatible with return type "KindN[MyClass[V, E], V, _UpdatedType, Never]" in supertype "AltableN" [override]
main:12: error: Argument 1 of "alt" is incompatible with supertype "AltableN"; supertype defines the argument type as "Callable[[E], _UpdatedType]" [override]
main:12: note: This violates the Liskov substitution principle
main:12: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@
def from_value(cls, inner_value: V) -> None:
...
out: |
main:11: error: Argument 1 of "apply" is incompatible with supertype "ApplicativeN"; supertype defines the argument type as "KindN[MyClass[V], Callable[[V], _UpdatedType], NoReturn, NoReturn]" [override]
main:11: error: Argument 1 of "apply" is incompatible with supertype "ApplicativeN"; supertype defines the argument type as "KindN[MyClass[V], Callable[[V], _UpdatedType], Never, Never]" [override]
main:11: note: This violates the Liskov substitution principle
main:11: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:16: error: Return type "None" of "from_value" incompatible with return type "KindN[MyClass[V], _UpdatedType, NoReturn, NoReturn]" in supertype "ApplicativeN" [override]
main:16: error: Return type "None" of "from_value" incompatible with return type "KindN[MyClass[V], _UpdatedType, Never, Never]" in supertype "ApplicativeN" [override]
main:16: error: Argument 1 of "from_value" is incompatible with supertype "ApplicativeN"; supertype defines the argument type as "_UpdatedType" [override]
main:16: note: This violates the Liskov substitution principle
main:16: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
8 changes: 4 additions & 4 deletions typesafety/test_interfaces/test_bindable/test_inheritance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@
) -> 'MyClass[V]':
...
out: |
main:9: error: Return type "MyClass[V]" of "bind" incompatible with return type "KindN[MyClass[V], _UpdatedType, NoReturn, NoReturn]" in supertype "BindableN" [override]
main:11: error: Argument 1 of "bind" is incompatible with supertype "BindableN"; supertype defines the argument type as "Callable[[V], KindN[MyClass[V], _UpdatedType, NoReturn, NoReturn]]" [override]
main:9: error: Return type "MyClass[V]" of "bind" incompatible with return type "KindN[MyClass[V], _UpdatedType, Never, Never]" in supertype "BindableN" [override]
main:11: error: Argument 1 of "bind" is incompatible with supertype "BindableN"; supertype defines the argument type as "Callable[[V], KindN[MyClass[V], _UpdatedType, Never, Never]]" [override]
main:11: note: This violates the Liskov substitution principle
main:11: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

Expand All @@ -140,8 +140,8 @@
) -> 'MyClass[V, T]':
...
out: |
main:10: error: Return type "MyClass[V, T]" of "bind" incompatible with return type "KindN[MyClass[V, T], _UpdatedType, T, NoReturn]" in supertype "BindableN" [override]
main:12: error: Argument 1 of "bind" is incompatible with supertype "BindableN"; supertype defines the argument type as "Callable[[V], KindN[MyClass[V, T], _UpdatedType, T, NoReturn]]" [override]
main:10: error: Return type "MyClass[V, T]" of "bind" incompatible with return type "KindN[MyClass[V, T], _UpdatedType, T, Never]" in supertype "BindableN" [override]
main:12: error: Argument 1 of "bind" is incompatible with supertype "BindableN"; supertype defines the argument type as "Callable[[V], KindN[MyClass[V, T], _UpdatedType, T, Never]]" [override]
main:12: note: This violates the Liskov substitution principle
main:12: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
) -> MyClass[_FirstType, _FirstType]:
...
out: |
main:13: error: Return type "MyClass[_FirstType, _FirstType]" of "from_failure" incompatible with return type "KindN[MyClass[_FirstType, _SecondType], _FirstType, _UpdatedType, NoReturn]" in supertype "DiverseFailableN" [override]
main:13: error: Return type "MyClass[_FirstType, _FirstType]" of "from_failure" incompatible with return type "KindN[MyClass[_FirstType, _SecondType], _FirstType, _UpdatedType, Never]" in supertype "DiverseFailableN" [override]
main:15: error: Argument 1 of "from_failure" is incompatible with supertype "DiverseFailableN"; supertype defines the argument type as "_UpdatedType" [override]
main:15: note: This violates the Liskov substitution principle
main:15: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Expand Down
4 changes: 2 additions & 2 deletions typesafety/test_interfaces/test_lashable/test_inheritance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
) -> MyClass[N, E]:
...
out: |
main:10: error: Return type "MyClass[N, E]" of "lash" incompatible with return type "KindN[MyClass[V, E], V, _UpdatedType, NoReturn]" in supertype "LashableN" [override]
main:12: error: Argument 1 of "lash" is incompatible with supertype "LashableN"; supertype defines the argument type as "Callable[[E], KindN[MyClass[V, E], V, _UpdatedType, NoReturn]]" [override]
main:10: error: Return type "MyClass[N, E]" of "lash" incompatible with return type "KindN[MyClass[V, E], V, _UpdatedType, Never]" in supertype "LashableN" [override]
main:12: error: Argument 1 of "lash" is incompatible with supertype "LashableN"; supertype defines the argument type as "Callable[[E], KindN[MyClass[V, E], V, _UpdatedType, Never]]" [override]
main:12: note: This violates the Liskov substitution principle
main:12: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

Expand Down
4 changes: 2 additions & 2 deletions typesafety/test_interfaces/test_mappable/test_inheritance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
def map(self, function: Callable[[V], int]) -> 'MyClass[V]':
...
out: |
main:9: error: Return type "MyClass[V]" of "map" incompatible with return type "KindN[MyClass[V], _UpdatedType, NoReturn, NoReturn]" in supertype "MappableN" [override]
main:9: error: Return type "MyClass[V]" of "map" incompatible with return type "KindN[MyClass[V], _UpdatedType, Never, Never]" in supertype "MappableN" [override]
main:9: error: Argument 1 of "map" is incompatible with supertype "MappableN"; supertype defines the argument type as "Callable[[V], _UpdatedType]" [override]
main:9: note: This violates the Liskov substitution principle
main:9: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Expand All @@ -116,7 +116,7 @@
def map(self, function: Callable[[E], N]) -> 'MyClass[E, N]':
...
out: |
main:10: error: Return type "MyClass[E, N]" of "map" incompatible with return type "KindN[MyClass[V, E], _UpdatedType, E, NoReturn]" in supertype "MappableN" [override]
main:10: error: Return type "MyClass[E, N]" of "map" incompatible with return type "KindN[MyClass[V, E], _UpdatedType, E, Never]" in supertype "MappableN" [override]
main:10: error: Argument 1 of "map" is incompatible with supertype "MappableN"; supertype defines the argument type as "Callable[[V], _UpdatedType]" [override]
main:10: note: This violates the Liskov substitution principle
main:10: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@
async def awaitable(self) -> None:
...
out: |
main:12: error: Return type "Generator[None, None, T]" of "__await__" incompatible with return type "Generator[Any, Any, IOLikeN[T, NoReturn, NoReturn]]" in supertype "AwaitableFutureN" [override]
main:15: error: Return type "Coroutine[Any, Any, None]" of "awaitable" incompatible with return type "Coroutine[Any, Any, IOLikeN[T, NoReturn, NoReturn]]" in supertype "AwaitableFutureN" [override]
main:12: error: Return type "Generator[None, None, T]" of "__await__" incompatible with return type "Generator[Any, Any, IOLikeN[T, Never, Never]]" in supertype "AwaitableFutureN" [override]
main:15: error: Return type "Coroutine[Any, Any, None]" of "awaitable" incompatible with return type "Coroutine[Any, Any, IOLikeN[T, Never, Never]]" in supertype "AwaitableFutureN" [override]
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,19 @@
) -> MyClass[T]:
...
out: |
main:13: error: Return type "MyClass[T]" of "bind_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, NoReturn, NoReturn]" in supertype "FutureLikeN" [override]
main:19: error: Return type "MyClass[T]" of "bind_async" incompatible with return type "KindN[MyClass[T], _UpdatedType, NoReturn, NoReturn]" in supertype "FutureLikeN" [override]
main:21: error: Argument 1 of "bind_async" is incompatible with supertype "FutureLikeN"; supertype defines the argument type as "Callable[[T], Awaitable[KindN[MyClass[T], _UpdatedType, NoReturn, NoReturn]]]" [override]
main:13: error: Return type "MyClass[T]" of "bind_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, Never, Never]" in supertype "FutureLikeN" [override]
main:19: error: Return type "MyClass[T]" of "bind_async" incompatible with return type "KindN[MyClass[T], _UpdatedType, Never, Never]" in supertype "FutureLikeN" [override]
main:21: error: Argument 1 of "bind_async" is incompatible with supertype "FutureLikeN"; supertype defines the argument type as "Callable[[T], Awaitable[KindN[MyClass[T], _UpdatedType, Never, Never]]]" [override]
main:21: note: This violates the Liskov substitution principle
main:21: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:27: error: Argument 1 of "bind_awaitable" is incompatible with supertype "FutureLikeN"; supertype defines the argument type as "Callable[[T], Awaitable[_UpdatedType]]" [override]
main:27: note: This violates the Liskov substitution principle
main:27: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:31: error: Return type "MyClass[T]" of "bind_async_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, NoReturn, NoReturn]" in supertype "FutureLikeN" [override]
main:31: error: Return type "MyClass[T]" of "bind_async_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, Never, Never]" in supertype "FutureLikeN" [override]
main:33: error: Argument 1 of "bind_async_future" is incompatible with supertype "FutureLikeN"; supertype defines the argument type as "Callable[[T], Awaitable[Future[_UpdatedType]]]" [override]
main:33: note: This violates the Liskov substitution principle
main:33: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:37: error: Return type "MyClass[T]" of "from_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, NoReturn, NoReturn]" in supertype "FutureLikeN" [override]
main:37: error: Return type "MyClass[T]" of "from_future" incompatible with return type "KindN[MyClass[T], _UpdatedType, Never, Never]" in supertype "FutureLikeN" [override]
main:39: error: Argument 1 of "from_future" is incompatible with supertype "FutureLikeN"; supertype defines the argument type as "Future[_UpdatedType]" [override]
main:39: note: This violates the Liskov substitution principle
main:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@
async def awaitable(self) -> IOResult[int, E]:
...
out: |
main:15: error: Return type "Generator[None, None, Result[T, E]]" of "__await__" incompatible with return type "Generator[Any, Any, IOLikeN[T, E, NoReturn]]" in supertype "AwaitableFutureN" [override]
main:18: error: Return type "Coroutine[Any, Any, IOResult[int, E]]" of "awaitable" incompatible with return type "Coroutine[Any, Any, IOLikeN[T, E, NoReturn]]" in supertype "AwaitableFutureN" [override]
main:15: error: Return type "Generator[None, None, Result[T, E]]" of "__await__" incompatible with return type "Generator[Any, Any, IOLikeN[T, E, Never]]" in supertype "AwaitableFutureN" [override]
main:18: error: Return type "Coroutine[Any, Any, IOResult[int, E]]" of "awaitable" incompatible with return type "Coroutine[Any, Any, IOLikeN[T, E, Never]]" in supertype "AwaitableFutureN" [override]
Original file line number Diff line number Diff line change
Expand Up @@ -103,19 +103,19 @@
) -> FutureResult[Any, E]:
...
out: |
main:16: error: Return type "MyClass[E, N]" of "bind_future_result" incompatible with return type "KindN[MyClass[T, E], _UpdatedType, E, NoReturn]" in supertype "FutureResultLikeN" [override]
main:16: error: Return type "MyClass[E, N]" of "bind_future_result" incompatible with return type "KindN[MyClass[T, E], _UpdatedType, E, Never]" in supertype "FutureResultLikeN" [override]
main:17: error: Argument 1 of "bind_future_result" is incompatible with supertype "FutureResultLikeN"; supertype defines the argument type as "Callable[[T], FutureResult[_UpdatedType, E]]" [override]
main:17: note: This violates the Liskov substitution principle
main:17: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:21: error: Return type "MyClass[E, N]" of "bind_async_future_result" incompatible with return type "KindN[MyClass[T, E], _UpdatedType, E, NoReturn]" in supertype "FutureResultLikeN" [override]
main:21: error: Return type "MyClass[E, N]" of "bind_async_future_result" incompatible with return type "KindN[MyClass[T, E], _UpdatedType, E, Never]" in supertype "FutureResultLikeN" [override]
main:22: error: Argument 1 of "bind_async_future_result" is incompatible with supertype "FutureResultLikeN"; supertype defines the argument type as "Callable[[T], Awaitable[FutureResult[_UpdatedType, E]]]" [override]
main:22: note: This violates the Liskov substitution principle
main:22: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:26: error: Return type "MyClass[T, E]" of "from_future_result" incompatible with return type "KindN[MyClass[T, E], _ValueType, _ErrorType, NoReturn]" in supertype "FutureResultLikeN" [override]
main:26: error: Return type "MyClass[T, E]" of "from_future_result" incompatible with return type "KindN[MyClass[T, E], _ValueType, _ErrorType, Never]" in supertype "FutureResultLikeN" [override]
main:27: error: Argument 1 of "from_future_result" is incompatible with supertype "FutureResultLikeN"; supertype defines the argument type as "FutureResult[_ValueType, _ErrorType]" [override]
main:27: note: This violates the Liskov substitution principle
main:27: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:32: error: Return type "FutureResult[Any, E]" of "from_failed_future" incompatible with return type "KindN[MyClass[T, E], T, _ErrorType, NoReturn]" in supertype "FutureResultLikeN" [override]
main:32: error: Return type "FutureResult[Any, E]" of "from_failed_future" incompatible with return type "KindN[MyClass[T, E], T, _ErrorType, Never]" in supertype "FutureResultLikeN" [override]
main:33: error: Argument 1 of "from_failed_future" is incompatible with supertype "FutureResultLikeN"; supertype defines the argument type as "Future[_ErrorType]" [override]
main:33: note: This violates the Liskov substitution principle
main:33: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
) -> MyClass[_NewValueType]:
...
out: |
main:13: error: Return type "MyClass[_ValueType]" of "bind_io" incompatible with return type "KindN[MyClass[_ValueType], _UpdatedType, NoReturn, NoReturn]" in supertype "IOLikeN" [override]
main:13: error: Return type "MyClass[_ValueType]" of "bind_io" incompatible with return type "KindN[MyClass[_ValueType], _UpdatedType, Never, Never]" in supertype "IOLikeN" [override]
main:15: error: Argument 1 of "bind_io" is incompatible with supertype "IOLikeN"; supertype defines the argument type as "Callable[[_ValueType], IO[_UpdatedType]]" [override]
main:15: note: This violates the Liskov substitution principle
main:15: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
main:19: error: Signature of "from_io" incompatible with supertype "IOLikeN" [override]
main:19: note: Superclass:
main:19: note: def [_UpdatedType] from_io(cls, inner_value: IO[_UpdatedType]) -> KindN[MyClass[_ValueType], _UpdatedType, NoReturn, NoReturn]
main:19: note: def [_UpdatedType] from_io(cls, inner_value: IO[_UpdatedType]) -> KindN[MyClass[_ValueType], _UpdatedType, Never, Never]
main:19: note: Subclass:
main:19: note: def [_NewValueType] from_io(self, inner_value: IO[_NewValueType]) -> MyClass[_NewValueType]
Loading
Loading