feat: add type hints to all public functions in trustgraph/base (#803)

feat: add type hints to all public functions in trustgraph/base

Add type annotations to 23 modules covering:
- Metrics classes (ConsumerMetrics, ProducerMetrics, etc.)
- Spec classes (ConsumerSpec, ProducerSpec, SubscriberSpec, etc.)
- Service classes with add_args() and run() methods
- Utility functions (logging, pubsub, clients)
- AsyncProcessor methods

All 93 public functions now fully typed.

Refs #785

* refactor: deduplicate imports and move __future__ after docstrings

Addresses review feedback on PR #803:
- Remove duplicate 'from argparse import ArgumentParser' across 12 files
- Move 'from __future__ import annotations' to line 1 in all files
- Clean up excessive blank lines
This commit is contained in:
RaccoonLabs 2026-04-16 05:59:04 -03:00 committed by Cyber MacGeddon
parent 22096e07e2
commit 706e62b7c2
23 changed files with 125 additions and 61 deletions

View file

@ -1,3 +1,6 @@
from __future__ import annotations
from argparse import ArgumentParser
"""
Document embeddings query service. Input is vectors. Output is list of
@ -82,7 +85,7 @@ class DocumentEmbeddingsQueryService(FlowProcessor):
await flow("response").send(r, properties={"id": id})
@staticmethod
def add_args(parser):
def add_args(parser: ArgumentParser) -> None:
FlowProcessor.add_args(parser)
@ -93,7 +96,7 @@ class DocumentEmbeddingsQueryService(FlowProcessor):
help=f'Number of concurrent requests (default: {default_concurrency})'
)
def run():
def run() -> None:
Processor.launch(default_ident, __doc__)