Skip to content

Commit b2467c4

Browse files
Mic92mergify[bot]
authored andcommitted
typecheck twisted
1 parent c48efb2 commit b2467c4

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

buildbot_nix/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def reload_projects(self) -> None:
287287

288288
@defer.inlineCallbacks
289289
def run(self) -> Generator[Any, object, Any]:
290-
d = threads.deferToThread(self.reload_projects)
290+
d = threads.deferToThread(self.reload_projects) # type: ignore[no-untyped-call]
291291

292292
self.error_msg = ""
293293

@@ -677,7 +677,7 @@ def check_builder(
677677
endpoint_object: Any,
678678
endpoint_dict: dict[str, Any],
679679
object_type: str,
680-
) -> Generator[Any, Any, Any]:
680+
) -> Generator[defer.Deferred[Match], Any, Any]:
681681
res = yield endpoint_object.get({}, endpoint_dict)
682682
if res is None:
683683
return None
@@ -704,23 +704,23 @@ def match_BuildEndpoint_rebuild( # noqa: N802
704704
epobject: Any,
705705
epdict: dict[str, Any],
706706
options: dict[str, Any],
707-
) -> Generator[Any, Any, Any]:
707+
) -> defer.Deferred[Match]:
708708
return self.check_builder(epobject, epdict, "build")
709709

710710
def match_BuildEndpoint_stop( # noqa: N802
711711
self,
712712
epobject: Any,
713713
epdict: dict[str, Any],
714714
options: dict[str, Any],
715-
) -> Generator[Any, Any, Any]:
715+
) -> defer.Deferred[Match]:
716716
return self.check_builder(epobject, epdict, "build")
717717

718718
def match_BuildRequestEndpoint_stop( # noqa: N802
719719
self,
720720
epobject: Any,
721721
epdict: dict[str, Any],
722722
options: dict[str, Any],
723-
) -> Generator[Any, Any, Any]:
723+
) -> defer.Deferred[Match]:
724724
return self.check_builder(epobject, epdict, "buildrequest")
725725

726726

buildbot_nix/worker.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from buildbot_worker.bot import Worker
88
from twisted.application import service
9+
from twisted.python import components
910

1011

1112
def require_env(key: str) -> str:
@@ -31,7 +32,7 @@ class WorkerConfig:
3132

3233

3334
def setup_worker(
34-
application: service.Application,
35+
application: components.Componentized,
3536
builder_id: int,
3637
config: WorkerConfig,
3738
) -> None:
@@ -64,12 +65,12 @@ def setup_worker(
6465
s.setServiceParent(application)
6566

6667

67-
def setup_workers(application: service.Application, config: WorkerConfig) -> None:
68+
def setup_workers(application: components.Componentized, config: WorkerConfig) -> None:
6869
for i in range(config.worker_count):
6970
setup_worker(application, i, config)
7071

7172

7273
# note: this line is matched against to check that this is a worker
7374
# directory; do not edit it.
74-
application = service.Application("buildbot-worker")
75+
application = service.Application("buildbot-worker") # type: ignore[no-untyped-call]
7576
setup_workers(application, WorkerConfig())

nix/treefmt/flake-module.nix

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@
1010
programs.deno.enable = true;
1111
settings.formatter.shellcheck.options = [ "-s" "bash" ];
1212

13-
programs.mypy.enable = true;
14-
programs.mypy.directories."." = { };
13+
programs.mypy = {
14+
enable = true;
15+
directories.".".extraPythonPackages = [
16+
pkgs.python3.pkgs.twisted
17+
];
18+
};
1519
settings.formatter.python = {
1620
command = "sh";
1721
options = [

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,3 @@ ignore_missing_imports = true
100100
[[tool.mypy.overrides]]
101101
module = "buildbot_worker.*"
102102
ignore_missing_imports = true
103-
104-
[[tool.mypy.overrides]]
105-
module = "twisted.*"
106-
ignore_missing_imports = true

0 commit comments

Comments
 (0)