Skip to content

Commit

Permalink
Use StrPath; fix collection missing error reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein committed Aug 29, 2024
1 parent 4d0d6fe commit ed72585
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/antsibull/collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from pydantic.functional_validators import BeforeValidator
from typing_extensions import Annotated

if t.TYPE_CHECKING:
from _typeshed import StrPath


def _convert_pypi_version(v: t.Any) -> t.Any:
if not isinstance(v, str):
Expand Down Expand Up @@ -80,7 +83,7 @@ class CollectionsMetadata(p.BaseModel):
collections: dict[str, CollectionMetadata]

@staticmethod
def load_from(deps_dir: str | None):
def load_from(deps_dir: StrPath | None):
if deps_dir is None:
return CollectionsMetadata(collections={})
collection_meta_path = os.path.join(deps_dir, "collection-meta.yaml")
Expand Down
2 changes: 1 addition & 1 deletion src/antsibull/collection_meta_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def validate(self, data: CollectionsMetadata) -> None:

# Complain about remaining collections
for collection in sorted(remaining_collections):
print(f"collections: No metadata present for {collection}")
self.errors.append(f"collections: No metadata present for {collection}")


def lint_collection_meta() -> int:
Expand Down

0 comments on commit ed72585

Please sign in to comment.