diff --git a/HISTORY.md b/HISTORY.md index 60b04dfba5..6719808519 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,26 @@ # Release History - open AEA +## 1.27.0 (2022-12-27) + +AEA: +- Adds auto-generated protobuf `*_pb2.py` and `*_pb2_*.py` files to `coveragerc` ignore template for aea test command. +- Fixes comparison operators ` __eq__`, `__ne__`, `__lt__`, `__le__`, `__gt__`, `__ge__` for multiple classes including `PackageVersion`. +- Adds support to `test packages` command for the `--all` flag and switches default behaviour to only run tests on `dev` packages. +- Fixes miscellaneous issues on base test classes and adds consistency checks via meta classes. + +Plugins: +- Updates `open-aea-cli-ipfs` to retry in case an IPFS download fails + +Tests: +- Fills coverage gaps on core `aea` +- Fills coverage gaps on multiple packages +- Fills coverage gaps on all plugins + +Chores: +- Merges the coverage checks with unit tests and removes the extra test coverage CI run. +- Cleans up release flow. +- Adds workflow for image building. + ## 1.26.0 (2022-12-15) AEA: diff --git a/Makefile b/Makefile index c43f9e629c..a00d4b4198 100644 --- a/Makefile +++ b/Makefile @@ -69,11 +69,6 @@ test-sub-p: pytest -rfE --doctest-modules aea packages/valory/connections packages/valory/protocols packages/fetchai/connections packages/fetchai/protocols packages/fetchai/skills tests/test_packages/test_$(tdir) --cov=packages.fetchai.$(dir) --cov-report=html --cov-report=xml --cov-report=term-missing --cov-report=term --cov-config=.coveragerc find . -name ".coverage*" -not -name ".coveragerc" -exec rm -fr "{}" \; -.PHONY: hashes -hashes: - python -m aea.cli packages lock - python -m aea.cli --registry-path=./tests/data/packages packages lock - .PHONY: test-all test-all: tox @@ -167,7 +162,6 @@ security: generators: rm -rf packages/fetchai/connections/stub/input_file tox -e fix-copyright - tox -e hash-all tox -e lock-packages tox -e generate-all-protocols tox -e generate-api-documentation diff --git a/SECURITY.md b/SECURITY.md index a9c9ca915a..01d5b50183 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,8 +8,8 @@ The following table shows which versions of `open-aea` are currently being suppo | Version | Supported | | --------- | ------------------ | -| `1.26.x` | :white_check_mark: | -| `< 1.26.0` | :x: | +| `1.27.x` | :white_check_mark: | +| `< 1.27.0` | :x: | ## Reporting a Vulnerability diff --git a/aea/__version__.py b/aea/__version__.py index f6c2337ef5..ab662479c9 100644 --- a/aea/__version__.py +++ b/aea/__version__.py @@ -23,7 +23,7 @@ __title__ = "open-aea" __description__ = "Open Autonomous Economic Agent framework (without vendor lock-in)" __url__ = "https://github.com/valory-xyz/open-aea.git" -__version__ = "1.26.0" +__version__ = "1.27.0" __author__ = "Valory AG" __license__ = "Apache-2.0" __copyright__ = "2021 Valory AG, 2019 Fetch.AI Limited" diff --git a/aea/test_tools/click_testing.py b/aea/test_tools/click_testing.py index 4c6e921355..4301821746 100644 --- a/aea/test_tools/click_testing.py +++ b/aea/test_tools/click_testing.py @@ -41,6 +41,7 @@ import subprocess # nosec import sys import tempfile +from abc import ABC from contextlib import nullcontext, redirect_stderr from pathlib import Path from typing import Any, ContextManager, Optional, Sequence, cast @@ -147,12 +148,12 @@ def invoke( # type: ignore ) -class CliTest: +class CliTest(ABC): """Test cli commands.""" - t: Path cli_options: Sequence[str] = () + _t: Path __cwd: Path __cli: click.core.Group = aea_cli __cli_runner: CliRunner @@ -163,6 +164,11 @@ def set_capfd_on_cli_runner(self, capfd: CaptureFixture) -> None: self.__cli_runner.capfd = capfd + @property + def t(self) -> Path: + """Get t.""" + return self._t + @classmethod def setup_class(cls, mix_stderr: bool = True) -> None: """Setup test class.""" @@ -179,12 +185,12 @@ def teardown_class(cls) -> None: def setup(self) -> None: """Setup test.""" - self.t = Path(tempfile.mkdtemp()).resolve() + self._t = Path(tempfile.mkdtemp()).resolve() def teardown(self) -> None: """Teardown test.""" - remove_test_directory(self.t) + remove_test_directory(self._t) def run_cli( self, diff --git a/aea/test_tools/test_contract.py b/aea/test_tools/test_contract.py index 4e06290afa..8c434e8ca0 100644 --- a/aea/test_tools/test_contract.py +++ b/aea/test_tools/test_contract.py @@ -20,9 +20,9 @@ """This module contains test case classes based on pytest for AEA contract testing.""" import time -from abc import ABC, abstractmethod +from abc import ABC, ABCMeta, abstractmethod from pathlib import Path -from typing import Any, Dict, List, Optional, cast +from typing import Any, Dict, List, Optional, Tuple, Type, cast from aea.common import JSONLike from aea.configurations.loader import ( @@ -39,11 +39,52 @@ ) -class BaseContractTestCase(ABC): +class _MetaBaseContractTestCase(ABCMeta): + """A metaclass that validates BaseContractTestCase's class.""" + + def __new__( # type: ignore # pylint: disable=bad-mcs-classmethod-argument # type: ignore + mcs, name: str, bases: Tuple, namespace: Dict, **kwargs: Any + ) -> Type: + """Initialize the class.""" + new_cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + if ABC in bases: + # abstract class, return + return new_cls + if not issubclass(new_cls, BaseContractTestCase): + # the check only applies to BaseContractTestCase subclasses + return new_cls + + mcs._check_consistency(cast(Type[BaseContractTestCase], new_cls)) + return new_cls + + @classmethod + def _check_consistency( # pylint: disable=bad-mcs-classmethod-argument + mcs, base_contract_test_case_cls: Type["BaseContractTestCase"] + ) -> None: + """Check consistency of class.""" + mcs._check_required_class_attributes(base_contract_test_case_cls) + + @classmethod + def _check_required_class_attributes( # pylint: disable=bad-mcs-classmethod-argument + mcs, base_contract_test_case_cls: Type["BaseContractTestCase"] + ) -> None: + """Check that required class attributes are set.""" + if not hasattr(base_contract_test_case_cls, "path_to_contract"): + raise ValueError( + f"'path_to_contract' not set on {base_contract_test_case_cls}" + ) + if not hasattr(base_contract_test_case_cls, "ledger_identifier"): + raise ValueError( + f"'ledger_identifier' not set on {base_contract_test_case_cls}" + ) + + +class BaseContractTestCase(ABC, metaclass=_MetaBaseContractTestCase): """A class to test a contract.""" - path_to_contract: Path = Path(".") - ledger_identifier: str = "" + path_to_contract: Path + ledger_identifier: str fund_from_faucet: bool = False _deployment_gas: int = 5000000 _contract: Contract @@ -65,12 +106,25 @@ def contract(self) -> Contract: raise ValueError("Ensure the contract is set during setup.") return value + @classmethod + def setup_class(cls) -> None: + """Set up the contract test case class.""" + # register contract + configuration = cast( + ContractConfig, + load_component_configuration(ComponentType.CONTRACT, cls.path_to_contract), + ) + configuration._directory = ( # pylint: disable=protected-access + cls.path_to_contract + ) + if str(configuration.public_id) not in contract_registry.specs: + # load contract into sys modules + Contract.from_config(configuration) # pragma: nocover + cls._contract = contract_registry.make(str(configuration.public_id)) + @classmethod def setup(cls, **kwargs: Any) -> None: """Set up the contract test case.""" - if cls.ledger_identifier == "": - raise ValueError("ledger_identifier not set!") # pragma: nocover - _ledger_config: Dict[str, str] = kwargs.pop("ledger_config", {}) _deployer_private_key_path: Optional[str] = kwargs.pop( "deployer_private_key_path", None @@ -78,7 +132,6 @@ def setup(cls, **kwargs: Any) -> None: _item_owner_private_key_path: Optional[str] = kwargs.pop( "item_owner_private_key_path", None ) - cls.ledger_api = ledger_apis_registry.make( cls.ledger_identifier, **_ledger_config ) @@ -102,19 +155,6 @@ def setup(cls, **kwargs: Any) -> None: cls.ledger_api, cls.faucet_api, cls.item_owner_crypto.address ) - # register contract - configuration = cast( - ContractConfig, - load_component_configuration(ComponentType.CONTRACT, cls.path_to_contract), - ) - configuration._directory = ( # pylint: disable=protected-access - cls.path_to_contract - ) - if str(configuration.public_id) not in contract_registry.specs: - # load contract into sys modules - Contract.from_config(configuration) # pragma: nocover - cls._contract = contract_registry.make(str(configuration.public_id)) - # deploy contract cls.deployment_tx_receipt = cls._deploy_contract( cls._contract, cls.ledger_api, cls.deployer_crypto, gas=cls._deployment_gas diff --git a/aea/test_tools/test_skill.py b/aea/test_tools/test_skill.py index 7b9bc9df33..5c03640f5f 100644 --- a/aea/test_tools/test_skill.py +++ b/aea/test_tools/test_skill.py @@ -20,6 +20,7 @@ """This module contains test case classes based on pytest for AEA skill testing.""" import asyncio import os +from abc import ABC, ABCMeta from pathlib import Path from queue import Queue from types import SimpleNamespace @@ -43,10 +44,45 @@ COUNTERPARTY_SKILL_ADDRESS = "some_author/some_skill:0.1.0" -class BaseSkillTestCase: +class _MetaBaseSkillTestCase(ABCMeta): + """A metaclass that validates BaseSkillTestCase's class.""" + + def __new__( # type: ignore # pylint: disable=bad-mcs-classmethod-argument + mcs, name: str, bases: Tuple, namespace: Dict, **kwargs: Any + ) -> Type: + """Initialize the class.""" + new_cls = super().__new__(mcs, name, bases, namespace, **kwargs) + + if ABC in bases: + # abstract class, return + return new_cls + if not issubclass(new_cls, BaseSkillTestCase): + # the check only applies to BaseSkillTestCase subclasses + return new_cls + + mcs._check_consistency(cast(Type[BaseSkillTestCase], new_cls)) + return new_cls + + @classmethod + def _check_consistency( # pylint: disable=bad-mcs-classmethod-argument + mcs, base_skill_test_case_cls: Type["BaseSkillTestCase"] + ) -> None: + """Check consistency of class.""" + mcs._check_required_class_attributes(base_skill_test_case_cls) + + @classmethod + def _check_required_class_attributes( # pylint: disable=bad-mcs-classmethod-argument + mcs, base_skill_test_case_cls: Type["BaseSkillTestCase"] + ) -> None: + """Check that required class attributes are set.""" + if not hasattr(base_skill_test_case_cls, "path_to_skill"): + raise ValueError(f"'path_to_skill' not set on {base_skill_test_case_cls}") + + +class BaseSkillTestCase(ABC, metaclass=_MetaBaseSkillTestCase): """A class to test a skill.""" - path_to_skill: Path = Path(".") + path_to_skill: Path is_agent_to_agent_messages: bool = True _skill: Skill _multiplexer: AsyncMultiplexer diff --git a/deploy-image/Dockerfile b/deploy-image/Dockerfile index cf1eba7f5f..32fe0a38ae 100644 --- a/deploy-image/Dockerfile +++ b/deploy-image/Dockerfile @@ -16,7 +16,7 @@ RUN apk add --no-cache go # aea installation RUN pip install --upgrade pip -RUN pip install --upgrade --force-reinstall open-aea[all]==1.26.0 "open-aea-cli-ipfs<2.0.0,>=1.26.0" +RUN pip install --upgrade --force-reinstall open-aea[all]==1.27.0 "open-aea-cli-ipfs<2.0.0,>=1.27.0" # directories and aea cli config WORKDIR /home/agents diff --git a/deploy-image/README.md b/deploy-image/README.md index 2aad0e5b87..34d32ae9db 100644 --- a/deploy-image/README.md +++ b/deploy-image/README.md @@ -11,7 +11,7 @@ The example uses the `fetchai/my_first_aea` project. You will likely want to mod Install subversion, then download the example directory to your local working directory ``` bash -svn checkout https://github.com/valory-xyz/open-aea/tags/v1.26.0/packages packages +svn checkout https://github.com/valory-xyz/open-aea/tags/v1.27.0/packages packages ``` ### Modify scripts diff --git a/develop-image/docker-env.sh b/develop-image/docker-env.sh index d2dc8174e1..2c2f284f27 100755 --- a/develop-image/docker-env.sh +++ b/develop-image/docker-env.sh @@ -1,7 +1,7 @@ #!/bin/bash # Swap the following lines if you want to work with 'latest' -DOCKER_IMAGE_TAG=valory/open-aea-develop:1.26.0 +DOCKER_IMAGE_TAG=valory/open-aea-develop:1.27.0 # DOCKER_IMAGE_TAG=valory/open-aea-develop:latest DOCKER_BUILD_CONTEXT_DIR=.. diff --git a/docs/api/configurations/data_types.md b/docs/api/configurations/data_types.md index 95cfb13851..ccee1112fa 100644 --- a/docs/api/configurations/data_types.md +++ b/docs/api/configurations/data_types.md @@ -62,6 +62,17 @@ Initialize a package version. - `version_like`: a string, os a semver.VersionInfo object. + + +#### is`_`any + +```python +@property +def is_any() -> bool +``` + +Check whether the version is 'any'. + #### is`_`latest diff --git a/docs/api/package_manager/v1.md b/docs/api/package_manager/v1.md index 8912e556eb..7d3bcd9f49 100644 --- a/docs/api/package_manager/v1.md +++ b/docs/api/package_manager/v1.md @@ -46,6 +46,17 @@ def third_party_packages() -> PackageIdToHashMapping Returns mappings of package ids -> package hash + + +#### all`_`packages + +```python +@property +def all_packages() -> PackageIdToHashMapping +``` + +Return all packages. + #### get`_`package`_`hash diff --git a/docs/api/plugins/aea_ledger_fetchai/test_tools/fixture_helpers.md b/docs/api/plugins/aea_ledger_fetchai/test_tools/fixture_helpers.md new file mode 100644 index 0000000000..a98082a864 --- /dev/null +++ b/docs/api/plugins/aea_ledger_fetchai/test_tools/fixture_helpers.md @@ -0,0 +1,17 @@ + + +# plugins.aea-ledger-fetchai.aea`_`ledger`_`fetchai.test`_`tools.fixture`_`helpers + +Fixture helpers + + + +#### fetchd + +```python +@pytest.fixture(scope="class") +def fetchd(fetchd_configuration=FETCHD_CONFIGURATION, timeout: float = 2.0, max_attempts: int = 20) +``` + +Launch the Fetch ledger image. + diff --git a/docs/api/test_tools/test_contract.md b/docs/api/test_tools/test_contract.md index 3d2a3bf811..ba6f5f795b 100644 --- a/docs/api/test_tools/test_contract.md +++ b/docs/api/test_tools/test_contract.md @@ -4,12 +4,32 @@ This module contains test case classes based on pytest for AEA contract testing. + + +## `_`MetaBaseContractTestCase Objects + +```python +class _MetaBaseContractTestCase(ABCMeta) +``` + +A metaclass that validates BaseContractTestCase's class. + + + +#### `__`new`__` + +```python +def __new__(mcs, name: str, bases: Tuple, namespace: Dict, **kwargs: Any) -> Type +``` + +Initialize the class. + ## BaseContractTestCase Objects ```python -class BaseContractTestCase(ABC) +class BaseContractTestCase(ABC, metaclass=_MetaBaseContractTestCase) ``` A class to test a contract. @@ -25,6 +45,17 @@ def contract() -> Contract Get the contract. + + +#### setup`_`class + +```python +@classmethod +def setup_class(cls) -> None +``` + +Set up the contract test case class. + #### setup diff --git a/docs/api/test_tools/test_skill.md b/docs/api/test_tools/test_skill.md index 9710f9627a..38faf4bb52 100644 --- a/docs/api/test_tools/test_skill.md +++ b/docs/api/test_tools/test_skill.md @@ -4,12 +4,32 @@ This module contains test case classes based on pytest for AEA skill testing. + + +## `_`MetaBaseSkillTestCase Objects + +```python +class _MetaBaseSkillTestCase(ABCMeta) +``` + +A metaclass that validates BaseSkillTestCase's class. + + + +#### `__`new`__` + +```python +def __new__(mcs, name: str, bases: Tuple, namespace: Dict, **kwargs: Any) -> Type +``` + +Initialize the class. + ## BaseSkillTestCase Objects ```python -class BaseSkillTestCase() +class BaseSkillTestCase(ABC, metaclass=_MetaBaseSkillTestCase) ``` A class to test a skill. diff --git a/docs/p2p-connection.md b/docs/p2p-connection.md index a160e06c71..32e9919c05 100644 --- a/docs/p2p-connection.md +++ b/docs/p2p-connection.md @@ -26,7 +26,7 @@ Create one AEA as follows: ``` bash aea create my_genesis_aea cd my_genesis_aea -aea add connection valory/p2p_libp2p:0.1.0:bafybeihjlcop2vvpqfjqcwc4lqgbvktxgc3frhtsbusjypcmefrape2h3u --remote +aea add connection valory/p2p_libp2p:0.1.0:bafybeigfp2fjiqqcy5xess6kffcqp7eb2qmn2p6ihb6kgpul2ygcawtx2i --remote aea config set agent.default_connection valory/p2p_libp2p:0.1.0 aea install aea build @@ -58,7 +58,7 @@ Create a second AEA: ``` bash aea create my_other_aea cd my_other_aea -aea add connection valory/p2p_libp2p:0.1.0:bafybeihjlcop2vvpqfjqcwc4lqgbvktxgc3frhtsbusjypcmefrape2h3u --remote +aea add connection valory/p2p_libp2p:0.1.0:bafybeigfp2fjiqqcy5xess6kffcqp7eb2qmn2p6ihb6kgpul2ygcawtx2i --remote aea config set agent.default_connection valory/p2p_libp2p:0.1.0 aea install aea build diff --git a/docs/package_list.md b/docs/package_list.md index 38301bfe4c..6579d02f24 100644 --- a/docs/package_list.md +++ b/docs/package_list.md @@ -9,11 +9,11 @@ | protocol/valory/ledger_api/1.0.0 | `bafybeih7rhi5zvfvwakx5ifgxsz2cfipeecsh7bm3gnudjxtvhrygpcftq` | | connection/fetchai/http_server/0.22.0 | `bafybeidxb5gk3samqoflbztqnlnqtvtph5emobaojx3w47674ay5d7pmeu` | | connection/fetchai/stub/0.21.0 | `bafybeieqlozydyvdxmjxhqygwq27djecpiftoqwlcpcr4qpotomwnh66yy` | -| connection/valory/ledger/0.19.0 | `bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum` | -| connection/valory/p2p_libp2p/0.1.0 | `bafybeihjlcop2vvpqfjqcwc4lqgbvktxgc3frhtsbusjypcmefrape2h3u` | +| connection/valory/ledger/0.19.0 | `bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom` | +| connection/valory/p2p_libp2p/0.1.0 | `bafybeigfp2fjiqqcy5xess6kffcqp7eb2qmn2p6ihb6kgpul2ygcawtx2i` | | connection/valory/p2p_libp2p_client/0.1.0 | `bafybeidkk33xbga54szmitk6uwsi3ef56hbbdbuasltqtiyki34hgfpnxa` | | connection/valory/p2p_libp2p_mailbox/0.1.0 | `bafybeihjjsenbsgh6x2vukea7mqzsbcbqqbog6xa43raen24ewqf4qq3pm` | -| contract/fetchai/erc1155/0.22.0 | `bafybeid4i7dwsulgnwaylzk6xcozewkgacymxhwk2ip5omvccluq2pm7ii` | +| contract/fetchai/erc1155/0.22.0 | `bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe` | | protocol/fetchai/fipa/1.0.0 | `bafybeih27chr3b3anjeq26yd5c2p3hypp4sijzdu6yrorpwwxnvkeoa2ei` | | protocol/fetchai/oef_search/1.0.0 | `bafybeifiec4jvsa6mcbmasjno3bwvjwwwubyp25hjqwe7gjfksgvwgdisq` | | protocol/fetchai/state_update/1.0.0 | `bafybeidtndlmppst6l6iughpflqbbbkzditixo2fy2dncxfkb5apkx5y4m` | @@ -30,12 +30,12 @@ | agent/open_aea/my_first_aea/0.1.0 | `bafybeifelwg4md24lwpxgx7x5cugq7ovhbkew3lxw43m52rdppfn5o5g4i` | | connection/fetchai/local/0.20.0 | `bafybeianwid4lh3ubjheg4ho7qznuib2t6k35rcuconcbwtzmih4qdxo2i` | | connection/valory/http_client/0.23.0 | `bafybeihz3tubwado7j3wlivndzzuj3c6fdsp4ra5r3nqixn3ufawzo3wii` | -| connection/valory/test_libp2p/0.1.0 | `bafybeigbkr22vy4bxfl3hohjzwxj76wn5y77ssrsdeqqiu3a7yrpkqpfle` | +| connection/valory/test_libp2p/0.1.0 | `bafybeibqoz7zp7vrlhw4glnwz4gby7ruugeib6whe6h4xrzjta5u2sbbi4` | | protocol/fetchai/tac/1.0.0 | `bafybeiaew226n32rwp3h57zl4b2mmbrhjbyrdjbl2evnxf2tmmi4vrls7a` | -| skill/fetchai/erc1155_client/0.28.0 | `bafybeiecwwk7nesipstq7acvrkjv2byze27t2n6jlnxwggl3ppcbybuoum` | -| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeihmtiouapqz35is2hx6x5k6nrdnnjtz3uoywe34oyrxqg7na6u4wu` | +| skill/fetchai/erc1155_client/0.28.0 | `bafybeidlrgyn4eonxl2sglzu36lmpo7say2pw7usvrfisbhjt2jtv7ht4e` | +| skill/fetchai/erc1155_deploy/0.30.0 | `bafybeiexcya6etb5tn4nkcpvxuhvqextwbfvcznansn7dccfnqgff6kioq` | | skill/fetchai/error/0.17.0 | `bafybeib7nhokw3bc46oxuk5mjazan42evipowmka2ikfcs6drcdz4mwkjm` | | skill/fetchai/fipa_dummy_buyer/0.2.0 | `bafybeiha4jultg5srhr2ijplvubeo7esv4raq2cjlggmyzcaimop2ggg2m` | -| skill/fetchai/generic_buyer/0.26.0 | `bafybeial7pz6vebq6mq7v2aiagmqirto3jffurfsysjmd2ujhheqwwogoa` | -| skill/fetchai/generic_seller/0.27.0 | `bafybeiefbhuiax2bqgmrztugtii36ob2hw7tsreoyqnsrqxsqz36bdfjfy` | +| skill/fetchai/generic_buyer/0.26.0 | `bafybeiht376to56oeutzpxoyoijv4i76sydyiou3ydwfmzta4l4kljotmm` | +| skill/fetchai/generic_seller/0.27.0 | `bafybeif5y3nv2gdj72uzzlqt2ntdhnjeq433srxxq6p3q2gu4wcddnbh7i` | | skill/fetchai/task_test_skill/0.1.0 | `bafybeidv77u2xl52mnxakwvh7fuh46aiwfpteyof4eaptfd4agoi6cdble` | diff --git a/docs/upgrading.md b/docs/upgrading.md index d9836c97be..aa21141ebb 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -9,6 +9,16 @@ Below we describe the additional manual steps required to upgrade between differ ### Upgrade guide +## `v1.26.0` to `v1.27.0` + +Multiple small backwards incompatible changes: +- `BaseContractTestCase` no longer sets a default `path_to_contract` and `ledger_identifier`. The user is expected to set these and an exception is thrown if classes are defined without these. +- `BaseContractTestCase` had wrongly defined `setup`. This is now changed to `setup_class`. +- `BaseSkillTestCase` no longer sets a default `path_to_skill`. The user is expected to set this and an exception is thrown if classes are defined without this. +- Comparison operators were fixed for multiple custom classes. Some edge cases will behave differently. Consult #428 and related PRs. + +Plugins from previous versions are not compatible anymore. + ## `v1.25.0` to `v1.26.0` No backwards incompatible changes. diff --git a/examples/tac_deploy/Dockerfile b/examples/tac_deploy/Dockerfile index ae62f45c6e..5cf14b2cc1 100644 --- a/examples/tac_deploy/Dockerfile +++ b/examples/tac_deploy/Dockerfile @@ -19,7 +19,7 @@ RUN apk add --no-cache go # aea installation RUN python -m pip install --upgrade pip -RUN pip install --upgrade --force-reinstall aea[all]==1.26.0 +RUN pip install --upgrade --force-reinstall aea[all]==1.27.0 # directories and aea cli config COPY /.aea /home/.aea diff --git a/mkdocs.yml b/mkdocs.yml index 997fbace31..486de85dc7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -208,6 +208,7 @@ nav: - Dialogues: 'api/protocols/signing/dialogues.md' - Message: 'api/protocols/signing/message.md' - Serialization: 'api/protocols/signing/serialization.md' + - Test: 'api/protocols/signing/tests/test_signing.md' - Registries: - Base: 'api/registries/base.md' - Filter: 'api/registries/filter.md' @@ -234,6 +235,7 @@ nav: - Exceptions: 'api/plugins/aea_cli_ipfs/exceptions.md' - Registry: 'api/plugins/aea_cli_ipfs/registry.md' - Utils: 'api/plugins/aea_cli_ipfs/ipfs_utils.md' + - Test Tools: 'api/plugins/aea_cli_ipfs/test_tools/fixture_helpers.md' - Benchmark: - Core: api/plugins/aea_cli_benchmark/core.md - Utils: api/plugins/aea_cli_benchmark/utils.md @@ -283,6 +285,7 @@ nav: - Ledger: - Cosmos: - API: 'api/plugins/aea_ledger_cosmos/cosmos.md' + - HashFuncs: 'api/plugins/aea_ledger_cosmos/hashfuncs.md' - Ethereum: - API: 'api/plugins/aea_ledger_ethereum/ethereum.md' - Constants: api/plugins/aea_ledger_ethereum/test_tools/constants.md @@ -292,6 +295,7 @@ nav: - API: 'api/plugins/aea_ledger_fetchai/fetchai.md' - Constants: api/plugins/aea_ledger_fetchai/test_tools/constants.md - Docker Images: api/plugins/aea_ledger_fetchai/test_tools/docker_images.md + - HashFuncs: 'api/plugins/aea_ledger_fetchai/hashfuncs.md' - Helper: 'api/plugins/aea_ledger_fetchai/_cosmos.md' - Registries: - IPFS: ipfs_registry.md diff --git a/packages/fetchai/contracts/erc1155/contract.yaml b/packages/fetchai/contracts/erc1155/contract.yaml index cdba3a5fe5..c97d504058 100644 --- a/packages/fetchai/contracts/erc1155/contract.yaml +++ b/packages/fetchai/contracts/erc1155/contract.yaml @@ -17,7 +17,7 @@ fingerprint: migrations/1_initial_migration.js: bafybeigzg7dadlq7sepncquzoo5hgs7q2pwvbhzilolgkjkr3jacb2owvy migrations/2_deploy_contracts.js: bafybeihnzburnurq4gvp4rj36b57uzrlgif5y73ggyu3rfc3iot4e5zppy tests/__init__.py: bafybeig4dvxi35qewu667l3hktdygp33p5r6hzsz4abqzkgggptl3d4vje - tests/test_contract.py: bafybeifpwwwzr6tomoubi7f5dvfzbwdnn4jught26uda2i4mexqkpqplwm + tests/test_contract.py: bafybeiearu7rv4qug5zdoajgsillqxt2j67olpenjq5sk6ryqlupvyxr3i fingerprint_ignore_patterns: [] class_name: ERC1155Contract contract_interface_paths: diff --git a/packages/fetchai/contracts/erc1155/tests/test_contract.py b/packages/fetchai/contracts/erc1155/tests/test_contract.py index 30f7fffc7c..fc453a499c 100644 --- a/packages/fetchai/contracts/erc1155/tests/test_contract.py +++ b/packages/fetchai/contracts/erc1155/tests/test_contract.py @@ -656,10 +656,10 @@ class TestCosmWasmContract(BaseContractTestCase): fund_from_faucet = True @classmethod - def setup(cls) -> None: + def setup_class(cls) -> None: """Setup.""" # Test tokens IDs - super().setup(ledger_config=FETCHAI_TESTNET_CONFIG) + super().setup_class(ledger_config=FETCHAI_TESTNET_CONFIG) cls.token_ids_a = [ 340282366920938463463374607431768211456, 340282366920938463463374607431768211457, @@ -1020,8 +1020,8 @@ class TestContractCommon: """Other tests for the contract.""" @classmethod - def setup(cls) -> None: - """Setup.""" + def setup_class(cls) -> None: + """Setup class.""" # Register smart contract used for testing cls.path_to_contract = PACKAGE_DIR @@ -1039,14 +1039,16 @@ def setup(cls) -> None: Contract.from_config(configuration) cls.contract = contract_registry.make(str(configuration.public_id)) - cls.token_ids_a = [ + def setup(self) -> None: + """Setup test method.""" + self.token_ids_a = [ 340282366920938463463374607431768211456, ] # Create mock ledger with unknown identifier - cls.ledger_api = mock.Mock() + self.ledger_api = mock.Mock() attrs = {"identifier": "dummy"} - cls.ledger_api.configure_mock(**attrs) + self.ledger_api.configure_mock(**attrs) @pytest.mark.ledger def test_get_create_batch_transaction_wrong_identifier(self) -> None: diff --git a/packages/fetchai/skills/erc1155_client/skill.yaml b/packages/fetchai/skills/erc1155_client/skill.yaml index 2584d0ab35..dc4f3d29f4 100644 --- a/packages/fetchai/skills/erc1155_client/skill.yaml +++ b/packages/fetchai/skills/erc1155_client/skill.yaml @@ -21,9 +21,9 @@ fingerprint: tests/test_strategy.py: bafybeicbxie3v6vue3gcnru6vsvggcgy3shxwrldis5gppizbuhooslcqa fingerprint_ignore_patterns: [] connections: -- valory/ledger:0.19.0:bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum +- valory/ledger:0.19.0:bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom contracts: -- fetchai/erc1155:0.22.0:bafybeid4i7dwsulgnwaylzk6xcozewkgacymxhwk2ip5omvccluq2pm7ii +- fetchai/erc1155:0.22.0:bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe protocols: - fetchai/default:1.0.0:bafybeihzesahyayexkhk26fg7rqnjuqaab3bmcijtjekvskvs4xw6ecyuu - fetchai/fipa:1.0.0:bafybeih27chr3b3anjeq26yd5c2p3hypp4sijzdu6yrorpwwxnvkeoa2ei diff --git a/packages/fetchai/skills/erc1155_deploy/skill.yaml b/packages/fetchai/skills/erc1155_deploy/skill.yaml index 26e34683a9..3367cf4587 100644 --- a/packages/fetchai/skills/erc1155_deploy/skill.yaml +++ b/packages/fetchai/skills/erc1155_deploy/skill.yaml @@ -21,9 +21,9 @@ fingerprint: tests/test_strategy.py: bafybeigxtw2j2c7vl6xhdwos62jbtmx62xfgdyadptm5eewmkesmcooyea fingerprint_ignore_patterns: [] connections: -- valory/ledger:0.19.0:bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum +- valory/ledger:0.19.0:bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom contracts: -- fetchai/erc1155:0.22.0:bafybeid4i7dwsulgnwaylzk6xcozewkgacymxhwk2ip5omvccluq2pm7ii +- fetchai/erc1155:0.22.0:bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe protocols: - fetchai/default:1.0.0:bafybeihzesahyayexkhk26fg7rqnjuqaab3bmcijtjekvskvs4xw6ecyuu - fetchai/fipa:1.0.0:bafybeih27chr3b3anjeq26yd5c2p3hypp4sijzdu6yrorpwwxnvkeoa2ei diff --git a/packages/fetchai/skills/generic_buyer/skill.yaml b/packages/fetchai/skills/generic_buyer/skill.yaml index f336b4e2fb..1199b8de0b 100644 --- a/packages/fetchai/skills/generic_buyer/skill.yaml +++ b/packages/fetchai/skills/generic_buyer/skill.yaml @@ -19,7 +19,7 @@ fingerprint: tests/test_models.py: bafybeibh72j3n72yseqvmpppucpu5wtidf6ebxbxkfnmrnlh4zv5y5apei fingerprint_ignore_patterns: [] connections: -- valory/ledger:0.19.0:bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum +- valory/ledger:0.19.0:bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom contracts: [] protocols: - fetchai/default:1.0.0:bafybeihzesahyayexkhk26fg7rqnjuqaab3bmcijtjekvskvs4xw6ecyuu diff --git a/packages/fetchai/skills/generic_seller/skill.yaml b/packages/fetchai/skills/generic_seller/skill.yaml index 66b459884a..43aa9f676d 100644 --- a/packages/fetchai/skills/generic_seller/skill.yaml +++ b/packages/fetchai/skills/generic_seller/skill.yaml @@ -20,7 +20,7 @@ fingerprint: tests/test_models.py: bafybeihabrc22zqssit3fmqhxptosy6qz6mx65ukhf5iayvirfv42xrhoq fingerprint_ignore_patterns: [] connections: -- valory/ledger:0.19.0:bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum +- valory/ledger:0.19.0:bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom contracts: [] protocols: - fetchai/default:1.0.0:bafybeihzesahyayexkhk26fg7rqnjuqaab3bmcijtjekvskvs4xw6ecyuu diff --git a/packages/packages.json b/packages/packages.json index bc56a25ce5..c8378afe30 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -9,11 +9,11 @@ "protocol/valory/ledger_api/1.0.0": "bafybeih7rhi5zvfvwakx5ifgxsz2cfipeecsh7bm3gnudjxtvhrygpcftq", "connection/fetchai/http_server/0.22.0": "bafybeidxb5gk3samqoflbztqnlnqtvtph5emobaojx3w47674ay5d7pmeu", "connection/fetchai/stub/0.21.0": "bafybeieqlozydyvdxmjxhqygwq27djecpiftoqwlcpcr4qpotomwnh66yy", - "connection/valory/ledger/0.19.0": "bafybeibkvdh2j4gslnaa56kwihm7l32ofqdzwhnx6r4ga4v65k6ccwgfum", - "connection/valory/p2p_libp2p/0.1.0": "bafybeihjlcop2vvpqfjqcwc4lqgbvktxgc3frhtsbusjypcmefrape2h3u", + "connection/valory/ledger/0.19.0": "bafybeift7fx4vp2jq4btplocifby2xnnbzxppxdttgyyvwepj5cv7akfom", + "connection/valory/p2p_libp2p/0.1.0": "bafybeigfp2fjiqqcy5xess6kffcqp7eb2qmn2p6ihb6kgpul2ygcawtx2i", "connection/valory/p2p_libp2p_client/0.1.0": "bafybeidkk33xbga54szmitk6uwsi3ef56hbbdbuasltqtiyki34hgfpnxa", "connection/valory/p2p_libp2p_mailbox/0.1.0": "bafybeihjjsenbsgh6x2vukea7mqzsbcbqqbog6xa43raen24ewqf4qq3pm", - "contract/fetchai/erc1155/0.22.0": "bafybeid4i7dwsulgnwaylzk6xcozewkgacymxhwk2ip5omvccluq2pm7ii", + "contract/fetchai/erc1155/0.22.0": "bafybeieq5xpb6k52csnzscdqrzo4yizoqxeim46pa5jltrmg7zhihcgspe", "protocol/fetchai/fipa/1.0.0": "bafybeih27chr3b3anjeq26yd5c2p3hypp4sijzdu6yrorpwwxnvkeoa2ei", "protocol/fetchai/oef_search/1.0.0": "bafybeifiec4jvsa6mcbmasjno3bwvjwwwubyp25hjqwe7gjfksgvwgdisq", "protocol/fetchai/state_update/1.0.0": "bafybeidtndlmppst6l6iughpflqbbbkzditixo2fy2dncxfkb5apkx5y4m", @@ -30,14 +30,14 @@ "agent/open_aea/my_first_aea/0.1.0": "bafybeifelwg4md24lwpxgx7x5cugq7ovhbkew3lxw43m52rdppfn5o5g4i", "connection/fetchai/local/0.20.0": "bafybeianwid4lh3ubjheg4ho7qznuib2t6k35rcuconcbwtzmih4qdxo2i", "connection/valory/http_client/0.23.0": "bafybeihz3tubwado7j3wlivndzzuj3c6fdsp4ra5r3nqixn3ufawzo3wii", - "connection/valory/test_libp2p/0.1.0": "bafybeigbkr22vy4bxfl3hohjzwxj76wn5y77ssrsdeqqiu3a7yrpkqpfle", + "connection/valory/test_libp2p/0.1.0": "bafybeibqoz7zp7vrlhw4glnwz4gby7ruugeib6whe6h4xrzjta5u2sbbi4", "protocol/fetchai/tac/1.0.0": "bafybeiaew226n32rwp3h57zl4b2mmbrhjbyrdjbl2evnxf2tmmi4vrls7a", - "skill/fetchai/erc1155_client/0.28.0": "bafybeiecwwk7nesipstq7acvrkjv2byze27t2n6jlnxwggl3ppcbybuoum", - "skill/fetchai/erc1155_deploy/0.30.0": "bafybeihmtiouapqz35is2hx6x5k6nrdnnjtz3uoywe34oyrxqg7na6u4wu", + "skill/fetchai/erc1155_client/0.28.0": "bafybeidlrgyn4eonxl2sglzu36lmpo7say2pw7usvrfisbhjt2jtv7ht4e", + "skill/fetchai/erc1155_deploy/0.30.0": "bafybeiexcya6etb5tn4nkcpvxuhvqextwbfvcznansn7dccfnqgff6kioq", "skill/fetchai/error/0.17.0": "bafybeib7nhokw3bc46oxuk5mjazan42evipowmka2ikfcs6drcdz4mwkjm", "skill/fetchai/fipa_dummy_buyer/0.2.0": "bafybeiha4jultg5srhr2ijplvubeo7esv4raq2cjlggmyzcaimop2ggg2m", - "skill/fetchai/generic_buyer/0.26.0": "bafybeial7pz6vebq6mq7v2aiagmqirto3jffurfsysjmd2ujhheqwwogoa", - "skill/fetchai/generic_seller/0.27.0": "bafybeiefbhuiax2bqgmrztugtii36ob2hw7tsreoyqnsrqxsqz36bdfjfy", + "skill/fetchai/generic_buyer/0.26.0": "bafybeiht376to56oeutzpxoyoijv4i76sydyiou3ydwfmzta4l4kljotmm", + "skill/fetchai/generic_seller/0.27.0": "bafybeif5y3nv2gdj72uzzlqt2ntdhnjeq433srxxq6p3q2gu4wcddnbh7i", "skill/fetchai/task_test_skill/0.1.0": "bafybeidv77u2xl52mnxakwvh7fuh46aiwfpteyof4eaptfd4agoi6cdble" }, "third_party": {} diff --git a/packages/valory/connections/ledger/connection.yaml b/packages/valory/connections/ledger/connection.yaml index d6ae972c02..c0a76c551b 100644 --- a/packages/valory/connections/ledger/connection.yaml +++ b/packages/valory/connections/ledger/connection.yaml @@ -15,7 +15,7 @@ fingerprint: tests/__init__.py: bafybeieyhttiwruutk6574yzj7dk2afamgdum5vktyv54gsax7dlkuqtc4 tests/conftest.py: bafybeihqsdoamxlgox2klpjwmyrylrycyfon3jldvmr24q4ai33h24llpi tests/test_contract_dispatcher.py: bafybeidpwcnitn5gzgmbtaur3mevme72rsdaax27nu4bs3aqxwixyn4cvy - tests/test_ledger.py: bafybeihaptbazl2yhy2dbhunmpnwb5vnowgi6knyjtdpjdj35ur5ak7q7a + tests/test_ledger.py: bafybeidjae3qflu4qx7spehv7dfqatndhmd655zwv6ot2etmtceq5lvos4 tests/test_ledger_api.py: bafybeihkkyd2ag5yp46jof67xgdd2xsgpefleivuwmz7jdl2r6gji7w2ey fingerprint_ignore_patterns: [] connections: [] diff --git a/packages/valory/connections/ledger/tests/test_ledger.py b/packages/valory/connections/ledger/tests/test_ledger.py index 143fc048eb..6731e733c4 100644 --- a/packages/valory/connections/ledger/tests/test_ledger.py +++ b/packages/valory/connections/ledger/tests/test_ledger.py @@ -438,7 +438,7 @@ class TestLedgerConnectionWithMultiplexer: ledger_api_dialogues: DummyLedgerApiDialogues @classmethod - def setup(cls) -> None: + def setup_class(cls) -> None: """Setup the test class.""" # set up a multiplexer with the required ledger connection cls.running_loop = asyncio.new_event_loop() @@ -466,7 +466,7 @@ def setup(cls) -> None: ) @classmethod - def teardown(cls) -> None: + def teardown_class(cls) -> None: """Tear down the multiplexer.""" cls.ledger_connection._ledger_dispatcher.block = False # type: ignore if cls.multiplexer.is_connected: diff --git a/packages/valory/connections/p2p_libp2p/connection.yaml b/packages/valory/connections/p2p_libp2p/connection.yaml index f3a1976c03..f5fe5aac48 100644 --- a/packages/valory/connections/p2p_libp2p/connection.yaml +++ b/packages/valory/connections/p2p_libp2p/connection.yaml @@ -59,7 +59,7 @@ fingerprint: tests/test_aea_cli.py: bafybeicyqnu4pzdl26pd765qcommyqccwvge7uh3keuk6cswpnbc47ovii tests/test_build.py: bafybeicacwij2ptpg4vbwdwtwrzwnp4afoewtsaq2woxfooipwy7z2hmxe tests/test_errors.py: bafybeigfwg7cmxbgo7j2pce5vy55wvqze7wv67d4v37k3wpcflwbgzege4 - tests/test_go_code_matching_acn.py: bafybeig3mxp6l5g2fokkireopfxc6j3rvmxgo6nomy25fvoa3a6ozgk2ay + tests/test_go_code_matching_acn.py: bafybeificee4dtvgtr2ejegokahlbqyvmvvtgxhs5b3ps4ezyjkz46b23u fingerprint_ignore_patterns: [] build_entrypoint: check_dependencies.py connections: [] diff --git a/packages/valory/connections/p2p_libp2p/tests/test_go_code_matching_acn.py b/packages/valory/connections/p2p_libp2p/tests/test_go_code_matching_acn.py index badeb001fe..75cc059927 100644 --- a/packages/valory/connections/p2p_libp2p/tests/test_go_code_matching_acn.py +++ b/packages/valory/connections/p2p_libp2p/tests/test_go_code_matching_acn.py @@ -104,8 +104,7 @@ class TestP2PLibp2pGoCodeMatchingOpenACN: 3. use filecmp and difflib to check for differences """ - @classmethod - def setup(cls) -> Any: # I don't take extra args :) + def setup(self) -> Any: # I don't take extra args :) """Set the test up""" def test_repo_not_bare(self, acn_repo_dir: Any) -> Any: diff --git a/packages/valory/connections/test_libp2p/connection.yaml b/packages/valory/connections/test_libp2p/connection.yaml index 608e69f1e1..702b4646bf 100644 --- a/packages/valory/connections/test_libp2p/connection.yaml +++ b/packages/valory/connections/test_libp2p/connection.yaml @@ -34,7 +34,7 @@ fingerprint: tests/test_p2p_libp2p_mailbox/test_mailbox_service.py: bafybeibp3bkwkrw57qahvuysjdlumywtlk3te5gsvusgrvhsc75k7rrk4u fingerprint_ignore_patterns: [] connections: -- valory/p2p_libp2p:0.1.0:bafybeihjlcop2vvpqfjqcwc4lqgbvktxgc3frhtsbusjypcmefrape2h3u +- valory/p2p_libp2p:0.1.0:bafybeigfp2fjiqqcy5xess6kffcqp7eb2qmn2p6ihb6kgpul2ygcawtx2i - valory/p2p_libp2p_client:0.1.0:bafybeidkk33xbga54szmitk6uwsi3ef56hbbdbuasltqtiyki34hgfpnxa - valory/p2p_libp2p_mailbox:0.1.0:bafybeihjjsenbsgh6x2vukea7mqzsbcbqqbog6xa43raen24ewqf4qq3pm protocols: diff --git a/plugins/aea-cli-benchmark/setup.py b/plugins/aea-cli-benchmark/setup.py index 825cce2789..380a6aeca4 100755 --- a/plugins/aea-cli-benchmark/setup.py +++ b/plugins/aea-cli-benchmark/setup.py @@ -26,7 +26,7 @@ setup( name="open-aea-cli-benchmark", - version="1.26.0", + version="1.27.0", author="Valory AG", license="Apache-2.0", description="CLI extension for AEA framework benchmarking.", diff --git a/plugins/aea-cli-ipfs/setup.py b/plugins/aea-cli-ipfs/setup.py index 57948e6ed2..e506a8ca47 100755 --- a/plugins/aea-cli-ipfs/setup.py +++ b/plugins/aea-cli-ipfs/setup.py @@ -28,7 +28,7 @@ setup( name="open-aea-cli-ipfs", - version="1.26.0", + version="1.27.0", author="Valory AG", license="Apache-2.0", description="CLI extension for open AEA framework wrapping IPFS functionality.", diff --git a/plugins/aea-ledger-cosmos/setup.py b/plugins/aea-ledger-cosmos/setup.py index 5ed3a875ba..c7a946091e 100644 --- a/plugins/aea-ledger-cosmos/setup.py +++ b/plugins/aea-ledger-cosmos/setup.py @@ -26,7 +26,7 @@ setup( name="open-aea-ledger-cosmos", - version="1.26.0", + version="1.27.0", author="Valory AG", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and ledger api of Cosmos.", diff --git a/plugins/aea-ledger-ethereum/setup.py b/plugins/aea-ledger-ethereum/setup.py index 42cd52556d..eccf91a3c0 100644 --- a/plugins/aea-ledger-ethereum/setup.py +++ b/plugins/aea-ledger-ethereum/setup.py @@ -26,7 +26,7 @@ setup( name="open-aea-ledger-ethereum", - version="1.26.0", + version="1.27.0", author="Valory AG", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and ledger api of Ethereum.", diff --git a/plugins/aea-ledger-fetchai/setup.py b/plugins/aea-ledger-fetchai/setup.py index fc2f237a68..3687a54ff7 100644 --- a/plugins/aea-ledger-fetchai/setup.py +++ b/plugins/aea-ledger-fetchai/setup.py @@ -31,7 +31,7 @@ setup( name="open-aea-ledger-fetchai", - version="1.26.0", + version="1.27.0", author="Valory AG", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and ledger API of Fetch.AI.", diff --git a/scripts/RELEASE_PROCESS.md b/scripts/RELEASE_PROCESS.md index 1fe9ce9016..15bb81fc81 100644 --- a/scripts/RELEASE_PROCESS.md +++ b/scripts/RELEASE_PROCESS.md @@ -1,48 +1,40 @@ # Release Process from develop to main -1. Make sure all tests pass, coverage is at 100% and the local branch is in a clean state (nothing to commit). Make sure you have a clean develop virtual environment. +1. Make sure you have a clean develop virtual environment (`make new_env`). Make sure all tests pass, coverage is at 100% and the local branch is in a clean state (nothing to commit after running `make formatters`, `make code-checks` and `make generators`). -2. Determine the next AEA version - Create new release branch named "feature/release-{new-version}, switch to this branch" - Run `python scripts/bump_aea_version.py --new-version NEW_VERSION_HERE`. Commit if satisfied. +2. Determine the next AEA version: Create new release branch named "feature/release-{new-version}, switch to this branch and run `python scripts/bump_aea_version.py --new-version NEW_VERSION_HERE`. Commit if satisfied. 3. Bump plugin versions if necessary by running `python scripts/update_plugin_versions.py --update "PLUGIN_NAME,NEW_VERSION"`. Commit if satisfied. -4. Check the protocols are up-to-date by running `aea generate-all-protocols --check-clean`. Commit if changes occurred. Do the same for test protocols using `aea generate-all-protocols tests/data/packages --check-clean` +4. [CURRENTLY SKIPPED] Bump all the packages to their latest versions by running `python scripts/update_package_versions.py`. -5. [CURRENTLY SKIPPED] Bump all the packages to their latest versions by running `python scripts/update_package_versions.py`. +5. Update the package and dependency hashes, protocols, as well as docs using `make generators`. Commit if changes occurred. -6. Update the package and dependency hashes using `make hashes`. Commit if changes occurred. +6. Ensure all links are configured `tox -e docs-serve`. Commit if satisfied. -7. Check the package upgrades are correct by running `python -m aea.cli check-packages` and `python scripts/check_package_versions_in_docs.py`. Commit if satisfied. +7. Write release notes and place them in `HISTORY.md`. Add upgrading tips in `upgrading.md`. If necessary, adjust version references in `SECURITY.md`. Commit if satisfied. -8. Check the docs are up-to-date by running `tox -e generate-api-documentation`, `python scripts/check_doc_ipfs_hashes.py --fix` and `python scripts/check_doc_links.py`. Ensure all links are configured `mkdocs serve`. Commit if satisfied. +8. Run spell checker `./scripts/spell-check.sh`. Run `pylint --disable all --enable spelling ...`. Commit if required. -9. Ensure the signing protocol hash in open-aea is updated: `tests/test_configurations/test_constants.py::test_signing_protocol_hash` +9. Open PRs and merge into develop. Then open develop to main PR and merge it. -10. Write release notes and place them in `HISTORY.md`. Add upgrading tips in `upgrading.md`. If necessary, adjust version references in `SECURITY.md`. Commit if satisfied. +10. Tag version on main. -11. Run spell checker `./scripts/spell-check.sh`. Run `pylint --disable all --enable spelling ...`. Commit if required. +11. Pull main, make a clean environment (`pipenv --rm` and `pipenv --python 3.10` and `pipenv shell`) and create distributions: `make dist`. -12. Open PRs and merge into develop. Then open develop to main PR and merge it. - -13. Tag version on main. - -14. Pull main, make a clean environment (`pipenv --rm` and `pipenv --python 3.10` and `pipenv shell`) and create distributions: `make dist`. - -15. Publish to PyPI with twine: `pip install twine` and `twine upload dist/*`. Optionally, publish to Test-PyPI with twine: +12. Publish to PyPI with twine: `pip install twine` and `twine upload dist/*`. Optionally, publish to Test-PyPI with twine: `twine upload --repository-url https://test.pypi.org/legacy/ dist/*`. -16. Repeat 14. & 15. for each plugin (use `python setup.py sdist bdist_wheel` instead of `make dist`). +13. Repeat 14. & 15. for each plugin (use `python setup.py sdist bdist_wheel` instead of `make dist`). -17. Make clean environment and install release from PyPI: `pip install open-aea[all] --no-cache`. +14. Make clean environment and install release from PyPI: `pip install open-aea[all] --no-cache`. -18. Publish the latest packages to the IPFS registry using `aea init --reset --author valory --ipfs --remote` and `aea push-all`. If necessary, run it several times until all packages are updated. +15. Publish the latest packages to the IPFS registry using `aea init --reset --author valory --ipfs --remote` and `aea push-all`. If necessary, run it several times until all packages are updated. -19. Build the release images using `skaffold build -p release` which will also publish them to Docker Hub. This builds with no cache so to ensure replicable builds. +16. Build the release images using `skaffold build -p release` which will also publish them to Docker Hub. This builds with no cache so to ensure replicable builds. -20. Tag the latest images using `skaffold build -p release-latest` which will also publish them to Docker Hub. +17. Tag the latest images using `skaffold build -p release-latest` which will also publish them to Docker Hub. If something goes wrong and only needs a small fix do `LAST_VERSION.post1` as version, apply fixes, push again to PyPI. diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 510d4f3c8e..46c69893b1 100644 --- a/scripts/install.ps1 +++ b/scripts/install.ps1 @@ -34,7 +34,7 @@ function instal_choco_golang_gcc { } function install_aea { echo "Install aea" - $output=pip install open-aea[all]==1.26.0 --force --no-cache-dir 2>&1 |out-string; + $output=pip install open-aea[all]==1.27.0 --force --no-cache-dir 2>&1 |out-string; if ($LastExitCode -ne 0) { echo $output echo "AEA install failed!" diff --git a/scripts/install.sh b/scripts/install.sh index 2a903e18fe..188f54f076 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -42,7 +42,7 @@ function is_python_version_ok() { function install_aea (){ echo "Install AEA" - output=$(pip3 install --user open-aea[all]==1.26.0 --force --no-cache-dir) + output=$(pip3 install --user open-aea[all]==1.27.0 --force --no-cache-dir) if [[ $? -ne 0 ]]; then echo "$output" diff --git a/skaffold.yaml b/skaffold.yaml index 66066652ab..9606a41602 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -5,7 +5,7 @@ metadata: build: tagPolicy: envTemplate: - template: "1.26.0" + template: "1.27.0" artifacts: - image: valory/open-aea-develop docker: @@ -24,7 +24,7 @@ profiles: build: tagPolicy: envTemplate: - template: "1.26.0" + template: "1.27.0" artifacts: - image: valory/open-aea-docs docker: diff --git a/tests/test_decision_maker/test_default.py b/tests/test_decision_maker/test_default.py index d54e9b1171..1438c221f6 100644 --- a/tests/test_decision_maker/test_default.py +++ b/tests/test_decision_maker/test_default.py @@ -94,8 +94,10 @@ def role_from_first_message( # pylint: disable=unused-argument class BaseTestDecisionMaker: """Test the decision maker.""" + decision_maker: DecisionMaker + @classmethod - def setup(cls): + def setup_class(cls): """Initialise the decision maker.""" cls.wallet = Wallet( { @@ -115,14 +117,15 @@ def setup(cls): cls.decision_maker_handler = DecisionMakerHandler( identity=cls.identity, wallet=cls.wallet, config=cls.config ) - cls.decision_maker = DecisionMaker(cls.decision_maker_handler) - cls.tx_sender_addr = "agent_1" cls.tx_counterparty_addr = "pk" cls.info = {"some_info_key": "some_info_value"} cls.ledger_id = FetchAICrypto.identifier - cls.decision_maker.start() + def setup(self): + """Setup test method.""" + self.decision_maker = DecisionMaker(self.decision_maker_handler) + self.decision_maker.start() def test_decision_maker_properties(self): """Test DecisionMaker properties.""" @@ -494,10 +497,9 @@ def test_handle_messages_from_two_dialogues_same_agent(self): signing_msg_response = self.decision_maker.message_out_queue.get(timeout=2) assert signing_msg_response is not None - @classmethod - def teardown(cls): + def teardown(self): """Tear the tests down.""" - cls.decision_maker.stop() + self.decision_maker.stop() class TestDecisionMaker(BaseTestDecisionMaker): diff --git a/tests/test_docs/test_bash_yaml/md_files/bash-quickstart.md b/tests/test_docs/test_bash_yaml/md_files/bash-quickstart.md index 934df30e20..5d4642f4f4 100644 --- a/tests/test_docs/test_bash_yaml/md_files/bash-quickstart.md +++ b/tests/test_docs/test_bash_yaml/md_files/bash-quickstart.md @@ -44,7 +44,7 @@ pip install open-aea[all] pip install open-aea-cli-ipfs ``` ``` -svn checkout https://github.com/valory-xyz/open-aea/tags/v1.26.0/packages packages +svn checkout https://github.com/valory-xyz/open-aea/tags/v1.27.0/packages packages ``` ``` bash diff --git a/tests/test_protocols/test_dialogue/test_base.py b/tests/test_protocols/test_dialogue/test_base.py index db22f356f4..43c02b3a71 100644 --- a/tests/test_protocols/test_dialogue/test_base.py +++ b/tests/test_protocols/test_dialogue/test_base.py @@ -154,7 +154,7 @@ class TestDialogueLabel: """Test for DialogueLabel.""" @classmethod - def setup(cls): + def setup_class(cls): """Initialise the environment to test DialogueLabel.""" cls.agent_address = "agent 1" cls.opponent_address = "agent 2" @@ -231,58 +231,57 @@ def test_all_methods(self): class TestDialogueBase: """Test for Dialogue.""" - @classmethod - def setup(cls): + def setup(self): """Initialise the environment to test Dialogue.""" - cls.incomplete_reference = (str(1), "") - cls.complete_reference = (str(1), str(1)) - cls.opponent_address = "agent 2" - cls.agent_address = "agent 1" + self.incomplete_reference = (str(1), "") + self.complete_reference = (str(1), str(1)) + self.opponent_address = "agent 2" + self.agent_address = "agent 1" - cls.dialogue_label = DialogueLabel( - dialogue_reference=cls.incomplete_reference, - dialogue_opponent_addr=cls.opponent_address, - dialogue_starter_addr=cls.agent_address, + self.dialogue_label = DialogueLabel( + dialogue_reference=self.incomplete_reference, + dialogue_opponent_addr=self.opponent_address, + dialogue_starter_addr=self.agent_address, ) - cls.dialogue = Dialogue(dialogue_label=cls.dialogue_label) + self.dialogue = Dialogue(dialogue_label=self.dialogue_label) - cls.dialogue_label_opponent_started = DialogueLabel( - dialogue_reference=cls.complete_reference, - dialogue_opponent_addr=cls.opponent_address, - dialogue_starter_addr=cls.opponent_address, + self.dialogue_label_opponent_started = DialogueLabel( + dialogue_reference=self.complete_reference, + dialogue_opponent_addr=self.opponent_address, + dialogue_starter_addr=self.opponent_address, ) - cls.dialogue_opponent_started = Dialogue( - dialogue_label=cls.dialogue_label_opponent_started + self.dialogue_opponent_started = Dialogue( + dialogue_label=self.dialogue_label_opponent_started ) # convenient messages to reuse across tests - cls.valid_message_1_by_self = DefaultMessage( + self.valid_message_1_by_self = DefaultMessage( dialogue_reference=(str(1), ""), performative=DefaultMessage.Performative.BYTES, content=b"Hello", ) - cls.valid_message_1_by_self.sender = cls.agent_address - cls.valid_message_1_by_self.to = cls.opponent_address + self.valid_message_1_by_self.sender = self.agent_address + self.valid_message_1_by_self.to = self.opponent_address - cls.valid_message_2_by_other = DefaultMessage( + self.valid_message_2_by_other = DefaultMessage( dialogue_reference=(str(1), str(1)), message_id=-1, target=1, performative=DefaultMessage.Performative.BYTES, content=b"Hello back", ) - cls.valid_message_2_by_other.sender = cls.opponent_address - cls.valid_message_2_by_other.to = cls.agent_address + self.valid_message_2_by_other.sender = self.opponent_address + self.valid_message_2_by_other.to = self.agent_address - cls.valid_message_3_by_self = DefaultMessage( + self.valid_message_3_by_self = DefaultMessage( dialogue_reference=(str(1), str(1)), message_id=2, target=-1, performative=DefaultMessage.Performative.BYTES, content=b"Hello back 2", ) - cls.valid_message_3_by_self.sender = cls.agent_address - cls.valid_message_3_by_self.to = cls.opponent_address + self.valid_message_3_by_self.sender = self.agent_address + self.valid_message_3_by_self.to = self.opponent_address def test_inner_classes(self): """Test the inner classes: Role and EndStates.""" @@ -967,21 +966,20 @@ def test___str__2(self): class TestDialogueStats: """Test for DialogueStats.""" - @classmethod - def setup(cls): + def setup(self): """Initialise the environment to test DialogueStats.""" - cls.agent_address = "agent 1" - cls.opponent_address = "agent 2" - cls.dialogue_label = DialogueLabel( + self.agent_address = "agent 1" + self.opponent_address = "agent 2" + self.dialogue_label = DialogueLabel( dialogue_reference=(str(1), ""), - dialogue_opponent_addr=cls.opponent_address, - dialogue_starter_addr=cls.agent_address, + dialogue_opponent_addr=self.opponent_address, + dialogue_starter_addr=self.agent_address, ) - cls.dialogue = Dialogue(dialogue_label=cls.dialogue_label) + self.dialogue = Dialogue(dialogue_label=self.dialogue_label) end_states = frozenset( {Dialogue.EndState.SUCCESSFUL, Dialogue.EndState.FAILED} ) # type: FrozenSet[BaseDialogue.EndState] - cls.dialogue_stats = DialogueStats(end_states) + self.dialogue_stats = DialogueStats(end_states) def test_properties(self): """Test dialogue properties.""" @@ -1965,40 +1963,39 @@ def test_dump_restore(self): class TestBaseDialoguesStorage: """Test PersistDialoguesStorage.""" - @classmethod - def setup(cls): + def setup(self): """Initialise the environment to test Dialogue.""" - cls.incomplete_reference = (str(1), "") - cls.complete_reference = (str(1), str(1)) - cls.opponent_address = "agent 2" - cls.agent_address = "agent 1" + self.incomplete_reference = (str(1), "") + self.complete_reference = (str(1), str(1)) + self.opponent_address = "agent 2" + self.agent_address = "agent 1" - cls.dialogue_label = DialogueLabel( - dialogue_reference=cls.incomplete_reference, - dialogue_opponent_addr=cls.opponent_address, - dialogue_starter_addr=cls.agent_address, + self.dialogue_label = DialogueLabel( + dialogue_reference=self.incomplete_reference, + dialogue_opponent_addr=self.opponent_address, + dialogue_starter_addr=self.agent_address, ) - cls.dialogue = Dialogue(dialogue_label=cls.dialogue_label) + self.dialogue = Dialogue(dialogue_label=self.dialogue_label) - cls.dialogue_label_opponent_started = DialogueLabel( - dialogue_reference=cls.complete_reference, - dialogue_opponent_addr=cls.opponent_address, - dialogue_starter_addr=cls.opponent_address, + self.dialogue_label_opponent_started = DialogueLabel( + dialogue_reference=self.complete_reference, + dialogue_opponent_addr=self.opponent_address, + dialogue_starter_addr=self.opponent_address, ) - cls.dialogue_opponent_started = Dialogue( - dialogue_label=cls.dialogue_label_opponent_started + self.dialogue_opponent_started = Dialogue( + dialogue_label=self.dialogue_label_opponent_started ) # convenient messages to reuse across tests - cls.valid_message_1_by_self = DefaultMessage( + self.valid_message_1_by_self = DefaultMessage( dialogue_reference=(str(1), ""), performative=DefaultMessage.Performative.BYTES, content=b"Hello", ) - cls.valid_message_1_by_self.sender = cls.agent_address - cls.valid_message_1_by_self.to = cls.opponent_address + self.valid_message_1_by_self.sender = self.agent_address + self.valid_message_1_by_self.to = self.opponent_address - cls.storage = BasicDialoguesStorage(Mock()) + self.storage = BasicDialoguesStorage(Mock()) def test_dialogues_in_terminal_state_kept(self): """Test dialogues in terminal state handled properly.""" diff --git a/tests/test_test_tools/test_click_testing.py b/tests/test_test_tools/test_click_testing.py index 02d0de4331..7f9077b505 100644 --- a/tests/test_test_tools/test_click_testing.py +++ b/tests/test_test_tools/test_click_testing.py @@ -176,11 +176,11 @@ def test_setup_cls_and_setup(self) -> None: self.test_cls.setup_class() assert isinstance(self.test_cls._CliTest__cli_runner, CliRunner) # type: ignore assert self.test_cls._CliTest__cli.name == "aea" # type: ignore - assert not hasattr(self.test_cls, "t") + assert not hasattr(self.test_cls, "_t") test_instance = self.test_cls() # type: ignore test_instance.setup() - assert isinstance(test_instance.t, Path) + assert isinstance(test_instance._t, Path) def test_teardown_and_teardown_cls(self) -> None: """Test teardown and teardown_class""" @@ -188,11 +188,11 @@ def test_teardown_and_teardown_cls(self) -> None: test_instance = self.setup_test() cwd = Path.cwd() - assert not test_instance.t == cwd - os.chdir(test_instance.t) - assert test_instance.t == Path.cwd() + assert not test_instance._t == cwd + os.chdir(test_instance._t) + assert test_instance._t == Path.cwd() test_instance.teardown() - assert not hasattr(self.test_cls, "t") + assert not hasattr(self.test_cls, "_t") test_instance.teardown_class() assert Path.cwd() == cwd diff --git a/tests/test_test_tools/test_test_cases.py b/tests/test_test_tools/test_test_cases.py index 6c6d535b68..bf2253a413 100644 --- a/tests/test_test_tools/test_test_cases.py +++ b/tests/test_test_tools/test_test_cases.py @@ -589,7 +589,8 @@ def test_sign_send_confirm_receipt_transaction( """Test sign_send_confirm_receipt_multisig_transaction is called for backward compatibility.""" class ContractTestCase(BaseContractTestCase): - pass + path_to_contract = Path(".") + ledger_identifier = "" ContractTestCase.sign_send_confirm_receipt_transaction( "tx", "ledger_api", "crypto" diff --git a/tests/test_test_tools/test_test_contract.py b/tests/test_test_tools/test_test_contract.py index f59d9dcc10..cf469d45cc 100644 --- a/tests/test_test_tools/test_test_contract.py +++ b/tests/test_test_tools/test_test_contract.py @@ -59,12 +59,28 @@ class TestCls(BaseContractTestCase): """Concrete `copy` of BaseContractTestCase""" + path_to_contract = Path(".") + ledger_identifier = "" + @classmethod def finish_contract_deployment(cls) -> str: """Concrete finish_contract_deployment""" return "" +def test_base_contract_test_case_definition_without_attributes_raises_error() -> None: + """Test that definition of concrete subclass of BaseContractTestCase without attributes raises error.""" + with pytest.raises(ValueError): + + class TestCls(BaseContractTestCase): + pass + + with pytest.raises(ValueError): + + class TestClsB(BaseContractTestCase): + path_to_contract = Path(".") + + class TestBaseContractTestCaseSetup: """Test BaseContractTestCase setup.""" @@ -78,15 +94,10 @@ def setup_test_cls(self) -> TestCls: """Helper method to setup test to be tested""" test_instance = self.test_cls() # type: ignore + test_instance.setup_class() test_instance.setup() return test_instance - def test_contract_setup_missing_ledger_identifier(self): - """Test contract setup missing ledger identifier""" - - with pytest.raises(ValueError, match="ledger_identifier not set!"): - self.setup_test_cls() - def test_contract_setup_contract_configuration_not_found(self): """Test contract setup contract configuration not found""" diff --git a/tox.ini b/tox.ini index ed71c3e1d2..8f8adcea7c 100644 --- a/tox.ini +++ b/tox.ini @@ -6,7 +6,7 @@ ; we set the associated flag (e.g. for linting we don't need ; the package installation). [tox] -envlist = bandit, safety, black, black-check, isort, isort-check, fix-copyright, check-copyright, hash-check, docs, flake8, liccheck, mypy, pylint, vulture, {plugins-,}py{3.7,3.8,3.9,3.10,3.10-cov}, dependencies-check, package-version-checks, package-dependencies-checks, plugins_deps, fix-doc-hashes, check-doc-links-hashes, check-generate-all-protocols, spell-check, generate-api-documentation +envlist = bandit, safety, black, black-check, isort, isort-check, fix-copyright, check-copyright, hash-check, docs, flake8, liccheck, mypy, pylint, vulture, {plugins-,}py{3.7,3.8,3.9,3.10,3.10-cov}, dependencies-check, package-version-checks, lock-packages, package-dependencies-checks, plugins_deps, fix-doc-hashes, check-doc-links-hashes, check-generate-all-protocols, spell-check, generate-api-documentation ; when running locally we don't want to fail for no good reason skip_missing_interpreters = true @@ -328,6 +328,7 @@ deps = commands = pip install {toxinidir}[all] python -m pip install --no-deps file://{toxinidir}/plugins/aea-cli-ipfs aea generate-all-protocols --check-clean + aea generate-all-protocols tests/data/packages --check-clean [testenv:spell-check] whitelist_externals = mdspell diff --git a/user-image/docker-env.sh b/user-image/docker-env.sh index 09c0c8f478..e20693044d 100644 --- a/user-image/docker-env.sh +++ b/user-image/docker-env.sh @@ -1,7 +1,7 @@ #!/bin/bash # Swap the following lines if you want to work with 'latest' -DOCKER_IMAGE_TAG=valory/open-aea-user:1.26.0 +DOCKER_IMAGE_TAG=valory/open-aea-user:1.27.0 # DOCKER_IMAGE_TAG=valory/open-aea-user:latest DOCKER_BUILD_CONTEXT_DIR=..