From f6d6c486413a7ee0ab78cbdd868ddcde8a1e3e27 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 26 Nov 2022 13:32:11 -0500 Subject: [PATCH 1/3] Use setup-python v4 in Github action --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3a9975eb..5f9529d1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,7 +25,7 @@ jobs: - name: Install poetry run: pipx install poetry - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} cache: 'poetry' From 0e6075c5c9ddff7e169c40f4dfa3eb7ea879b780 Mon Sep 17 00:00:00 2001 From: Jerry Date: Sat, 26 Nov 2022 13:56:57 -0500 Subject: [PATCH 2/3] Fix failed tests in 3.11 --- pycardano/serialization.py | 6 +++--- test/pycardano/test_serialization.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pycardano/serialization.py b/pycardano/serialization.py index c3743c95..5e40a150 100644 --- a/pycardano/serialization.py +++ b/pycardano/serialization.py @@ -568,7 +568,7 @@ class MapCBORSerializable(CBORSerializable): Basic usage: - >>> from dataclasses import dataclass + >>> from dataclasses import dataclass, field >>> @dataclass ... class Test1(MapCBORSerializable): ... a: str="" @@ -576,7 +576,7 @@ class MapCBORSerializable(CBORSerializable): >>> @dataclass ... class Test2(MapCBORSerializable): ... c: str=None - ... test1: Test1=Test1() + ... test1: Test1=field(default_factory=Test1) >>> t = Test2(test1=Test1(a="a")) >>> t Test2(c=None, test1=Test1(a='a', b='')) @@ -600,7 +600,7 @@ class MapCBORSerializable(CBORSerializable): >>> @dataclass ... class Test2(MapCBORSerializable): ... c: str=field(default=None, metadata={"key": "0", "optional": True}) - ... test1: Test1=field(default=Test1(), metadata={"key": "1"}) + ... test1: Test1=field(default_factory=Test1, metadata={"key": "1"}) >>> t = Test2(test1=Test1(a="a")) >>> t Test2(c=None, test1=Test1(a='a', b='')) diff --git a/test/pycardano/test_serialization.py b/test/pycardano/test_serialization.py index d406de75..0f236980 100644 --- a/test/pycardano/test_serialization.py +++ b/test/pycardano/test_serialization.py @@ -87,7 +87,7 @@ class Test1(MapCBORSerializable): @dataclass class Test2(MapCBORSerializable): c: str = None - test1: Test1 = Test1() + test1: Test1 = field(default_factory=Test1) t = Test2(test1=Test1(a="a")) assert t.to_cbor() == "a26163f6657465737431a261616161616260" @@ -103,7 +103,7 @@ class Test1(MapCBORSerializable): @dataclass class Test2(MapCBORSerializable): c: str = field(default=None, metadata={"key": "0", "optional": True}) - test1: Test1 = field(default=Test1(), metadata={"key": "1"}) + test1: Test1 = field(default_factory=Test1, metadata={"key": "1"}) t = Test2(test1=Test1(a="a")) assert t.to_primitive() == {"1": {"0": "a", "1": ""}} From 95c07a7ce030ca8cdf03aac231e2ce8d77cfccfe Mon Sep 17 00:00:00 2001 From: Jerry Date: Sun, 27 Nov 2022 09:28:12 -0500 Subject: [PATCH 3/3] Include 3.11.0 in macos test --- .github/workflows/main.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5f9529d1..62f87640 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,6 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] python-version: [3.7, 3.8, 3.9, '3.10', '3.11'] - exclude: - # excludes python 3.11 on macOS - - os: macos-latest - python-version: '3.11' steps: - uses: actions/checkout@v3