Closed github-actions[bot] closed 1 year ago
Looks like there some new typing errors:
synapse/util/file_consumer.py:82: error: Argument 1 to "run_in_background" has incompatible type "Callable[[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P], Deferred[_R]]"; expected "Callable[[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P], Awaitable[None]]" [arg-type]
synapse/util/file_consumer.py:83: error: Argument 2 to "run_in_background" has incompatible type "ISynapseReactor"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
synapse/util/file_consumer.py:84: error: Argument 3 to "run_in_background" has incompatible type "ThreadPool"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
synapse/util/file_consumer.py:85: error: Argument 4 to "run_in_background" has incompatible type "Callable[[], None]"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
tests/http/server/_base.py:338: error: Access to generic instance variables via class is ambiguous [misc]
Found 5 errors in 2 files (checked 851 source files)
Seem to be due to twisted/twisted#11947 / deferToThreadPool
getting types added.
This has gotten "worse":
synapse/util/file_consumer.py:82: error: Argument 1 to "run_in_background" has incompatible type "Callable[[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P], Deferred[_R]]"; expected "Callable[[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P], Awaitable[None]]" [arg-type]
synapse/util/file_consumer.py:83: error: Argument 2 to "run_in_background" has incompatible type "ISynapseReactor"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
synapse/util/file_consumer.py:84: error: Argument 3 to "run_in_background" has incompatible type "ThreadPool"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
synapse/util/file_consumer.py:85: error: Argument 4 to "run_in_background" has incompatible type "Callable[[], None]"; expected "[IReactorFromThreads, ThreadPool, Callable[_P, _R], **_P.args]" [arg-type]
tests/state/test_v2.py:679: error: Argument 2 to "assert_dict" of "TestCase" has incompatible type "Mapping[Tuple[str, str], str]"; expected "Dict[Any, Any]" [arg-type]
tests/http/server/_base.py:338: error: Access to generic instance variables via class is ambiguous [misc]
tests/handlers/test_appservice.py:163: error: Item "None" of "Optional[RoomAliasMapping]" has no attribute "room_id" [union-attr]
tests/handlers/test_appservice.py:164: error: Item "None" of "Optional[RoomAliasMapping]" has no attribute "servers" [union-attr]
tests/http/test_matrixfederationclient.py:86: error: Incompatible types in "yield" (actual type "Deferred[Dict[str, Any]]", expected type "Deferred[object]") [misc]
Additionally, unit tests are now failing:
https://github.com/matrix-org/synapse/actions/runs/6571619244/job/17851137720
Additionally, unit tests are now failing:
This is due to twisted/twisted#11996.
I have the unit tests mostly sorted too.
This should be fixed; if not we'll handle it in the follow-up ticket.
See https://github.com/matrix-org/synapse/actions/runs/6637463573