Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Update mypy to 0.950 and fix complaints #12650

Merged
merged 16 commits into from
May 6, 2022
Merged

Update mypy to 0.950 and fix complaints #12650

merged 16 commits into from
May 6, 2022

Commits on May 5, 2022

  1. Bump mypy and mypy-zope

    David Robertson committed May 5, 2022
    Configuration menu
    Copy the full SHA
    68788fa View commit details
    Browse the repository at this point in the history
  2. Ignore false positive in synapse.handler.message

    Not really fair to call this a false positive since our annotation is
    incorrect, but screw it.
    David Robertson committed May 5, 2022
    Configuration menu
    Copy the full SHA
    bfd4913 View commit details
    Browse the repository at this point in the history
  3. Fix false positive in synapse.appservice.api

    This function is passed an arbitrary JSON value, not a JSONDict.
    David Robertson committed May 5, 2022
    Configuration menu
    Copy the full SHA
    fb11e63 View commit details
    Browse the repository at this point in the history
  4. Ignore false positive in synapse.config.appservice

    David Robertson committed May 5, 2022
    Configuration menu
    Copy the full SHA
    fd5b09b View commit details
    Browse the repository at this point in the history
  5. Ignore false positive in synapse.events.presence_router

    David Robertson committed May 5, 2022
    Configuration menu
    Copy the full SHA
    b5228ca View commit details
    Browse the repository at this point in the history

Commits on May 6, 2022

  1. Try to fix complaints about unawaited coroutines

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    8459efa View commit details
    Browse the repository at this point in the history
  2. Fix tests.storage.test_monthly_active_users

    Before the recent changes, both expressions assigned to D were
    coroutines. Now the second expression is a synchronous function
    returning a deferred.
    
    ```
    tests/storage/test_monthly_active_users.py:237: error: Incompatible
    types in assignment (expression has type "Deferred[None]", variable has
    type "Coroutine[Any, Any, None]")  [assignment]
    ```
    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    227e4cb View commit details
    Browse the repository at this point in the history
  3. Fix sorteddict stubs

    Mypy now includes python/typeshed#6653
    which triggered
    
    ```
    stubs/sortedcontainers/sorteddict.pyi:88: error: Signature of "update" incompatible with supertype "MutableMapping"  [override]
    stubs/sortedcontainers/sorteddict.pyi:88: note:      Superclass:
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, SupportsKeysAndGetItem[_KT, _VT], **kwargs: _VT) -> None
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, **kwargs: _VT) -> None
    stubs/sortedcontainers/sorteddict.pyi:88: note:      Subclass:
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, Mapping[_KT, _VT], **kwargs: _VT) -> None
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, Iterable[Tuple[_KT, _VT]], **kwargs: _VT) -> None
    stubs/sortedcontainers/sorteddict.pyi:88: note:          @overload
    stubs/sortedcontainers/sorteddict.pyi:88: note:          def update(self, **kwargs: _VT) -> None
    ```
    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    e1993b4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7dade80 View commit details
    Browse the repository at this point in the history
  5. Update sentry-sdk

    This suppresses the complaint
    
    ```
    synapse/app/_base.py:491: error: Cannot instantiate abstract class "init" with abstract attribute "__exit__"  [abstract]
    ```
    
    by including the change in
    https://github.com/getsentry/sentry-python/p
    
    I can't see anything obviously terrible in the changelogs; see
    https://github.com/getsentry/sentry-python/releases
    
    Additionally, we don't upper bound sentry-sdk, so fresh installations
    might be using this version anyway.
    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    36d74eb View commit details
    Browse the repository at this point in the history
  6. Changelog innit

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    b99d5ab View commit details
    Browse the repository at this point in the history
  7. Use result: object to make ignores unnecessary

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    a58d973 View commit details
    Browse the repository at this point in the history
  8. Inline calls to get_success

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    7c4f6dc View commit details
    Browse the repository at this point in the history
  9. Remove comment that is confused about life

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    88fe871 View commit details
    Browse the repository at this point in the history
  10. Workaround typeignore in synapse.handlers.message

    grrr at not validating. Y'all need more static typing in your lives.
    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    2557199 View commit details
    Browse the repository at this point in the history
  11. Appease linter

    David Robertson committed May 6, 2022
    Configuration menu
    Copy the full SHA
    bf59fae View commit details
    Browse the repository at this point in the history