diff --git a/interface_tester/collector.py b/interface_tester/collector.py index 5ef08b3..262c241 100644 --- a/interface_tester/collector.py +++ b/interface_tester/collector.py @@ -66,6 +66,7 @@ class _InterfacesDotYamlSpec(TypedDict): providers: List[_CharmTestConfig] requirers: List[_CharmTestConfig] + owners: List[str] class _RoleTestSpec(TypedDict): @@ -81,6 +82,7 @@ class InterfaceTestSpec(TypedDict): provider: _RoleTestSpec requirer: _RoleTestSpec + owners: List[str] def get_schema_from_module(module: object, name: str) -> Type[pydantic.BaseModel]: @@ -171,8 +173,9 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml if not charms: return None - providers = charms.get("providers", []) - requirers = charms.get("requirers", []) + providers = charms.get("providers") or [] + requirers = charms.get("requirers") or [] + owners = charms.get("owners") or [] if not isinstance(providers, list) or not isinstance(requirers, list): raise TypeError( @@ -196,7 +199,11 @@ def _gather_charms_for_version(version_dir: Path) -> Optional[_InterfacesDotYaml continue destination.append(cfg) - spec: _InterfacesDotYamlSpec = {"providers": provider_configs, "requirers": requirer_configs} + spec: _InterfacesDotYamlSpec = { + "providers": provider_configs, + "requirers": requirer_configs, + "owners": owners, + } return spec @@ -270,6 +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 [], } diff --git a/pyproject.toml b/pyproject.toml index d9a5404..4b43cd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta" [project] name = "pytest-interface-tester" -version = "3.0.0" +version = "3.1.0" authors = [ { name = "Pietro Pasotti", email = "pietro.pasotti@canonical.com" }, ]