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

Commit

Permalink
Merge pull request #6537 from matrix-org/erikj/bump_mypy_version
Browse files Browse the repository at this point in the history
* commit '5cadbd9eb':
  More rewording of changelog.
  Reword changelog
  Add deprecation notes
  Newsfile
  Bump version of mypy
  • Loading branch information
anoadragon453 committed Mar 19, 2020
2 parents f60ca2b + 5cadbd9 commit fa87b96
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 8 deletions.
8 changes: 7 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Synapse 1.7.0 (2019-12-13)
==========================

No significant changes.
This release changes the default settings so that only local authenticated users can query the server's room directory. See the [upgrade notes](UPGRADE.rst#upgrading-to-v170) for details.

Support for SQLite versions before 3.11 is now deprecated. A future release will refuse to start if used with an SQLite version before 3.11.

Administrators are reminded that SQLite should not be used for production instances. Instructions for migrating to Postgres are available [here](docs/postgres.md). A future release of synapse will, by default, disable federation for servers using SQLite.

No significant changes since 1.7.0rc2.


Synapse 1.7.0rc2 (2019-12-11)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6537.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update `mypy` to new version.
3 changes: 2 additions & 1 deletion synapse/config/emailconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import email.utils
import os
from enum import Enum
from typing import Optional

import pkg_resources

Expand Down Expand Up @@ -101,7 +102,7 @@ def read_config(self, config, **kwargs):
# both in RegistrationConfig and here. We should factor this bit out
self.account_threepid_delegate_email = self.trusted_third_party_id_servers[
0
]
] # type: Optional[str]
self.using_identity_server_from_trusted_list = True
else:
raise ConfigError(
Expand Down
3 changes: 1 addition & 2 deletions synapse/config/ratelimiting.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,9 @@ def read_config(self, config, **kwargs):
)

rc_admin_redaction = config.get("rc_admin_redaction")
self.rc_admin_redaction = None
if rc_admin_redaction:
self.rc_admin_redaction = RateLimitConfig(rc_admin_redaction)
else:
self.rc_admin_redaction = None

def generate_config_section(self, **kwargs):
return """\
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def read_config(self, config, **kwargs):
self.admin_contact = config.get("admin_contact", None)

# FIXME: federation_domain_whitelist needs sytests
self.federation_domain_whitelist = None
self.federation_domain_whitelist = None # type: Optional[dict]
federation_domain_whitelist = config.get("federation_domain_whitelist", None)

if federation_domain_whitelist is not None:
Expand Down
2 changes: 1 addition & 1 deletion synapse/logging/_terse_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def pauseProducing(self):

def stopProducing(self):
self._paused = True
self._buffer = None
self._buffer = deque()

def resumeProducing(self):
self._paused = False
Expand Down
3 changes: 3 additions & 0 deletions synapse/logging/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@ def _get_cputime(self):
"""
current = get_thread_resource_usage()

# Indicate to mypy that we know that self.usage_start is None.
assert self.usage_start is not None

utime_delta = current.ru_utime - self.usage_start.ru_utime
stime_delta = current.ru_stime - self.usage_start.ru_stime

Expand Down
4 changes: 3 additions & 1 deletion synapse/streams/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict

from twisted.internet import defer

from synapse.handlers.account_data import AccountDataEventSource
Expand All @@ -35,7 +37,7 @@ class EventSources(object):
def __init__(self, hs):
self.sources = {
name: cls(hs) for name, cls in EventSources.SOURCE_TYPES.items()
}
} # type: Dict[str, Any]
self.store = hs.get_datastore()

@defer.inlineCallbacks
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ basepython = python3.7
skip_install = True
deps =
{[base]deps}
mypy==0.730
mypy==0.750
mypy-zope
env =
MYPYPATH = stubs/
Expand Down

0 comments on commit fa87b96

Please sign in to comment.