From df9219719ceba76e8f1bcd5c097788c651e8b7c0 Mon Sep 17 00:00:00 2001 From: Zeph Grunschlag Date: Thu, 15 Dec 2022 17:50:20 -0600 Subject: [PATCH 1/3] `Op(Enum)` should fall down on python 3.11.1 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 84340d079..ddc7da01b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: container: python:${{ matrix.python }} strategy: matrix: - python: ["3.10"] + python: ["3.10", "3.11"] steps: - run: python3 --version - name: Check out code @@ -29,7 +29,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python: [ "3.10" ] + python: ["3.10", "3.11"] steps: - name: Check out code uses: actions/checkout@v2 From 04197dded8876693b2d1745ddc9e7d130a3c7ae1 Mon Sep 17 00:00:00 2001 From: Zeph Grunschlag Date: Thu, 15 Dec 2022 18:01:46 -0600 Subject: [PATCH 2/3] =?UTF-8?q?the=20fix=20=F0=9F=A4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyteal/ir/ops.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pyteal/ir/ops.py b/pyteal/ir/ops.py index 9ec496288..74f3663ac 100644 --- a/pyteal/ir/ops.py +++ b/pyteal/ir/ops.py @@ -1,4 +1,4 @@ -from typing import NamedTuple +from dataclasses import dataclass from enum import Enum, Flag, auto @@ -11,7 +11,12 @@ class Mode(Flag): Mode.__module__ = "pyteal" -OpType = NamedTuple("OpType", [("value", str), ("mode", Mode), ("min_version", int)]) + +@dataclass +class OpType: + value: str + mode: Mode + min_version: int class Op(Enum): From e3e544ea0ef9577dafb0bcd6a07f85f7061a6d33 Mon Sep 17 00:00:00 2001 From: Zeph Grunschlag Date: Thu, 15 Dec 2022 18:55:27 -0600 Subject: [PATCH 3/3] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaf339d44..bb72845d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Introducing `AbstractVar` to abstract value access: store, load, and stack type. ([#584](https://github.com/algorand/pyteal/pull/584)) * NOTE: a backwards incompatable change was imposed in this PR: previous ABI value's public member `stored_value` with type `ScratchVar`, is now changed to protected member `_stored_value` with type `AbstractVar`. * Starting with program version 9, when `scratch_slots` flag isn't provided to `OptimizeOptions`, default to optimizing. For versions 8 and earlier the default is and remains to _not_ optimize. ([#613](https://github.com/algorand/pyteal/pull/613)) +* Replaced the usage of `typing.NamedTuple` with `dataclass` for `class OpType` in the **ir** package in order to avoid [a regression coming in Python 3.11.1](https://github.com/python/cpython/issues/100098) ([#615](https://github.com/algorand/pyteal/pull/615)). # 0.20.1