Skip to content

Commit

Permalink
Merge pull request #2188 from fetchai/develop
Browse files Browse the repository at this point in the history
Release v0.9.2
  • Loading branch information
DavidMinarsch authored Jan 22, 2021
2 parents ef78677 + 6383006 commit e8ba780
Show file tree
Hide file tree
Showing 86 changed files with 1,264 additions and 578 deletions.
3 changes: 3 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,11 @@ BibTex
Kubernetes
Golang
web3
CosmWasm
Shoham
- docs/language-agnostic-definition.md
fetchai
protocol_id
- docs/simple-oef.md
_do_
CosmWasm
12 changes: 12 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Release History

## 0.9.2 (2020-01-21)

- Fixes `CosmosApi`, in particular for CosmWasm
- Fixes error output from `add-key` CLI command
- Update `aea_version` in non-vendor packages when calling `upgrade` CLI command
- Extend `upgrade` command to fetch newer agent if present on registry
- Add support for mixed fetch mode in `MultiAgentManager`
- Fixes logging overrides in `MultiAgentManager`
- Configuration overrides now properly handle `None` values
- Multiple docs updates based on user feedback
- Multiple additional tests and test stability fixes

## 0.9.1 (2020-01-14)

- Fixes multiple issues with `MultiAgentManager` including overrides not being correctly applied
Expand Down
7 changes: 7 additions & 0 deletions aea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import inspect
import os

from packaging.version import Version

import aea.crypto # triggers registry population
from aea.__version__ import (
__author__,
Expand All @@ -35,3 +37,8 @@


AEA_DIR = os.path.dirname(inspect.getfile(inspect.currentframe())) # type: ignore


def get_current_aea_version() -> Version:
"""Get current version."""
return Version(__version__)
2 changes: 1 addition & 1 deletion aea/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
__title__ = "aea"
__description__ = "Autonomous Economic Agent framework"
__url__ = "https://github.com/fetchai/agents-aea.git"
__version__ = "0.9.1"
__version__ = "0.9.2"
__author__ = "Fetch.AI Limited"
__license__ = "Apache-2.0"
__copyright__ = "2019 Fetch.AI Limited"
21 changes: 20 additions & 1 deletion aea/aea_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
DEFAULT_CONNECTION,
DEFAULT_ENV_DOTFILE,
DEFAULT_LEDGER,
DEFAULT_LOGGING_CONFIG,
DEFAULT_PROTOCOL,
DEFAULT_REGISTRY_NAME,
)
Expand Down Expand Up @@ -381,6 +382,7 @@ def _reset(self, is_full_reset: bool = False) -> None:
self._runtime_mode: Optional[str] = None
self._search_service_address: Optional[str] = None
self._storage_uri: Optional[str] = None
self._logging_config: Dict = DEFAULT_LOGGING_CONFIG

self._package_dependency_manager = _DependenciesManager()
if self._with_default_packages:
Expand Down Expand Up @@ -562,6 +564,22 @@ def set_storage_uri(
self._storage_uri = storage_uri
return self

def set_logging_config(
self, logging_config: Dict
) -> "AEABuilder": # pragma: nocover
"""
Set the logging configurations.
The dictionary must satisfy the following schema:
https://docs.python.org/3/library/logging.config.html#logging-config-dictschema
:param logging_config: the logging configurations.
:return: self
"""
self._logging_config = logging_config
return self

def set_search_service_address(
self, search_service_address: str
) -> "AEABuilder": # pragma: nocover
Expand Down Expand Up @@ -1100,6 +1118,7 @@ def build(self, connection_ids: Optional[Collection[PublicId]] = None,) -> AEA:
:raises ValueError: if we cannot
"""
self._check_we_can_build()
logging.config.dictConfig(self._logging_config)
wallet = Wallet(
copy(self.private_key_paths), copy(self.connection_private_key_paths)
)
Expand Down Expand Up @@ -1454,6 +1473,7 @@ def set_from_configuration(
self.set_loop_mode(agent_configuration.loop_mode)
self.set_runtime_mode(agent_configuration.runtime_mode)
self.set_storage_uri(agent_configuration.storage_uri)
self.set_logging_config(agent_configuration.logging_config)

# load private keys
for (
Expand Down Expand Up @@ -1561,7 +1581,6 @@ def from_aea_project(
"""
aea_project_path = Path(aea_project_path)
cls.try_to_load_agent_configuration_file(aea_project_path)

load_env_file(str(aea_project_path / DEFAULT_ENV_DOTFILE))

# check and create missing, do not replace env variables. updates config
Expand Down
13 changes: 9 additions & 4 deletions aea/cli/add_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@
from aea.crypto.registries import crypto_registry


key_file_argument = click.Path(
exists=True, file_okay=True, dir_okay=False, readable=True
)


@click.command()
@click.argument(
"type_",
Expand All @@ -42,10 +47,7 @@
required=True,
)
@click.argument(
"file",
metavar="FILE",
type=click.Path(exists=True, file_okay=True, dir_okay=False, readable=True),
required=False,
"file", metavar="FILE", type=key_file_argument, required=False,
)
@click.option(
"--connection", is_flag=True, help="For adding a private key for connections."
Expand Down Expand Up @@ -76,6 +78,9 @@ def _add_private_key(
ctx = cast(Context, click_context.obj)
if file is None:
file = PRIVATE_KEY_PATH_SCHEMA.format(type_)

key_file_argument.convert(file, None, click_context)

try_validate_private_key_path(type_, file)
_try_add_key(ctx, type_, file, connection)

Expand Down
5 changes: 2 additions & 3 deletions aea/cli/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
from typing import Optional, cast

import click
from packaging.version import Version

import aea
from aea import get_current_aea_version
from aea.cli.add import add_item
from aea.cli.init import do_init
from aea.cli.utils.config import get_or_create_cli_config
Expand Down Expand Up @@ -179,7 +178,7 @@ def _crete_agent_config(ctx: Context, agent_name: str, set_author: str) -> Agent
"""
agent_config = AgentConfig(
agent_name=agent_name,
aea_version=compute_specifier_from_version(Version(aea.__version__)),
aea_version=compute_specifier_from_version(get_current_aea_version()),
author=set_author,
version=DEFAULT_VERSION,
license_=DEFAULT_LICENSE,
Expand Down
31 changes: 28 additions & 3 deletions aea/cli/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,40 @@
def fetch(click_context, public_id, alias, local, remote):
"""Fetch an agent from the registry."""
ctx = cast(Context, click_context.obj)
do_fetch(ctx, public_id, local, remote, alias)


def do_fetch(
ctx: Context,
public_id: PublicId,
local: bool,
remote: bool,
alias: Optional[str] = None,
target_dir: Optional[str] = None,
):
"""
Run the Fetch command.
:param ctx: the CLI context.
:param public_id: the public id.
:param local: whether to fetch from local
:param remote whether to fetch from remote
:param alias: the agent alias.
:param target_dir: the target directory, in case fetching locally.
:return: None
"""
enforce(
not (local and remote), "'local' and 'remote' options are mutually exclusive."
)
is_mixed = not local and not remote
ctx.set_config("is_local", local and not remote)
ctx.set_config("is_mixed", is_mixed)
if remote:
fetch_agent(ctx, public_id, alias)
fetch_agent(ctx, public_id, alias=alias, target_dir=target_dir)
elif local:
fetch_agent_locally(ctx, public_id, alias)
fetch_agent_locally(ctx, public_id, alias=alias, target_dir=target_dir)
else:
fetch_mixed(ctx, public_id, alias)
fetch_mixed(ctx, public_id, alias=alias, target_dir=target_dir)


def _is_version_correct(ctx: Context, agent_public_id: PublicId) -> bool:
Expand Down
Loading

0 comments on commit e8ba780

Please sign in to comment.