Skip to content

Commit

Permalink
Merge pull request #19 from IronCore864/add-owner
Browse files Browse the repository at this point in the history
Add `owners` in `interface.yaml`
  • Loading branch information
PietroPasotti authored Aug 9, 2024
2 parents e2322ec + 405db24 commit 983fc62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions interface_tester/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class _InterfacesDotYamlSpec(TypedDict):

providers: List[_CharmTestConfig]
requirers: List[_CharmTestConfig]
owners: List[str]


class _RoleTestSpec(TypedDict):
Expand All @@ -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]:
Expand Down Expand Up @@ -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(
Expand All @@ -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


Expand Down Expand Up @@ -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 [],
}


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
]
Expand Down

0 comments on commit 983fc62

Please sign in to comment.