From a7c56e3c775902c1133bc495c79dbe81fae15329 Mon Sep 17 00:00:00 2001 From: Valentin Niess Date: Thu, 22 May 2025 09:04:09 +0200 Subject: [PATCH] Build specific image tags --- python_appimage/commands/list.py | 3 ++- python_appimage/manylinux/__init__.py | 12 ++++++++++-- python_appimage/manylinux/download.py | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/python_appimage/commands/list.py b/python_appimage/commands/list.py index 6b3f526..55b3414 100644 --- a/python_appimage/commands/list.py +++ b/python_appimage/commands/list.py @@ -27,7 +27,8 @@ def execute(tag): pythons.append((path.name, version)) pythons = sorted(pythons) + n = max(len(version) for (_, version) in pythons) for (abi, version) in pythons: - log('LIST', "{:8} -> /opt/python/{:}".format(version, abi)) + log('LIST', "{:{n}} -> /opt/python/{:}".format(version, abi, n=n)) return pythons diff --git a/python_appimage/manylinux/__init__.py b/python_appimage/manylinux/__init__.py index 419caba..09e32ad 100644 --- a/python_appimage/manylinux/__init__.py +++ b/python_appimage/manylinux/__init__.py @@ -12,14 +12,22 @@ __all__ = ['Arch', 'Downloader', 'ensure_image', 'ImageExtractor', 'LinuxTag', def ensure_image(tag): '''Extract a manylinux image to the cache''' + try: + tag, image_tag = tag.rsplit(':', 1) + except ValueError: + image_tag = 'latest' + tag, arch = tag.split('_', 1) tag = LinuxTag.from_brief(tag) arch = Arch.from_str(arch) downloader = Downloader(tag=tag, arch=arch) - downloader.download() + downloader.download(tag=image_tag) - image_extractor = ImageExtractor(downloader.default_destination()) + image_extractor = ImageExtractor( + prefix = downloader.default_destination(), + tag = image_tag + ) image_extractor.extract() return SimpleNamespace( diff --git a/python_appimage/manylinux/download.py b/python_appimage/manylinux/download.py index 29ffeb0..589d3d6 100644 --- a/python_appimage/manylinux/download.py +++ b/python_appimage/manylinux/download.py @@ -56,6 +56,7 @@ class Downloader: def download( self, destination: Optional[Path]=None, + *, tag: Optional[str] = 'latest' ): '''Download Manylinux image'''