Skip to content

Commit

Permalink
ci(linters): address more pyright warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Matsuoka <[email protected]>
  • Loading branch information
cmatsuoka committed Sep 9, 2023
1 parent 1a507e1 commit e5bbafe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions craft_application/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class _Dispatcher(craft_cli.Dispatcher):
@property
def parsed_args(self) -> argparse.Namespace:
"""The map of parsed command-line arguments."""
return self._parsed_command_args
return self._parsed_command_args or argparse.Namespace()


@final
Expand All @@ -61,7 +61,7 @@ class AppMetadata:
source_ignore_patterns: list[str] = field(default_factory=lambda: [])
managed_instance_project_path = pathlib.PurePosixPath("/root/project")

ProjectClass: type[models.Project] = models.Project
ProjectClass: type[models.Project] = field(init=False)

def __post_init__(self) -> None:
setter = super().__setattr__
Expand Down Expand Up @@ -129,7 +129,7 @@ def cache_dir(self) -> str:
# xdg types: https://github.com/python/typeshed/pull/10163
return save_cache_path(self.app.name) # type: ignore[no-any-return]

def _configure_services(self, build_for: str) -> None:
def _configure_services(self, build_for: str | None) -> None:
"""Configure additional keyword arguments for any service classes.
Any child classes that override this must either call this directly or must
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

class MyProject(craft_application.models.Project):
def get_build_plan(self) -> list[models.BuildInfo]:
arch = craft_application.util.get_host_architecture()
arch = util.get_host_architecture()
return [models.BuildInfo(arch, arch, bases.BaseName("ubuntu", "22.04"))]


Expand Down

0 comments on commit e5bbafe

Please sign in to comment.