Skip to content

Commit

Permalink
Added some missing return type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Apr 20, 2022
1 parent 7d196ea commit 953390f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/asphalt/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Component(metaclass=ABCMeta):
__slots__ = ()

@abstractmethod
async def start(self, ctx: Context):
async def start(self, ctx: Context) -> None:
"""
Perform any necessary tasks to start the services provided by this component.
Expand Down Expand Up @@ -62,7 +62,9 @@ def __init__(self, components: Dict[str, Optional[Dict[str, Any]]] = None) -> No
self.child_components: OrderedDict[str, Component] = OrderedDict()
self.component_configs = components or {}

def add_component(self, alias: str, type: Union[str, Type] = None, **config):
def add_component(
self, alias: str, type: Union[str, Type] = None, **config
) -> None:
"""
Add a child component.
Expand Down Expand Up @@ -100,7 +102,7 @@ def add_component(self, alias: str, type: Union[str, Type] = None, **config):
component = component_types.create_object(**config)
self.child_components[alias] = component

async def start(self, ctx: Context):
async def start(self, ctx: Context) -> None:
"""
Create child components that have been configured but not yet created and then calls their
:meth:`~Component.start` methods in separate tasks and waits until they have completed.
Expand Down Expand Up @@ -130,7 +132,7 @@ class CLIApplicationComponent(ContainerComponent):
warning is emitted.
"""

async def start(self, ctx: Context):
async def start(self, ctx: Context) -> None:
def run_complete(f):
# If run() raised an exception, print it with a traceback and exit with code 1
exc = f.exception()
Expand Down

0 comments on commit 953390f

Please sign in to comment.