From 39e88e1c72617b2c490e6f38be3526efda9547c1 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Thu, 5 Sep 2024 09:25:03 +0800 Subject: [PATCH 1/4] feat: change owners to maintainers --- interface_tester/collector.py | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/interface_tester/collector.py b/interface_tester/collector.py index 262c241..dcb566b 100644 --- a/interface_tester/collector.py +++ b/interface_tester/collector.py @@ -66,7 +66,7 @@ class _InterfacesDotYamlSpec(TypedDict): providers: List[_CharmTestConfig] requirers: List[_CharmTestConfig] - owners: List[str] + maintainers: str class _RoleTestSpec(TypedDict): @@ -82,7 +82,7 @@ class InterfaceTestSpec(TypedDict): provider: _RoleTestSpec requirer: _RoleTestSpec - owners: List[str] + maintainers: str def get_schema_from_module(module: object, name: str) -> Type[pydantic.BaseModel]: @@ -175,7 +175,7 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml providers = charms.get("providers") or [] requirers = charms.get("requirers") or [] - owners = charms.get("owners") or [] + maintainers = charms.get("maintainers", "") if not isinstance(providers, list) or not isinstance(requirers, list): raise TypeError( @@ -202,7 +202,7 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml spec: _InterfacesDotYamlSpec = { "providers": provider_configs, "requirers": requirer_configs, - "owners": owners, + "maintainers": maintainers, } return spec @@ -277,7 +277,7 @@ def gather_test_spec_for_version( "schema": schemas.get("requirer"), "charms": charms.get("requirers", []) if charms else [], }, - "owners": charms.get("owners") or [] if charms else [], + "maintainers": charms.get("maintainers", "") if charms else "", } diff --git a/pyproject.toml b/pyproject.toml index 4b43cd6..aa6bace 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta" [project] name = "pytest-interface-tester" -version = "3.1.0" +version = "3.1.1" authors = [ { name = "Pietro Pasotti", email = "pietro.pasotti@canonical.com" }, ] From 9a6966d9b9f3356dd826db5c6857b30e69a58949 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Fri, 6 Sep 2024 08:21:59 +0800 Subject: [PATCH 2/4] Update interface_tester/collector.py Co-authored-by: PietroPasotti --- interface_tester/collector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface_tester/collector.py b/interface_tester/collector.py index dcb566b..0e6c387 100644 --- a/interface_tester/collector.py +++ b/interface_tester/collector.py @@ -175,7 +175,7 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml providers = charms.get("providers") or [] requirers = charms.get("requirers") or [] - maintainers = charms.get("maintainers", "") + maintainers = charms.get("maintainers") or "" if not isinstance(providers, list) or not isinstance(requirers, list): raise TypeError( From ba63e78c3e04e42c971fcdc93302a75957a6d41c Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Fri, 6 Sep 2024 08:23:50 +0800 Subject: [PATCH 3/4] chore: refactor according to review --- interface_tester/collector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface_tester/collector.py b/interface_tester/collector.py index 0e6c387..5c18d44 100644 --- a/interface_tester/collector.py +++ b/interface_tester/collector.py @@ -277,7 +277,7 @@ def gather_test_spec_for_version( "schema": schemas.get("requirer"), "charms": charms.get("requirers", []) if charms else [], }, - "maintainers": charms.get("maintainers", "") if charms else "", + "maintainers": charms.get("maintainers") or "" if charms else "", } From 97e5a6cba98449a2a2267569b4bdc7429028d1e1 Mon Sep 17 00:00:00 2001 From: Tiexin Guo Date: Mon, 9 Sep 2024 14:41:03 +0800 Subject: [PATCH 4/4] chore: rename maintainers to singular --- interface_tester/collector.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interface_tester/collector.py b/interface_tester/collector.py index 5c18d44..cac3407 100644 --- a/interface_tester/collector.py +++ b/interface_tester/collector.py @@ -66,7 +66,7 @@ class _InterfacesDotYamlSpec(TypedDict): providers: List[_CharmTestConfig] requirers: List[_CharmTestConfig] - maintainers: str + maintainer: str class _RoleTestSpec(TypedDict): @@ -82,7 +82,7 @@ class InterfaceTestSpec(TypedDict): provider: _RoleTestSpec requirer: _RoleTestSpec - maintainers: str + maintainer: str def get_schema_from_module(module: object, name: str) -> Type[pydantic.BaseModel]: @@ -175,7 +175,7 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml providers = charms.get("providers") or [] requirers = charms.get("requirers") or [] - maintainers = charms.get("maintainers") or "" + maintainer = charms.get("maintainer") or "" if not isinstance(providers, list) or not isinstance(requirers, list): raise TypeError( @@ -202,7 +202,7 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml spec: _InterfacesDotYamlSpec = { "providers": provider_configs, "requirers": requirer_configs, - "maintainers": maintainers, + "maintainer": maintainer, } return spec @@ -277,7 +277,7 @@ def gather_test_spec_for_version( "schema": schemas.get("requirer"), "charms": charms.get("requirers", []) if charms else [], }, - "maintainers": charms.get("maintainers") or "" if charms else "", + "maintainer": charms.get("maintainer") or "" if charms else "", }