From 45a6622fbade8718d0745abaeca0c334ccbbc07d Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Mon, 25 Dec 2023 12:57:01 +0530 Subject: [PATCH 1/3] fix: selection between default values and empty lists --- aea/helpers/env_vars.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aea/helpers/env_vars.py b/aea/helpers/env_vars.py index dda6d26f33..43f62f4b5b 100644 --- a/aea/helpers/env_vars.py +++ b/aea/helpers/env_vars.py @@ -91,11 +91,12 @@ def replace_with_env_var( if var_name in env_variables: var_value = env_variables[var_name] - elif type_str == "list" and var_name == default_var_name: + elif type_str == "list": var_value = parse_list( var_prefix=var_name, env_variables=env_variables, ) + var_value = (default or var_value) if var_value == "[]" else var_value elif default is not None: var_value = default elif default_value is not NotSet: @@ -107,7 +108,6 @@ def replace_with_env_var( if type_str is not None: var_value = convert_value_str_to_type(var_value, type_str) - return var_value From a895a044e9408d0301d0d207a9729dea2df6c7fa Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Tue, 26 Dec 2023 10:08:25 +0530 Subject: [PATCH 2/3] test: default value parsing on the env var parser --- tests/test_helpers/test_env_vars.py | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/test_helpers/test_env_vars.py b/tests/test_helpers/test_env_vars.py index 4a9350b8e2..e0fde93864 100644 --- a/tests/test_helpers/test_env_vars.py +++ b/tests/test_helpers/test_env_vars.py @@ -226,6 +226,37 @@ def test_match_export_parse_consistency(export_data, template) -> None: assert parsed_data == export_data +@pytest.mark.parametrize( + ("template", "parsed"), + argvalues=[ + ( + {"value": "${str:john}"}, + {"value": "john"}, + ), + ( + {"value": "${int:3}"}, + {"value": 3}, + ), + ( + {"value": "${bool:false}"}, + {"value": False}, + ), + ( + {"value": '${list:["foo","bar"]}'}, + {"value": ["foo", "bar"]}, + ), + ( + {"value": '${dict:{"foo":"bar"}}'}, + {"value": {"foo": "bar"}}, + ), + ], +) +def test_parse_defaults(template, parsed) -> None: + """Test default value parsing.""" + parsed_data = apply_env_variables(template, env_variables={}) + assert parsed_data == parsed + + def test_apply_env_variables_on_agent_config(): """Test apply_env_variables_on_agent_config function.""" result = apply_env_variables_on_agent_config( From d49ca0872f2a4f6147b2fff2f529406eb3d973a1 Mon Sep 17 00:00:00 2001 From: angrybayblade Date: Tue, 26 Dec 2023 10:19:42 +0530 Subject: [PATCH 3/3] feat: bump open-aea@1.43.0.post2 --- .spelling | 1 + HISTORY.md | 7 ++++++- aea/__version__.py | 2 +- deploy-image/Dockerfile | 2 +- deploy-image/README.md | 2 +- develop-image/docker-env.sh | 2 +- docs/upgrading.md | 10 +++++++++- examples/tac_deploy/Dockerfile | 2 +- plugins/aea-cli-benchmark/setup.py | 2 +- plugins/aea-cli-ipfs/setup.py | 2 +- plugins/aea-ledger-cosmos/setup.py | 2 +- plugins/aea-ledger-ethereum-flashbots/setup.py | 4 ++-- plugins/aea-ledger-ethereum-hwi/setup.py | 4 ++-- plugins/aea-ledger-ethereum/setup.py | 2 +- plugins/aea-ledger-fetchai/setup.py | 4 ++-- plugins/aea-ledger-solana/setup.py | 2 +- scripts/install.ps1 | 2 +- scripts/install.sh | 2 +- skaffold.yaml | 4 ++-- user-image/Dockerfile | 2 +- user-image/docker-env.sh | 2 +- 21 files changed, 38 insertions(+), 24 deletions(-) diff --git a/.spelling b/.spelling index 307d1c2a67..294991a411 100644 --- a/.spelling +++ b/.spelling @@ -381,3 +381,4 @@ pyyaml 1.39.0.post1 1.41.0.post1 1.43.0.post1 +1.43.0.post2 diff --git a/HISTORY.md b/HISTORY.md index 023397512c..3104bfb560 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,9 +1,14 @@ # Release History - open AEA +## 1.43.0.post2 (2023-12-26) + +AEA: +- Fixes the default environment variable parsing for the base types + ## 1.43.0.post1 (2023-12-19) AEA: -- Fixes the default environment variable parsing +- Fixes the default environment variable parsing for the list types ## 1.43.0 (2023-12-14) diff --git a/aea/__version__.py b/aea/__version__.py index 3e6752e20a..6919917503 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.43.0.post1" +__version__ = "1.43.0.post2" __author__ = "Valory AG" __license__ = "Apache-2.0" __copyright__ = "2021 Valory AG, 2019 Fetch.AI Limited" diff --git a/deploy-image/Dockerfile b/deploy-image/Dockerfile index ac7d382dc1..968be76052 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.43.0.post1 "open-aea-cli-ipfs<2.0.0,>=1.43.0.post1" +RUN pip install --upgrade --force-reinstall open-aea[all]==1.43.0.post2 "open-aea-cli-ipfs<2.0.0,>=1.43.0.post2" # directories and aea cli config WORKDIR /home/agents diff --git a/deploy-image/README.md b/deploy-image/README.md index d73f9b7072..ba17be51f7 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.43.0.post1/packages packages +svn checkout https://github.com/valory-xyz/open-aea/tags/v1.43.0.post2/packages packages ``` ### Modify scripts diff --git a/develop-image/docker-env.sh b/develop-image/docker-env.sh index c8d45c1e5a..ea1cee3ebd 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.43.0.post1 +DOCKER_IMAGE_TAG=valory/open-aea-develop:1.43.0.post2 # DOCKER_IMAGE_TAG=valory/open-aea-develop:latest DOCKER_BUILD_CONTEXT_DIR=.. diff --git a/docs/upgrading.md b/docs/upgrading.md index 98ede78804..47716696c3 100644 --- a/docs/upgrading.md +++ b/docs/upgrading.md @@ -9,7 +9,15 @@ Below we describe the additional manual steps required to upgrade between differ ### Upgrade guide -## `v1.42.0` to `v1.43.0.post1` +## `v1.43.0.post1` to `v1.43.0.post2` + +- No backwards incompatible changes + +## `v1.43.0` to `v1.43.0.post1` + +- No backwards incompatible changes + +## `v1.42.0` to `v1.43.0` - No backwards incompatible changes diff --git a/examples/tac_deploy/Dockerfile b/examples/tac_deploy/Dockerfile index 3f24910977..d72e2181db 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 open-aea[all]==1.43.0.post1 +RUN pip install --upgrade --force-reinstall open-aea[all]==1.43.0.post2 # directories and aea cli config COPY /.aea /home/.aea diff --git a/plugins/aea-cli-benchmark/setup.py b/plugins/aea-cli-benchmark/setup.py index 71201a9ca9..4a02411000 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.43.0.post1", + version="1.43.0.post2", 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 76ec888a3a..0aa13130ba 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.43.0.post1", + version="1.43.0.post2", 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 1a5d27e5cb..06bccf0b6e 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.43.0.post1", + version="1.43.0.post2", 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-flashbots/setup.py b/plugins/aea-ledger-ethereum-flashbots/setup.py index 3482ab4ab7..bddc70c0d6 100644 --- a/plugins/aea-ledger-ethereum-flashbots/setup.py +++ b/plugins/aea-ledger-ethereum-flashbots/setup.py @@ -25,7 +25,7 @@ setup( name="open-aea-ledger-ethereum-flashbots", - version="1.43.0.post1", + version="1.43.0.post2", author="Valory AG", license="Apache-2.0", description="Python package extending the default open-aea ethereum ledger plugin to add support for flashbots.", @@ -41,7 +41,7 @@ }, python_requires=">=3.9,<4.0", install_requires=[ - "open-aea-ledger-ethereum~=1.43.0.post1", + "open-aea-ledger-ethereum~=1.43.0.post2", "open-aea-flashbots==1.4.0", ], tests_require=["pytest"], diff --git a/plugins/aea-ledger-ethereum-hwi/setup.py b/plugins/aea-ledger-ethereum-hwi/setup.py index 0377d525d4..941b197ccb 100644 --- a/plugins/aea-ledger-ethereum-hwi/setup.py +++ b/plugins/aea-ledger-ethereum-hwi/setup.py @@ -25,7 +25,7 @@ setup( name="open-aea-ledger-ethereum-hwi", - version="1.43.0.post1", + version="1.43.0.post2", author="Valory AG", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and support for hardware wallet interactions.", @@ -42,7 +42,7 @@ "web3>=6.0.0,<7", "ipfshttpclient==0.8.0a2", "eth-account>=0.8.0,<0.9.0", - "open-aea-ledger-ethereum~=1.43.0.post1", + "open-aea-ledger-ethereum~=1.43.0.post2", "ledgerwallet==0.1.3", "protobuf<4.25.0,>=4.21.6", "construct<=2.10.61", diff --git a/plugins/aea-ledger-ethereum/setup.py b/plugins/aea-ledger-ethereum/setup.py index 22955f93bf..0ccb4828da 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.43.0.post1", + version="1.43.0.post2", 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 e7668a4b1c..a35b690546 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.43.0.post1", + version="1.43.0.post2", author="Valory AG", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and ledger API of Fetch.AI.", @@ -44,7 +44,7 @@ "test_tools/data/*", ] }, - install_requires=["open-aea-ledger-cosmos~=1.43.0.post1"], + install_requires=["open-aea-ledger-cosmos~=1.43.0.post2"], tests_require=["pytest"], entry_points={ "aea.cryptos": ["fetchai = aea_ledger_fetchai:FetchAICrypto"], diff --git a/plugins/aea-ledger-solana/setup.py b/plugins/aea-ledger-solana/setup.py index 46586562c9..f222dbfa95 100644 --- a/plugins/aea-ledger-solana/setup.py +++ b/plugins/aea-ledger-solana/setup.py @@ -25,7 +25,7 @@ setup( name="open-aea-ledger-solana", - version="1.43.0.post1", + version="1.43.0.post2", author="dassy23", license="Apache-2.0", description="Python package wrapping the public and private key cryptography and ledger api of solana.", diff --git a/scripts/install.ps1 b/scripts/install.ps1 index 3fe0e9800b..edd73132b4 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.43.0.post1 --force --no-cache-dir 2>&1 |out-string; + $output=pip install open-aea[all]==1.43.0.post2 --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 7b9441c927..4c1d7dfcce 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.43.0.post1 --force --no-cache-dir) + output=$(pip3 install --user open-aea[all]==1.43.0.post2 --force --no-cache-dir) if [[ $? -ne 0 ]]; then echo "$output" diff --git a/skaffold.yaml b/skaffold.yaml index 1c4997b689..5d10f285cb 100644 --- a/skaffold.yaml +++ b/skaffold.yaml @@ -5,7 +5,7 @@ metadata: build: tagPolicy: envTemplate: - template: "1.43.0.post1" + template: "1.43.0.post2" artifacts: - image: valory/open-aea-develop docker: @@ -24,7 +24,7 @@ profiles: build: tagPolicy: envTemplate: - template: "1.43.0.post1" + template: "1.43.0.post2" artifacts: - image: valory/open-aea-docs docker: diff --git a/user-image/Dockerfile b/user-image/Dockerfile index 84a6a0b376..c88b2b81f0 100644 --- a/user-image/Dockerfile +++ b/user-image/Dockerfile @@ -7,7 +7,7 @@ ENV LANG C.UTF-8 RUN apt update && apt install -y python3.11-dev python3-pip -y && apt autoremove && apt autoclean RUN pip3 install --upgrade pip -RUN pip3 install "open-aea[all]==1.43.0.post1" open-aea-cli-ipfs==1.43.0.post1 +RUN pip3 install "open-aea[all]==1.43.0.post2" open-aea-cli-ipfs==1.43.0.post2 COPY user-image/openssl.cnf /etc/ssl diff --git a/user-image/docker-env.sh b/user-image/docker-env.sh index f9a14c288b..d5ec29050e 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.43.0.post1 +DOCKER_IMAGE_TAG=valory/open-aea-user:1.43.0.post2 # DOCKER_IMAGE_TAG=valory/open-aea-user:latest DOCKER_BUILD_CONTEXT_DIR=..