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

Fix Mypy linting with latest Twisted #239

Merged
merged 7 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
1 change: 1 addition & 0 deletions changelog.d/237.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Constrain Twisted verison in setup.py and fix type hint errors.
callahad marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions changelog.d/239.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Constrain Twisted verison in setup.py and fix type hint errors.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def read(fname: Union[str, "PathLike[str]"]) -> str:
python_requires=">=3.7",
setup_requires=["setuptools_scm"],
install_requires=[
"Twisted>=19.2.1",
"Twisted>=19.2.1,<21.7.0",
"prometheus_client>=0.7.0,<0.8",
"aioapns>=1.10",
"cryptography>=2.1.4",
Expand Down
5 changes: 3 additions & 2 deletions sygnal/helper/proxy/connectproxyclient_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ def __init__(
self.dst_port = dst_port
self._proxy_auth = proxy_auth
self.wrapped_factory = wrapped_factory
self.on_connection = defer.Deferred()
self.on_connection: defer.Deferred = defer.Deferred()

def startedConnecting(self, connector):
return self.wrapped_factory.startedConnecting(connector)

def buildProtocol(self, addr):
wrapped_protocol = self.wrapped_factory.buildProtocol(addr)
assert wrapped_protocol is not None

return HTTPConnectProtocol(
self.dst_host,
Expand Down Expand Up @@ -220,7 +221,7 @@ def __init__(self, host: bytes, port: int, proxy_auth: Optional[Tuple[str, str]]
self.host = host
self.port = port
self._proxy_auth = proxy_auth
self.on_connected = defer.Deferred()
self.on_connected: defer.Deferred = defer.Deferred()

def connectionMade(self):
logger.debug("Connected to proxy, sending CONNECT")
Expand Down