From 39b34154edda42080f16c548f47b7e7d2d2b3a31 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 6 Nov 2023 06:09:56 +0100 Subject: [PATCH] Use Sequence[] instead of list[] for lists of StrPath. --- src/antsibull_core/collections.py | 5 +++-- src/antsibull_core/config.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/antsibull_core/collections.py b/src/antsibull_core/collections.py index 1907410..ba08282 100644 --- a/src/antsibull_core/collections.py +++ b/src/antsibull_core/collections.py @@ -10,6 +10,7 @@ import asyncio import os import typing as t +from collections.abc import Sequence from .subprocess_util import async_log_run @@ -22,7 +23,7 @@ class CollectionFormatError(Exception): async def install_together( - collection_tarballs: list[StrPath], ansible_collections_dir: StrPath + collection_tarballs: Sequence[StrPath], ansible_collections_dir: StrPath ) -> None: installers = [] for pathname in collection_tarballs: @@ -44,7 +45,7 @@ async def install_together( async def install_separately( - collection_tarballs: list[StrPath], collection_dir: StrPath + collection_tarballs: Sequence[StrPath], collection_dir: StrPath ) -> list[str]: installers = [] collection_dirs: list[str] = [] diff --git a/src/antsibull_core/config.py b/src/antsibull_core/config.py index 6b4c143..df4e031 100644 --- a/src/antsibull_core/config.py +++ b/src/antsibull_core/config.py @@ -9,7 +9,7 @@ import os.path import typing as t -from collections.abc import Iterable, Mapping +from collections.abc import Iterable, Mapping, Sequence import perky # type: ignore[import] import pydantic as p @@ -61,7 +61,7 @@ def find_config_files(conf_files: Iterable[StrPath]) -> list[str]: def validate_config( config: Mapping, - filenames: list[StrPath] | list[str], + filenames: Sequence[StrPath], app_context_model: type[AppContext], ) -> None: """