From b7f14397b0e9f296501e168cc2688442e972fd58 Mon Sep 17 00:00:00 2001 From: Daniel Bast <2790401+dbast@users.noreply.github.com> Date: Fri, 15 Sep 2023 16:31:48 +0200 Subject: [PATCH] Add Python 3.12 to test matrix as upper bound and fix findings This is done in advance to open the door for upgrading to newer Python versions on seeedsigner-os at any time. Fixes / required changes: * Fix `E ValueError: mutable default for field next_destination is not allowed: use default_factory` * Install package during CI with pip instead of calling the setup.py (which got deprecated a while a ago and breaks with Python 3.11/3.12) * Update Pillow version to 10.0.1 = first version with Python 3.12 support --- .github/workflows/tests.yml | 6 ++++-- requirements.txt | 2 +- src/seedsigner/views/view.py | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index cb7c05755..294e20beb 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10"] + # 3.10: currently used by Seedsigner + # 3.12: latest stable Python as upper test bound + python-version: ["3.10", "3.12"] steps: - uses: actions/checkout@v3 @@ -34,7 +36,7 @@ jobs: sudo apt-get install libzbar0 python -m pip install --upgrade pip pip install -r requirements.txt -r tests/requirements.txt - python setup.py install + pip install . - name: Test with pytest run: | mkdir artifacts diff --git a/requirements.txt b/requirements.txt index f86231b03..b6a227138 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ embit==0.7.0 -Pillow==9.4.0 +Pillow==10.0.1 pyzbar @ git+https://github.com/seedsigner/pyzbar.git@c3c237821c6a20b17953efe59b90df0b514a1c03 qrcode==7.3.1 urtypes @ git+https://github.com/selfcustody/urtypes.git@7fb280eab3b3563dfc57d2733b0bf5cbc0a96a6a diff --git a/src/seedsigner/views/view.py b/src/seedsigner/views/view.py index a5c4800c6..a7c83d49d 100644 --- a/src/seedsigner/views/view.py +++ b/src/seedsigner/views/view.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from typing import Type from seedsigner.gui.components import FontAwesomeIconConstants, SeedSignerIconConstants @@ -313,7 +313,7 @@ class ErrorView(View): status_headline: str = None text: str = None button_text: str = None - next_destination: Destination = Destination(MainMenuView, clear_history=True) + next_destination: Destination = field(default_factory=lambda: Destination(MainMenuView, clear_history=True)) def run(self):