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 <class 'seedsigner.views.view.Destination'> 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
This commit is contained in:
Daniel Bast
2024-05-16 15:30:38 +02:00
parent 9aa95e8c92
commit b7f14397b0
3 changed files with 7 additions and 5 deletions
+4 -2
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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):