Skip to content

Commit

Permalink
Merge pull request #1723 from fetchai/develop
Browse files Browse the repository at this point in the history
Release v0.6.0
  • Loading branch information
DavidMinarsch authored Sep 2, 2020
2 parents 6411fcb + eb9986a commit ec99bc7
Show file tree
Hide file tree
Showing 624 changed files with 21,946 additions and 20,033 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
run: |
tox -e black-check
tox -e flake8
- name: Unused code check
run: tox -e vulture
- name: Static type check
run: tox -e mypy
- name: Golang code style check
Expand Down Expand Up @@ -97,7 +99,7 @@ jobs:
pip install tox
# install IPFS
sudo apt-get install -y wget
wget -O ./go-ipfs.tar.gz https://dist.ipfs.io/go-ipfs/v0.4.23/go-ipfs_v0.4.23_linux-amd64.tar.gz
wget -O ./go-ipfs.tar.gz https://dist.ipfs.io/go-ipfs/v0.6.0/go-ipfs_v0.6.0_linux-amd64.tar.gz
tar xvfz go-ipfs.tar.gz
sudo mv go-ipfs/ipfs /usr/local/bin/ipfs
ipfs init
Expand Down Expand Up @@ -140,7 +142,7 @@ jobs:
sudo apt-get install -y protobuf-compiler
- name: Sync AEA loop integration tests
run: |
tox -e py3.8 -- --aea-loop sync -m 'sync'
tox -e py3.8 -- -m 'sync' # --aea-loop sync
- name: Async integration tests
run: tox -e py3.8 -- -m 'integration and not unstable and not ledger'

Expand Down Expand Up @@ -241,7 +243,7 @@ jobs:
sudo apt-get autoclean
pip install tox
sudo apt-get install -y protobuf-compiler
- name: Unit tests
- name: Unit tests with sync agent loop
run: |
tox -e py3.8 -- --aea-loop sync -m 'not integration and not unstable'
Expand Down Expand Up @@ -277,7 +279,7 @@ jobs:
- integration_checks
- integration_checks_ledger
- platform_checks
- platform_checks_sync_aea_loop
# - platform_checks_sync_aea_loop
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
Expand Down
58 changes: 12 additions & 46 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -1,68 +1,34 @@
[MASTER]
ignore-patterns=serialization.py,message.py,__main__.py,.*_pb2.py,launch.py,transaction.py
ignore-patterns=serialization.py,message.py,__main__.py,.*_pb2.py

[MESSAGES CONTROL]
disable=C0103,C0201,C0330,C0301,C0302,W1202,W1203,W0511,W0107,W0105,W0621,W0235,W0613,W0221,R0902,R0913,R0914,R1720,R1705,R0801,R0904,R0903,R0911,R0912,R0901,R1704,R0916,R1702,R0915,R1710,R1703,R0401
disable=C0103,C0201,C0301,C0302,C0330,W0105,W0107,W1202,W1203,R0902,R0913,R0914,R0801,R0904,R0903,R0911,R0912,R0901,R0916,R1702,R0915

ENABLED:
# W0703: broad-except
# W0212: protected-access
# W0706: try-except-raise
# W0108: unnecessary-lambda
# W0622: redefined-builtin
# W0163: unused-argument
# W0201: attribute-defined-outside-init
# W0222: signature-differs
# W0223: abstract-method
# W0611: unused-import
# W0612: unused-variable
# W1505: deprecated-method
# W0106: expression-not-assigned
# R0201: no-self-use
# R0205: useless-object-inheritance
# R1723: no-else-break
# R1721: unnecessary-comprehension
# R1718: consider-using-set-comprehension
# R1716: chained-comparison
# R1714: consider-using-in
# R0123: literal-comparison
# R1711: useless-return
# R1722: consider-using-sys-exit

## Resolve these:
# R0401: cyclic-import
# W0221: arguments-differ
## Eventually resolve these:
# R0902: too-many-instance-attributes
# R0913: too-many-arguments
# R0914: too-many-locals
# R1720: no-else-raise
# R1705: no-else-return
# R0904: too-many-public-methods
# R0903: too-few-public-methods
# R0911: too-many-return-statements
# R0912: too-many-branches
# R0901: too-many-ancestors
# R1704: redefined-argument-from-local
# R0916: too-many-boolean-expressions
# R1702: too-many-nested-blocks
# R0915: too-many-statements
# R1710: inconsistent-return-statements
# R1703: simplifiable-if-statement
# decide on a logging policy:
# W1202: logging-format-interpolation
# W1203: logging-fstring-interpolation

## Keep the following:
# C0103: invalid-name
# C0201: consider-iterating-dictionary
# C0330: Wrong haning indentation
# http://pylint-messages.wikidot.com/messages:c0301 > Line too long (%s/%s)
# http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module (%s)
# W1202: logging-format-interpolation
# W1203: logging-fstring-interpolation
# W0511: fixme
# W0107: unnecessary-pass
# W0105: pointless-string-statement
# W0621: redefined-outer-name
# W0235: useless-super-delegation
# R0801: similar lines
# C0301: http://pylint-messages.wikidot.com/messages:c0301 > Line too long (%s/%s)
# C0302: http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module (%s)
# C0330: Wrong hanging indentation
# W0105: pointless-string-statement, # kept as no harm
# W0107: unnecessary-pass, # kept as no harm
# R0801: similar lines, # too granular

[IMPORTS]
ignored-modules=aiohttp,defusedxml,gym,fetch,matplotlib,memory_profiler,numpy,oef,openapi_core,psutil,tensorflow,temper,skimage,vyper,web3
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This is the official list of Fetch.AI authors for copyright purposes.
* Yuri Turchenkov <[email protected]> [solarw](https://github.com/solarw)
* Lokman Rahmani <[email protected]> [lrahmani](https://github.com/lrahmani)
* Jiří Vestfál <[email protected]> [MissingNO57](https://github.com/MissingNO57)
* Ed Fitzgerald <[email protected]> [ejfitzgerald](https://github.com/ejfitzgerald)
27 changes: 27 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
# Release History

## 0.6.0 (2020-09-01)

- Makes FetchAICrypto default again
- Bumps web3 dependencies
- Introduces support for arbitrary protocol handling by DM
- Removes custom fields in signing protocol
- Refactors and updates dialogue and dialogues models
- Moves dialogue module to protocols module
- Introduces MultiplexerStatus to collect aggregate connection status
- Moves Address types from mail to common
- Updates FetchAICrypto to work with Agentland
- Fixes circular dependencies in helpers and configurations
- Unifies contract loading with loading mechanism of other packages
- Adds get-multiaddress command to CLI
- Updates helpers scripts
- Introduces MultiInbox to unify internal message handling
- Adds additional linters (eradicate, more pylint options)
- Improves error reporting in libp2p connection
- Replaces all assert statements with proper exceptions
- Adds skill id to envelope context for improved routing
- Refactors IPC pipes
- Refactors core dependencies
- Adds support for multi-page agent configurations
- Adds type field to all package configurations
- Multiple docs updates including additional explanations of contracts usage
- Multiple additional tests and test stability fixes

## 0.5.4 (2020-08-13)

- Adds support for Windows in p2p connections
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ clean-test:
lint:
black aea benchmark examples packages scripts tests
flake8 aea benchmark examples packages scripts tests
vulture aea scripts/whitelist.py --exclude "*_pb2.py"

.PHONY: pylint
pylint:
pylint aea benchmark packages scripts examples/*

.PHONY: security
security:
bandit -s B101 -r aea benchmark examples packages scripts tests
bandit -r aea benchmark examples packages
bandit -s B101 -r tests scripts
safety check -i 37524 -i 38038 -i 37776 -i 38039

.PHONY: static
Expand Down
5 changes: 3 additions & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ bs4 = "==0.0.1"
colorlog = "==4.1.0"
defusedxml = "==0.6.0"
docker = "==4.2.0"
fetch-p2p-api = {index = "https://test.pypi.org/simple/",version = "==0.0.2"}
flake8 = "==3.7.9"
flake8-bugbear = "==20.1.4"
flake8-docstrings = "==1.5.0"
flake8-eradicate = "==0.4.0"
flake8-import-order = "==0.18.1"
gym = "==0.15.6"
ipfshttpclient = "==0.4.12"
ipfshttpclient = "==0.6.1"
liccheck = "==0.4.3"
markdown = ">=3.2.1"
matplotlib = "==3.2.1"
Expand Down Expand Up @@ -52,6 +52,7 @@ requests = "==2.22.0"
safety = "==1.8.5"
sqlalchemy = "==1.3.17"
tox = "==3.15.1"
vulture = "==2.1"
vyper = "==0.1.0b12"

[packages]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ A framework for autonomous economic agent (AEA) development

pip install "aea[all]"

3. Then, build your agent as described in the [docs](https://fetchai.github.io/agents-aea/).
3. Then, build your agent as described in the [docs](https://docs.fetch.ai/aea/).

<p align="center">
<a href="https://www.youtube.com/embed/xpJA4IT5X88">
Expand Down
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.5.4"
__version__ = "0.6.0"
__author__ = "Fetch.AI Limited"
__license__ = "Apache-2.0"
__copyright__ = "2019 Fetch.AI Limited"
125 changes: 125 additions & 0 deletions aea/abstract_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# ------------------------------------------------------------------------------
"""This module contains the interface definition of the abstract agent."""
import datetime
from abc import ABC, abstractmethod, abstractproperty
from typing import Any, Callable, Dict, List, Optional, Tuple

from aea.connections.base import Connection
from aea.mail.base import Envelope


class AbstractAgent(ABC):
"""This class provides an abstract base interface for an agent."""

@abstractproperty
def name(self) -> str:
"""Get agent's name."""

@abstractmethod
def start(self) -> None:
"""
Start the agent.
:return: None
"""

@abstractmethod
def stop(self) -> None:
"""
Stop the agent.
:return: None
"""

@abstractmethod
def setup(self) -> None:
"""
Set up the agent.
:return: None
"""

@abstractmethod
def act(self) -> None:
"""
Perform actions on period.
:return: None
"""

@abstractmethod
def handle_envelope(self, envelope: Envelope) -> None:
"""
Handle an envelope.
:param envelope: the envelope to handle.
:return: None
"""

@abstractmethod
def get_periodic_tasks(
self,
) -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]:
"""
Get all periodic tasks for agent.
:return: dict of callable with period specified
"""

@abstractmethod
def get_message_handlers(self) -> List[Tuple[Callable[[Any], None], Callable]]:
"""
Get handlers with message getters.
:return: List of tuples of callables: handler and coroutine to get a message
"""

@abstractmethod
def get_multiplexer_setup_options(self) -> Optional[Dict]:
"""
Get options to pass to Multiplexer.setup.
:return: dict of kwargs
"""

@abstractproperty
def connections(self) -> List[Connection]:
"""Return list of connections."""

@abstractmethod
def exception_handler(
self, exception: Exception, function: Callable
) -> Optional[bool]:
"""
Handle exception raised during agent main loop execution.
:param exception: exception raised
:param function: a callable exception raised in.
:return: skip exception if True, otherwise re-raise it
"""

@abstractmethod
def teardown(self) -> None:
"""
Tear down the agent.
:return: None
"""
Loading

0 comments on commit ec99bc7

Please sign in to comment.