Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update craft-application #1327

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions charmcraft/application/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
APP_METADATA = AppMetadata(
name="charmcraft",
summary=GENERAL_SUMMARY,
ProjectClass=models.charmcraft.Project,
# This will change soon so just ignore it for now.
ProjectClass=models.charmcraft.Project, # type: ignore[arg-type]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, how is it going to look like?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #1328, charmcraft/models/project.py

)


Expand All @@ -43,15 +44,15 @@ def command_groups(self) -> list[craft_cli.CommandGroup]:
"""Excluding lifecycle commands for right now."""
return self._command_groups

def _configure_services(self) -> None:
super()._configure_services()
def _configure_services(self, platform: str | None, build_for: str | None) -> None:
super()._configure_services(platform, build_for)
self.services.set_kwargs(
"package",
work_dir=self._work_dir,
prime_dir=self.services.lifecycle.prime_dir,
)

def _get_dispatcher(self) -> craft_cli.Dispatcher:
def _get_dispatcher(self) -> craft_cli.Dispatcher: # type: ignore[override]
"""Configure charmcraft, including a fallback to the classic entrypoint.

Side-effect: This method may exit the process.
Expand Down Expand Up @@ -104,7 +105,7 @@ def _get_dispatcher(self) -> craft_cli.Dispatcher:

def main() -> int:
"""Run craft-application based charmcraft with classic fallback."""
services = ServiceFactory(app=APP_METADATA, PackageClass=None) # type: ignore[call-arg]
services = ServiceFactory(app=APP_METADATA, PackageClass=None) # type: ignore[arg-type]

app = Charmcraft(app=APP_METADATA, services=services)

Expand Down
7 changes: 4 additions & 3 deletions charmcraft/models/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@

"""Extension models."""

from typing import Dict, List, Tuple
from typing import Any, Dict, List, Tuple, Union

from charmcraft.models.basic import ModelConfigDefaults


class ExtensionModel(ModelConfigDefaults, frozen=True):
# Mypy complaining about frozen inheritance.
class ExtensionModel(ModelConfigDefaults, frozen=True): # type: ignore[misc]
"""Extension model for presentation."""

name: str
bases: List[Tuple[str, str]]

def marshal(self) -> Dict[str, str]:
def marshal(self) -> Dict[str, Union[str, List[str], Dict[str, Any]]]:
"""Marshal model into a dictionary for presentation."""
return {
"Extension name": self.name,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
long_description = fh.read()

install_requires = [
"craft-application@git+https://github.com/canonical/craft-application.git",
"craft-application@git+https://github.com/canonical/craft-application.git@4c3162b6ec5bdc1b85227bd777dc0005415604d7",
"craft-cli",
"craft-parts>=1.18",
"craft-providers",
Expand Down
Loading