Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove temporary I252 ignore on pyteal.ast.abi #290

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ per-file-ignores =
pyteal/ir/ops.py: E221
tests/module_test.py: F401, F403
tests/*.py: I252
# Temporarily ignore until merge completes
pyteal/ast/abi/*.py: I252
# End temporarty ignore

# from flake8-tidy-imports
ban-relative-imports = true
Expand Down
22 changes: 11 additions & 11 deletions pyteal/ast/abi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from .string import String, StringTypeSpec
from .address import AddressTypeSpec, Address, ADDRESS_LENGTH
from .type import TypeSpec, BaseType, ComputedValue
from .bool import BoolTypeSpec, Bool
from .uint import (
from pyteal.ast.abi.string import String, StringTypeSpec
from pyteal.ast.abi.address import AddressTypeSpec, Address, ADDRESS_LENGTH
from pyteal.ast.abi.type import TypeSpec, BaseType, ComputedValue
from pyteal.ast.abi.bool import BoolTypeSpec, Bool
from pyteal.ast.abi.uint import (
UintTypeSpec,
Uint,
ByteTypeSpec,
Expand All @@ -16,7 +16,7 @@
Uint64TypeSpec,
Uint64,
)
from .tuple import (
from pyteal.ast.abi.tuple import (
TupleTypeSpec,
Tuple,
TupleElement,
Expand All @@ -27,11 +27,11 @@
Tuple4,
Tuple5,
)
from .array_base import ArrayTypeSpec, Array, ArrayElement
from .array_static import StaticArrayTypeSpec, StaticArray
from .array_dynamic import DynamicArrayTypeSpec, DynamicArray
from .util import type_spec_from_annotation
from .method_return import MethodReturn
from pyteal.ast.abi.array_base import ArrayTypeSpec, Array, ArrayElement
from pyteal.ast.abi.array_static import StaticArrayTypeSpec, StaticArray
from pyteal.ast.abi.array_dynamic import DynamicArrayTypeSpec, DynamicArray
from pyteal.ast.abi.util import type_spec_from_annotation
from pyteal.ast.abi.method_return import MethodReturn

__all__ = [
"String",
Expand Down
6 changes: 3 additions & 3 deletions pyteal/ast/abi/address.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from .array_static import StaticArray, StaticArrayTypeSpec
from .uint import ByteTypeSpec
from ..expr import Expr
from pyteal.ast.abi.array_static import StaticArray, StaticArrayTypeSpec
from pyteal.ast.abi.uint import ByteTypeSpec
from pyteal.ast.expr import Expr

ADDRESS_LENGTH = 32

Expand Down
30 changes: 15 additions & 15 deletions pyteal/ast/abi/array_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
)
from abc import abstractmethod

from ...types import TealType, require_type
from ...errors import TealInputError
from ..expr import Expr
from ..seq import Seq
from ..int import Int
from ..if_ import If
from ..unaryexpr import Len
from ..binaryexpr import ExtractUint16
from ..naryexpr import Concat

from .type import TypeSpec, BaseType, ComputedValue
from .tuple import encodeTuple
from .bool import Bool, BoolTypeSpec
from .uint import Uint16, Uint16TypeSpec
from .util import substringForDecoding
from pyteal.types import TealType, require_type
from pyteal.errors import TealInputError
from pyteal.ast.expr import Expr
from pyteal.ast.seq import Seq
from pyteal.ast.int import Int
from pyteal.ast.if_ import If
from pyteal.ast.unaryexpr import Len
from pyteal.ast.binaryexpr import ExtractUint16
from pyteal.ast.naryexpr import Concat

from pyteal.ast.abi.type import TypeSpec, BaseType, ComputedValue
from pyteal.ast.abi.tuple import encodeTuple
from pyteal.ast.abi.bool import Bool, BoolTypeSpec
from pyteal.ast.abi.uint import Uint16, Uint16TypeSpec
from pyteal.ast.abi.util import substringForDecoding

T = TypeVar("T", bound=BaseType)

Expand Down
12 changes: 6 additions & 6 deletions pyteal/ast/abi/array_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
)


from ...errors import TealInputError
from ..expr import Expr
from ..seq import Seq
from pyteal.errors import TealInputError
from pyteal.ast.expr import Expr
from pyteal.ast.seq import Seq

from .type import ComputedValue, TypeSpec, BaseType
from .uint import Uint16
from .array_base import ArrayTypeSpec, Array
from pyteal.ast.abi.type import ComputedValue, TypeSpec, BaseType
from pyteal.ast.abi.uint import Uint16
from pyteal.ast.abi.array_base import ArrayTypeSpec, Array


T = TypeVar("T", bound=BaseType)
Expand Down
8 changes: 4 additions & 4 deletions pyteal/ast/abi/array_dynamic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import pyteal as pt
from pyteal import abi
from .util import substringForDecoding
from .tuple import encodeTuple
from .array_base_test import STATIC_TYPES, DYNAMIC_TYPES
from .type_test import ContainerType
from pyteal.ast.abi.util import substringForDecoding
from pyteal.ast.abi.tuple import encodeTuple
from pyteal.ast.abi.array_base_test import STATIC_TYPES, DYNAMIC_TYPES
from pyteal.ast.abi.type_test import ContainerType

options = pt.CompileOptions(version=5)

Expand Down
12 changes: 6 additions & 6 deletions pyteal/ast/abi/array_static.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
cast,
)

from ...errors import TealInputError
from ..expr import Expr
from ..int import Int
from pyteal.errors import TealInputError
from pyteal.ast.expr import Expr
from pyteal.ast.int import Int

from .type import ComputedValue, TypeSpec, BaseType
from .bool import BoolTypeSpec, boolSequenceLength
from .array_base import ArrayTypeSpec, Array, ArrayElement
from pyteal.ast.abi.type import ComputedValue, TypeSpec, BaseType
from pyteal.ast.abi.bool import BoolTypeSpec, boolSequenceLength
from pyteal.ast.abi.array_base import ArrayTypeSpec, Array, ArrayElement


T = TypeVar("T", bound=BaseType)
Expand Down
10 changes: 5 additions & 5 deletions pyteal/ast/abi/array_static_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import pyteal as pt
from pyteal import abi
from .util import substringForDecoding
from .tuple import encodeTuple
from .bool import boolSequenceLength
from .type_test import ContainerType
from .array_base_test import STATIC_TYPES, DYNAMIC_TYPES
from pyteal.ast.abi.util import substringForDecoding
from pyteal.ast.abi.tuple import encodeTuple
from pyteal.ast.abi.bool import boolSequenceLength
from pyteal.ast.abi.type_test import ContainerType
from pyteal.ast.abi.array_base_test import STATIC_TYPES, DYNAMIC_TYPES

options = pt.CompileOptions(version=5)

Expand Down
22 changes: 11 additions & 11 deletions pyteal/ast/abi/bool.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from typing import TypeVar, Union, cast, Sequence, Callable

from ...types import TealType
from ...errors import TealInputError
from ..expr import Expr
from ..seq import Seq
from ..assert_ import Assert
from ..int import Int
from ..bytes import Bytes
from ..binaryexpr import GetBit
from ..ternaryexpr import SetBit
from .type import ComputedValue, TypeSpec, BaseType
from .uint import NUM_BITS_IN_BYTE
from pyteal.types import TealType
from pyteal.errors import TealInputError
from pyteal.ast.expr import Expr
from pyteal.ast.seq import Seq
from pyteal.ast.assert_ import Assert
from pyteal.ast.int import Int
from pyteal.ast.bytes import Bytes
from pyteal.ast.binaryexpr import GetBit
from pyteal.ast.ternaryexpr import SetBit
from pyteal.ast.abi.type import ComputedValue, TypeSpec, BaseType
from pyteal.ast.abi.uint import NUM_BITS_IN_BYTE


class BoolTypeSpec(TypeSpec):
Expand Down
4 changes: 2 additions & 2 deletions pyteal/ast/abi/bool_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pyteal as pt
from pyteal import abi
from .type_test import ContainerType
from .bool import (
from pyteal.ast.abi.type_test import ContainerType
from pyteal.ast.abi.bool import (
boolAwareStaticByteLength,
consecutiveBoolInstanceNum,
consecutiveBoolTypeSpecNum,
Expand Down
14 changes: 7 additions & 7 deletions pyteal/ast/abi/method_return.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
from typing import TYPE_CHECKING, Tuple
from . import BaseType
from ...types import TealType
from ...errors import TealInputError
from .. import Expr, Log, Concat, Bytes
from ...ir import TealBlock, TealSimpleBlock, Op
from ...config import RETURN_METHOD_SELECTOR
from pyteal.ast.abi import BaseType
from pyteal.types import TealType
from pyteal.errors import TealInputError
from pyteal.ast import Expr, Log, Concat, Bytes
from pyteal.ir import TealBlock, TealSimpleBlock, Op
from pyteal.config import RETURN_METHOD_SELECTOR

if TYPE_CHECKING:
from ...compiler import CompileOptions
from pyteal.compiler import CompileOptions


class MethodReturn(Expr):
Expand Down
10 changes: 5 additions & 5 deletions pyteal/ast/abi/string.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from .array_dynamic import DynamicArray, DynamicArrayTypeSpec
from .uint import ByteTypeSpec, Uint16TypeSpec
from .util import substringForDecoding
from pyteal.ast.abi.array_dynamic import DynamicArray, DynamicArrayTypeSpec
from pyteal.ast.abi.uint import ByteTypeSpec, Uint16TypeSpec
from pyteal.ast.abi.util import substringForDecoding

from ..int import Int
from ..expr import Expr
from pyteal.ast.int import Int
from pyteal.ast.expr import Expr


class StringTypeSpec(DynamicArrayTypeSpec):
Expand Down
30 changes: 15 additions & 15 deletions pyteal/ast/abi/tuple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
overload,
)

from ...types import TealType
from ...errors import TealInputError
from ..expr import Expr
from ..seq import Seq
from ..int import Int
from ..bytes import Bytes
from ..unaryexpr import Len
from ..binaryexpr import ExtractUint16
from ..naryexpr import Concat
from ..scratchvar import ScratchVar

from .type import TypeSpec, BaseType, ComputedValue
from .bool import (
from pyteal.types import TealType
from pyteal.errors import TealInputError
from pyteal.ast.expr import Expr
from pyteal.ast.seq import Seq
from pyteal.ast.int import Int
from pyteal.ast.bytes import Bytes
from pyteal.ast.unaryexpr import Len
from pyteal.ast.binaryexpr import ExtractUint16
from pyteal.ast.naryexpr import Concat
from pyteal.ast.scratchvar import ScratchVar

from pyteal.ast.abi.type import TypeSpec, BaseType, ComputedValue
from pyteal.ast.abi.bool import (
Bool,
BoolTypeSpec,
consecutiveBoolInstanceNum,
Expand All @@ -29,8 +29,8 @@
encodeBoolSequence,
boolAwareStaticByteLength,
)
from .uint import NUM_BITS_IN_BYTE, Uint16
from .util import substringForDecoding
from pyteal.ast.abi.uint import NUM_BITS_IN_BYTE, Uint16
from pyteal.ast.abi.util import substringForDecoding


def encodeTuple(values: Sequence[BaseType]) -> Expr:
Expand Down
8 changes: 4 additions & 4 deletions pyteal/ast/abi/tuple_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import pyteal as pt
from pyteal import abi
from .tuple import encodeTuple, indexTuple, TupleElement
from .bool import encodeBoolSequence
from .util import substringForDecoding
from .type_test import ContainerType
from pyteal.ast.abi.tuple import encodeTuple, indexTuple, TupleElement
from pyteal.ast.abi.bool import encodeBoolSequence
from pyteal.ast.abi.util import substringForDecoding
from pyteal.ast.abi.type_test import ContainerType

options = pt.CompileOptions(version=5)

Expand Down
10 changes: 5 additions & 5 deletions pyteal/ast/abi/type.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import TypeVar, Generic, Callable, Final, cast
from abc import ABC, abstractmethod

from ...errors import TealInputError
from ...types import TealType
from ..expr import Expr
from ..scratchvar import ScratchVar
from ..seq import Seq
from pyteal.errors import TealInputError
from pyteal.types import TealType
from pyteal.ast.expr import Expr
from pyteal.ast.scratchvar import ScratchVar
from pyteal.ast.seq import Seq


class TypeSpec(ABC):
Expand Down
26 changes: 13 additions & 13 deletions pyteal/ast/abi/uint.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
)
from abc import abstractmethod

from ...types import TealType
from ...errors import TealInputError
from ..scratchvar import ScratchVar
from ..expr import Expr
from ..seq import Seq
from ..assert_ import Assert
from ..substring import Suffix
from ..int import Int
from ..bytes import Bytes
from ..unaryexpr import Itob, Btoi
from ..binaryexpr import GetByte, ExtractUint16, ExtractUint32, ExtractUint64
from ..ternaryexpr import SetByte
from .type import ComputedValue, TypeSpec, BaseType
from pyteal.types import TealType
from pyteal.errors import TealInputError
from pyteal.ast.scratchvar import ScratchVar
from pyteal.ast.expr import Expr
from pyteal.ast.seq import Seq
from pyteal.ast.assert_ import Assert
from pyteal.ast.substring import Suffix
from pyteal.ast.int import Int
from pyteal.ast.bytes import Bytes
from pyteal.ast.unaryexpr import Itob, Btoi
from pyteal.ast.binaryexpr import GetByte, ExtractUint16, ExtractUint32, ExtractUint64
from pyteal.ast.ternaryexpr import SetByte
from pyteal.ast.abi.type import ComputedValue, TypeSpec, BaseType

NUM_BITS_IN_BYTE = 8

Expand Down
2 changes: 1 addition & 1 deletion pyteal/ast/abi/uint_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import List, Tuple, NamedTuple, Callable, Union, Optional
from .type_test import ContainerType
from pyteal.ast.abi.type_test import ContainerType
import pyteal as pt
from pyteal import abi

Expand Down
Loading