From 8b01613dc93908ce477f0034343dff3ac7edace4 Mon Sep 17 00:00:00 2001 From: Lucas Gameiro Borges Date: Tue, 26 Nov 2024 01:49:15 +0000 Subject: [PATCH 1/3] add or clause --- .../data_platform_workflows_cli/craft_tools/collect_bases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py b/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py index 22c6d85a..1af4ade4 100644 --- a/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py +++ b/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py @@ -36,7 +36,7 @@ def get_bases(*, craft_: craft.Craft, yaml_data): For snaps & rocks, the Ubuntu version is the same for all architectures. """ - if craft_ is craft.Craft.ROCK: + if craft_ is craft.Craft.ROCK or "platforms" in yaml_data: # https://canonical-rockcraft.readthedocs-hosted.com/en/latest/reference/rockcraft.yaml/#platforms return [craft.Architecture(arch) for arch in yaml_data["platforms"]] if craft_ is craft.Craft.SNAP: From c5e624e285315bac740d8c7cd9404ebc981a280d Mon Sep 17 00:00:00 2001 From: Lucas Gameiro Borges Date: Tue, 26 Nov 2024 02:01:51 +0000 Subject: [PATCH 2/3] fix plugin too --- .../pytest_operator_cache/pytest_operator_cache/_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pytest_plugins/pytest_operator_cache/pytest_operator_cache/_plugin.py b/python/pytest_plugins/pytest_operator_cache/pytest_operator_cache/_plugin.py index f7e1b26d..7f4d70f4 100644 --- a/python/pytest_plugins/pytest_operator_cache/pytest_operator_cache/_plugin.py +++ b/python/pytest_plugins/pytest_operator_cache/pytest_operator_cache/_plugin.py @@ -47,7 +47,7 @@ async def build_charm( ), f"Architecture for {bases_index=} ({architectures[0]}) does not match host architecture ({architecture})" packed_charms = list(charm_path.glob(f"*{version}-{architecture}.charm")) else: - packed_charms = list(charm_path.glob(f"*-{architecture}.charm")) + packed_charms = list(charm_path.glob(f"*{architecture}.charm")) if len(packed_charms) == 1: # python-libjuju's model.deploy(), juju deploy, and juju bundle files expect local charms # to begin with `./` or `/` to distinguish them from Charmhub charms. From a801123cd31d8ef32b7468ba3787fbb34e7cd5d7 Mon Sep 17 00:00:00 2001 From: Lucas Gameiro Borges Date: Wed, 27 Nov 2024 13:59:31 +0000 Subject: [PATCH 3/3] add type hint --- .../data_platform_workflows_cli/craft_tools/collect_bases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py b/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py index 1af4ade4..ca738f9c 100644 --- a/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py +++ b/python/cli/data_platform_workflows_cli/craft_tools/collect_bases.py @@ -28,7 +28,7 @@ } -def get_bases(*, craft_: craft.Craft, yaml_data): +def get_bases(*, craft_: craft.Craft, yaml_data: dict): """Get architecture for each base For charms, multiple bases can have the same architecture