Attempt to fix twisted trunk (#16115)

This commit is contained in:
David Robertson 2023-08-15 17:07:13 +01:00 committed by GitHub
parent ad3f43be9a
commit 47c629bb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 2 deletions

View File

@ -5,6 +5,9 @@ on:
- cron: 0 8 * * * - cron: 0 8 * * *
workflow_dispatch: workflow_dispatch:
# NB: inputs are only present when this workflow is dispatched manually.
# (The default below is the default field value in the form to trigger
# a manual dispatch). Otherwise the inputs will evaluate to null.
inputs: inputs:
twisted_ref: twisted_ref:
description: Commit, branch or tag to checkout from upstream Twisted. description: Commit, branch or tag to checkout from upstream Twisted.
@ -49,7 +52,7 @@ jobs:
extras: "all" extras: "all"
- run: | - run: |
poetry remove twisted poetry remove twisted
poetry add --extras tls git+https://github.com/twisted/twisted.git#${{ inputs.twisted_ref }} poetry add --extras tls git+https://github.com/twisted/twisted.git#${{ inputs.twisted_ref || 'trunk' }}
poetry install --no-interaction --extras "all test" poetry install --no-interaction --extras "all test"
- name: Remove warn_unused_ignores from mypy config - name: Remove warn_unused_ignores from mypy config
run: sed '/warn_unused_ignores = True/d' -i mypy.ini run: sed '/warn_unused_ignores = True/d' -i mypy.ini

1
changelog.d/16115.misc Normal file
View File

@ -0,0 +1 @@
Attempt to fix the twisted trunk job.

View File

@ -45,6 +45,13 @@ warn_unused_ignores = False
disallow_untyped_defs = False disallow_untyped_defs = False
disallow_incomplete_defs = False disallow_incomplete_defs = False
[mypy-synapse.util.manhole]
# This module imports something from Twisted which has a bad annotation in Twisted trunk,
# but is unannotated in Twisted's latest release. We want to type-ignore the problem
# in the twisted trunk job, even though it has no effect on normal mypy runs.
warn_unused_ignores = False
;; Dependencies without annotations ;; Dependencies without annotations
;; Before ignoring a module, check to see if type stubs are available. ;; Before ignoring a module, check to see if type stubs are available.
;; The `typeshed` project maintains stubs here: ;; The `typeshed` project maintains stubs here:

View File

@ -98,7 +98,9 @@ def manhole(settings: ManholeConfig, globals: Dict[str, Any]) -> ServerFactory:
SynapseManhole, dict(globals, __name__="__console__") SynapseManhole, dict(globals, __name__="__console__")
) )
factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker])) # type-ignore: This is an error in Twisted's annotations. See
# https://github.com/twisted/twisted/issues/11812 and /11813 .
factory = manhole_ssh.ConchFactory(portal.Portal(rlm, [checker])) # type: ignore[arg-type]
# conch has the wrong type on these dicts (says bytes to bytes, # conch has the wrong type on these dicts (says bytes to bytes,
# should be bytes to Keys judging by how it's used). # should be bytes to Keys judging by how it's used).