From 0c8d70daae4c4dfc989edad465db94ffc665416d Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Tue, 11 Oct 2022 10:26:55 +0200 Subject: [builder][server] restore compatibility with python 3.7 --- src/hydrilla/builder/local_apt.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/hydrilla/builder/local_apt.py') diff --git a/src/hydrilla/builder/local_apt.py b/src/hydrilla/builder/local_apt.py index 925fd61..385a533 100644 --- a/src/hydrilla/builder/local_apt.py +++ b/src/hydrilla/builder/local_apt.py @@ -143,7 +143,7 @@ class SourcesList: """Representation of apt's sources.list contents.""" def __init__( self, - list: list[str] = [], + list: t.List[str] = [], codename: t.Optional[str] = None ) -> None: """Initialize this SourcesList.""" @@ -187,7 +187,7 @@ pkgCacheGen::Essential "none"; Dir::Etc::Trusted "{directory}/etc/trusted.gpg"; ''' -def apt_keyring(keys: list[str]) -> bytes: +def apt_keyring(keys: t.List[str]) -> bytes: """ Download the requested keys if necessary and export them as a keyring suitable for passing to APT. @@ -234,7 +234,8 @@ def cache_apt_root(apt_root: Path, destination_zip: Path) -> None: if temporary_zip_path is not None and temporary_zip_path.exists(): temporary_zip_path.unlink() -def setup_local_apt(directory: Path, list: SourcesList, keys: list[str]) -> Apt: +def setup_local_apt(directory: Path, list: SourcesList, keys: t.List[str]) \ + -> Apt: """ Create files and directories necessary for running APT without root rights inside 'directory'. @@ -282,7 +283,7 @@ def setup_local_apt(directory: Path, list: SourcesList, keys: list[str]) -> Apt: return apt @contextmanager -def local_apt(list: SourcesList, keys: list[str]) -> t.Iterator[Apt]: +def local_apt(list: SourcesList, keys: t.List[str]) -> t.Iterator[Apt]: """ Create a temporary directory with proper local APT configuration in it. Yield an Apt object that can be used to issue apt-get commands. @@ -296,11 +297,11 @@ def local_apt(list: SourcesList, keys: list[str]) -> t.Iterator[Apt]: def download_apt_packages( list: SourcesList, - keys: list[str], - packages: list[str], + keys: t.List[str], + packages: t.List[str], destination_dir: Path, with_deps: bool -) -> list[str]: +) -> t.List[str]: """ Set up a local APT, update it using the specified sources.list configuration and use it to download the specified packages. -- cgit v1.2.3