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

Add owners in interface.yaml #19

Merged
merged 5 commits into from
Aug 9, 2024
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
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 []
IronCore864 marked this conversation as resolved.
Show resolved Hide resolved

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 = "[email protected]" },
]
Expand Down
Loading