#pytest can't find ImmutableArray and Array in algopy

2 messages · Page 1 of 1 (latest)

sullen herald
#

poetry run python -c "import algopy; print('=== algopy module contents ==='); print(dir(algopy)); print('\n=== algopy.arc4 module contents ==='); from algopy import arc4; print(dir(arc4))"

=== algopy module contents ===
['ARC4Contract', 'Account', 'Application', 'Asset', 'BigUInt', 'Box', 'BoxMap', 'BoxRef', 'Bytes', 'BytesBacked', 'CompiledContract', 'CompiledLogicSig', 'Contract', 'Global', 'GlobalState', 'LocalState', 'LogicSig', 'OnCompleteAction', 'OpUpFeeSource', 'StateTotals', 'String', 'TemplateVar', 'TransactionType', 'Txn', 'UInt64', 'all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'path', 'spec', 'arc4', 'compile_contract', 'compile_logicsig', 'ensure_budget', 'gtxn', 'itxn', 'log', 'logicsig', 'op', 'subroutine', 'uenumerate', 'urange']

=== algopy.arc4 module contents ===
['ARC4Client', 'Address', 'BigUFixedNxM', 'BigUIntN', 'Bool', 'Byte', 'DynamicArray', 'DynamicBytes', 'StaticArray', 'String', 'Struct', 'Tuple', 'UFixedNxM', 'UInt128', 'UInt16', 'UInt256', 'UInt32', 'UInt512', 'UInt64', 'UInt8', 'UIntN', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'spec', 'abi_call', 'abimethod', 'arc4_create', 'arc4_signature', 'arc4_update', 'baremethod', 'emit']

#

This is really weird - aboe is the output of all modules in my algopy and arc4. ImmutableArray and Array are not in there.

importing ImmutableArray and Array, contract compiles fine, but when I run pytest I get
ImportError: cannot import name 'ImmutableArray' from 'algopy' (C:\projects\p1\ .venv\Lib\site-packages\algopy__init__.py)

Dozens of unit tests with other classes worked just fine. But it won't import the arrays