From f6396ff8216a9d3e70c1e183876fb3fd2d966799 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 29 Oct 2024 11:04:03 +0530 Subject: [PATCH 1/4] client: Fix push command with aiohttp >= 3.10.6 In aiohttp 3.10.6 https://github.com/aio-libs/aiohttp/pull/6485 a new abstract method was implemented in aiohttp.Payload. So trying to instantiate the AsyncNamedFilePart class fails and causes the push command to fail: ``` File "/usr/sbin/flat-manager-client", line 350, in upload_objects named = get_object_multipart(repo_path, file_obj) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/sbin/flat-manager-client", line 738, in get_object_multipart return AsyncNamedFilePart( ^^^^^^^^^^^^^^^^^^^ TypeError: Can't instantiate abstract class AsyncNamedFilePart without an implementation for abstract method 'decode' ``` Create a placeholder method for now. --- flat-manager-client | 3 +++ 1 file changed, 3 insertions(+) diff --git a/flat-manager-client b/flat-manager-client index 7417134..dc2dd25 100755 --- a/flat-manager-client +++ b/flat-manager-client @@ -133,6 +133,9 @@ class AsyncNamedFilePart(aiohttp.payload.Payload): self._size = os.stat(value).st_size + def decode(self, encoding: str = "utf-8", errors: str = "strict") -> str: + raise NotImplementedError + async def write(self, writer): if self._file is None or self._file.closed: self._file = open(self._value, "rb") From 481a6269a10887e3d1babaa974788dec2a399b34 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 29 Oct 2024 11:09:30 +0530 Subject: [PATCH 2/4] Dockerfile: Update URL to flat-manager-hooks --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 97e48f0..0175ddd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,8 +7,8 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > rustup.sh && \ ADD . /src RUN cd /src && /root/.cargo/bin/cargo build --release -RUN git clone https://github.com/jameswestman/flathub-hooks.git -RUN cd flathub-hooks && /root/.cargo/bin/cargo build --release +RUN git clone https://github.com/flathub-infra/flat-manager-hooks.git +RUN cd flat-manager-hooks && /root/.cargo/bin/cargo build --release FROM ubuntu:22.04 From 6c0e986d29681a0adada8547a820763eefe78de2 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 29 Oct 2024 11:11:54 +0530 Subject: [PATCH 3/4] tests: Bump runtime to 24.08 This is used in org.flatpak.Builder now, so CI should test against 24.08 --- tests/Dockerfile | 2 +- tests/org.flatpak.FlatManagerCI.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Dockerfile b/tests/Dockerfile index 2e15b96..62430ed 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -3,7 +3,7 @@ FROM quay.io/fedora/fedora:latest # Install Rust, Cargo, and run-tests.py's dependencies RUN dnf install -y rust cargo flatpak flatpak-builder python3-pip python3-gobject ostree-devel libpq-devel RUN flatpak remote-add flathub https://flathub.org/repo/flathub.flatpakrepo -RUN flatpak install --noninteractive flathub org.freedesktop.Platform//21.08 org.freedesktop.Sdk//21.08 +RUN flatpak install --noninteractive flathub org.freedesktop.Platform//24.08 org.freedesktop.Sdk//24.08 RUN pip install asyncio aiohttp tenacity # Use the test config.json and configure it with a GPG key diff --git a/tests/org.flatpak.FlatManagerCI.yml b/tests/org.flatpak.FlatManagerCI.yml index 27005c5..d6f9026 100644 --- a/tests/org.flatpak.FlatManagerCI.yml +++ b/tests/org.flatpak.FlatManagerCI.yml @@ -1,6 +1,6 @@ app-id: org.flatpak.FlatManagerCI runtime: org.freedesktop.Platform -runtime-version: '21.08' +runtime-version: '24.08' sdk: org.freedesktop.Sdk command: hello.sh modules: From cf786100e7c3cb14429e7db2828b0411938b6033 Mon Sep 17 00:00:00 2001 From: bbhtt Date: Tue, 29 Oct 2024 11:18:59 +0530 Subject: [PATCH 4/4] run-test: Drop unused code Usage dropped in ac62ecbb4f0a2c9ee576c4b1251a730a8427003c --- tests/run-test.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/run-test.py b/tests/run-test.py index 8bb9ef5..dce632f 100755 --- a/tests/run-test.py +++ b/tests/run-test.py @@ -3,15 +3,9 @@ import os import subprocess import sys -import time from subprocess import PIPE -def sleep(seconds): - print(f"Waiting {seconds} seconds") - time.sleep(seconds) - - def exec(cmd): print("Executing", cmd)