Skip to content

Commit

Permalink
Merge pull request #2483 from fetchai/develop
Browse files Browse the repository at this point in the history
Release v1.0.1
  • Loading branch information
DavidMinarsch authored May 1, 2021
2 parents 6659920 + 13b1673 commit a45e2e5
Show file tree
Hide file tree
Showing 325 changed files with 20,844 additions and 1,834 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ omit =
packages/fetchai/skills/erc1155_client/*
packages/fetchai/skills/erc1155_deploy/*
packages/fetchai/skills/gym/*
packages/fetchai/skills/registration_aw1/*
packages/fetchai/skills/fipa_dummy_buyer/*
plugins/aea-ledger-cosmos/aea_ledger_cosmos/cosmos.py
38 changes: 35 additions & 3 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ jobs:
run: tox -e package_version_checks
- name: Check package dependencies
run: tox -e package_dependencies_checks
- name: Check generate protocols
run: tox -e check_generate_all_protocols
# - name: Check generate protocols
# run: tox -e check_generate_all_protocols
- name: Generate Documentation
run: tox -e docs

Expand Down Expand Up @@ -207,7 +207,39 @@ jobs:
- name: Check aea dependenices and imports
run: |
tox -e dependencies_check
plugins_install_check:
continue-on-error: False
runs-on: ${{ matrix.sys.os }}
strategy:
matrix:
sys:
- { os: windows-latest, shell: 'msys2 {0}' }
- { os: ubuntu-latest, shell: bash }
- { os: macos-latest, shell: bash }
python_version: [3.6]
timeout-minutes: 10
steps:
- uses: actions/checkout@master
- if: matrix.sys.os == 'windows-latest'
uses: msys2/setup-msys2@v2
- uses: actions/setup-python@master
with:
python-version: ${{ matrix.python_version }}
- name: Install tox
run : |
pip install tox
- name: Check plugin aea-ledger-cosmos
run : |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-cosmos && aea generate-key cosmos && echo aea-ledger-cosmos checked!"
- name: Check plugin aea-ledger-ethereum
run : |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-ethereum && aea generate-key ethereum && echo aea-ledger-ethereum checked!"
- name: Check plugin aea-ledger-fetchai
run : |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-ledger-fetchai && aea generate-key fetchai && echo aea-ledger-fetchai checked!"
- name: Check plugin aea-cli-ipfs
run : |
tox -r -e plugins_env -- sh -c "pip install ./plugins/aea-cli-ipfs && aea ipfs --help && echo aea-cli-ipfs checked!"
protolint:
continue-on-error: False
runs-on: ubuntu-latest
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,5 @@ packages/fetchai/connections/p2p_libp2p/libp2p_node/libp2p_node
!plugins/aea-ledger-fetchai/tests/data/dummy_contract/build

deploy-image/.env

!libs/go/aea_end2end/seller_agent
3 changes: 3 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ install.ps1
pylint
quickstart
CVE-2021-27291
AgentLand
GCloud
p2p
- docs/language-agnostic-definition.md
fetchai
protocol_id
Expand Down
31 changes: 31 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# Release History

## 1.0.1 (2020-04-30)

AEA:
- Fixes wheels issue for Windows
- Fixes password propagation for certificate issuance in `MultiAgentManager`
- Improves error message when local registry not present

AEALite:
- Adds full protocol support
- Adds end-to-end interaction example with AEA (based on `fetchai/fipa` protocol)
- Multiple additional tests and test stability fixes

Packages:
- Fixes multiple bugs in `ERC1155` version of TAC
- Refactors p2p connections for better separation of concerns and maintainability
- Integrates aggregation with simple oracle skill
- Ensures genus and classifications are used in all skills using SOEF
- Extends SOEF connection to implement `oef_search` protocol fully
- Handles SOEF failures in skills
- Adds simple aggregation skills including tests and docs
- Adds tests for registration AW agents
- Adds tests for reconnection logic in p2p connections
- Multiple additional tests and test stability fixes

Docs:
- Extends car park demo with usage guide for AEA manager
- Multiple additional docs updates

Examples:
- Adds TAC deployment example

## 1.0.0 (2020-03-30)

- Improves contributor guide
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ install: clean
.PHONY: dist
dist: clean
python setup.py sdist
python setup.py bdist_wheel
WIN_BUILD_WHEEL=1 python setup.py bdist_wheel --plat-name=win_amd64
WIN_BUILD_WHEEL=1 python setup.py bdist_wheel --plat-name=win32
python setup.py bdist_wheel --plat-name=manylinux1_x86_64
python setup.py bdist_wheel --plat-name=manylinux2014_aarch64
python setup.py bdist_wheel --plat-name=macosx_10_9_x86_64

h := $(shell git rev-parse --abbrev-ref HEAD)

Expand Down Expand Up @@ -150,4 +154,4 @@ protolint:
protolint_install_win:
powershell -command '$$env:GO111MODULE="on"; go get -u -v github.com/yoheimuta/protolint/cmd/protolint@v0.27.0'
protolint_win:
protolint lint -config_path=./protolint.yaml -fix ./aea/mail ./packages/fetchai/protocols
protolint lint -config_path=./protolint.yaml -fix ./aea/mail ./packages/fetchai/protocols
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__ = "1.0.0"
__version__ = "1.0.1"
__author__ = "Fetch.AI Limited"
__license__ = "Apache-2.0"
__copyright__ = "2019 Fetch.AI Limited"
13 changes: 12 additions & 1 deletion aea/cli/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
SkillConfig,
)
from aea.configurations.constants import CONNECTION, CONTRACT, PROTOCOL, SKILL
from aea.exceptions import enforce


@click.group()
Expand All @@ -56,8 +57,18 @@
def add(click_context: click.Context, local: bool, remote: bool) -> None:
"""Add a package to the agent."""
ctx = cast(Context, click_context.obj)
enforce(
not (local and remote), "'local' and 'remote' options are mutually exclusive."
)
if not local and not remote:
try:
ctx.registry_path
except ValueError as e:
click.echo(f"{e}\nTrying remote registry (`--remote`).")
remote = True
is_mixed = not local and not remote
ctx.set_config("is_local", local and not remote)
ctx.set_config("is_mixed", not local and not remote)
ctx.set_config("is_mixed", is_mixed)


@add.command()
Expand Down
34 changes: 27 additions & 7 deletions aea/cli/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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.click_utils import registry_flag
from aea.cli.utils.config import get_or_create_cli_config
from aea.cli.utils.constants import AUTHOR_KEY
from aea.cli.utils.context import Context
Expand All @@ -50,6 +51,7 @@
STATE_UPDATE_PROTOCOL,
VENDOR,
)
from aea.exceptions import enforce
from aea.helpers.base import compute_specifier_from_version
from aea.helpers.io import open_file

Expand All @@ -62,41 +64,61 @@
required=False,
help="Add the author to run `init` before `create` execution.",
)
@click.option("--local", is_flag=True, help="For using local folder.")
@registry_flag(
help_local="For fetching agent from local folder.",
help_remote="For fetching agent from remote registry.",
)
@click.option("--empty", is_flag=True, help="Not adding default dependencies.")
@click.pass_context
def create(
click_context: click.core.Context,
agent_name: str,
author: str,
local: bool,
remote: bool,
empty: bool,
) -> None:
"""Create a new agent."""
ctx = cast(Context, click_context.obj)
create_aea(ctx, agent_name, local, author=author, empty=empty)
create_aea(ctx, agent_name, local, remote, author=author, empty=empty)


@clean_after
def create_aea(
ctx: Context,
agent_name: str,
local: bool,
remote: bool = False, # for backwards compatibility
author: Optional[str] = None,
empty: bool = False,
) -> None:
"""
Create AEA project.
:param ctx: Context object.
:param local: boolean flag for local folder usage.
:param agent_name: agent name.
:param author: optional author name (valid with local=True only).
:param local: boolean flag for local registry usage.
:param remote: boolean flag for remote registry usage.
:param author: optional author name (valid with local=True and remote=False only).
:param empty: optional boolean flag for skip adding default dependencies.
:return: None
:raises: ClickException if an error occurred.
"""
enforce(
not (local and remote), "'local' and 'remote' options are mutually exclusive."
)
if not local and not remote:
try:
ctx.registry_path
except ValueError as e:
click.echo(f"{e}\nTrying remote registry (`--remote`).")
remote = True
is_mixed = not local and not remote
is_local = local and not remote
ctx.set_config("is_local", is_local)
ctx.set_config("is_mixed", is_mixed)

try:
_check_is_parent_folders_are_aea_projects_recursively()
except Exception:
Expand All @@ -105,7 +127,7 @@ def create_aea(
)

if author is not None:
if local:
if is_local:
do_init(author, False, False, False) # pragma: nocover
else:
raise click.ClickException(
Expand Down Expand Up @@ -151,8 +173,6 @@ def create_aea(

if not empty:
click.echo("Adding default packages ...")
if local:
ctx.set_config("is_local", True)
add_item(ctx, PROTOCOL, PublicId.from_str(DEFAULT_PROTOCOL))
add_item(ctx, PROTOCOL, PublicId.from_str(SIGNING_PROTOCOL))
add_item(ctx, PROTOCOL, PublicId.from_str(STATE_UPDATE_PROTOCOL))
Expand Down
13 changes: 12 additions & 1 deletion aea/cli/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ def do_fetch(
enforce(
not (local and remote), "'local' and 'remote' options are mutually exclusive."
)
if not local and not remote:
try:
ctx.registry_path
except ValueError as e:
click.echo(f"{e}\nTrying remote registry (`--remote`).")
remote = True
is_mixed = not local and not remote
ctx.set_config("is_local", local and not remote)
ctx.set_config("is_mixed", is_mixed)
Expand Down Expand Up @@ -131,8 +137,13 @@ def fetch_agent_locally(
:param target_dir: the target directory to which the agent is fetched.
:return: None
"""
try:
registry_path = ctx.registry_path
except ValueError as e:
raise click.ClickException(str(e))

source_path = try_get_item_source_path(
ctx.registry_path, public_id.author, AGENTS, public_id.name
registry_path, public_id.author, AGENTS, public_id.name
)
enforce(
ctx.config.get("is_local") is True or ctx.config.get("is_mixed") is True,
Expand Down
6 changes: 4 additions & 2 deletions aea/cli/issue_certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def issue_certificates(click_context: click.Context, password: Optional[str]) ->
"""Issue certificates for connections that require them."""
ctx = cast(Context, click_context.obj)
agent_config_manager = AgentConfigManager.load(ctx.cwd)
issue_certificates_(ctx.cwd, agent_config_manager, password)
issue_certificates_(ctx.cwd, agent_config_manager, password=password)


def issue_certificates_(
Expand Down Expand Up @@ -124,7 +124,9 @@ def _process_certificate(
connection_private_key_path, path_prefix
)
connection_crypto = crypto_registry.make(
key_identifier, private_key_path=new_connection_private_key_path
key_identifier,
private_key_path=new_connection_private_key_path,
password=password,
)
public_key = connection_crypto.public_key
else:
Expand Down
17 changes: 7 additions & 10 deletions aea/cli/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,26 @@ def _save_agent_locally(ctx: Context, is_mixed: bool = False) -> None:
:return: None
"""
try:
registry_path = ctx.registry_path
except ValueError as e: # pragma: nocover
raise click.ClickException(str(e))
for item_type_plural in (CONNECTIONS, CONTRACTS, PROTOCOLS, SKILLS):
dependencies = getattr(ctx.agent_config, item_type_plural)
for public_id in dependencies:
if is_mixed:
_check_is_item_in_registry_mixed(
PublicId.from_str(str(public_id)),
item_type_plural,
ctx.registry_path,
PublicId.from_str(str(public_id)), item_type_plural, registry_path,
)
else:
_check_is_item_in_local_registry(
PublicId.from_str(str(public_id)),
item_type_plural,
ctx.registry_path,
PublicId.from_str(str(public_id)), item_type_plural, registry_path,
)

item_type_plural = AGENTS

target_dir = try_get_item_target_path(
ctx.registry_path,
ctx.agent_config.author,
item_type_plural,
ctx.agent_config.name,
registry_path, ctx.agent_config.author, item_type_plural, ctx.agent_config.name,
)
if not os.path.exists(target_dir):
os.makedirs(target_dir, exist_ok=True)
Expand Down
6 changes: 5 additions & 1 deletion aea/cli/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,12 @@ def _save_item_locally(ctx: Context, item_type: str, item_id: PublicId) -> None:

check_package_public_id(source_path, item_type, item_id)

try:
registry_path = ctx.registry_path
except ValueError as e: # pragma: nocover
raise click.ClickException(str(e))
target_path = try_get_item_target_path(
ctx.registry_path, ctx.agent_config.author, item_type_plural, item_id.name,
registry_path, ctx.agent_config.author, item_type_plural, item_id.name,
)
copytree(source_path, target_path)
click.echo(
Expand Down
6 changes: 5 additions & 1 deletion aea/cli/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,14 @@ def _search_items_locally(ctx: Context, item_type_plural: str) -> List[Dict]:
result,
)

try:
registry_path = ctx.registry_path
except ValueError as e: # pragma: nocover
raise click.ClickException(str(e))
# look in packages dir for all other packages
_get_details_from_dir(
cast(ConfigLoader, configs[item_type_plural]["loader"]),
ctx.registry_path,
registry_path,
"*/{}".format(item_type_plural),
cast(str, configs[item_type_plural]["config_file"]),
result,
Expand Down
2 changes: 1 addition & 1 deletion aea/cli/utils/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def registry_path(self) -> str:
if registry_path.is_dir():
return str(registry_path)
raise ValueError(
f"Registry path not provided and `{DEFAULT_REGISTRY_NAME}` not found in current ({self.cwd}) and parent directory."
f"Registry path not provided and local registry `{DEFAULT_REGISTRY_NAME}` not found in current ({self.cwd}) and parent directory."
)

@property
Expand Down
Loading

0 comments on commit a45e2e5

Please sign in to comment.