Skip to content

Commit

Permalink
Merge pull request #269 from fetchai/develop
Browse files Browse the repository at this point in the history
Release v0.1.8
  • Loading branch information
DavidMinarsch authored Oct 18, 2019
2 parents e94aac3 + 447a57b commit 9e321f0
Show file tree
Hide file tree
Showing 106 changed files with 3,095 additions and 414 deletions.
8 changes: 8 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,11 @@ Release History
- Adds ledger entities (fetchai and ethereum); creates wallet for ledger entities
- Adds more documentation and fixes old one
- Multiple additional minor fixes and changes

0.1.8 (2019-10-18)
-------------------

- Multiple bug fixes and improvements to gui of cli
- Adds full test coverage on cli
- Improves docs
- Multiple additional minor fixes and changes
2 changes: 1 addition & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pipeline {
stage('Unit Tests: Python 3.7') {

steps {
sh 'tox -e py37 -- --no-integration-tests'
sh 'tox -e py37 -- --no-integration-tests --ci'
}

} // unit tests: python 3.7
Expand Down
3 changes: 1 addition & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@ base58 = "*"
docker = "*"
click = "*"
pyyaml = ">=4.2b1"
click-log = "*"
oef = {index = "test-pypi",version = "==0.6.10"}
colorlog = "*"
jsonschema = "*"
protobuf = "*"
flask = "*"
connexion = {git = "https://github.com/neverpanic/connexion.git", editable = true, ref = "jsonschema-3"}
connexion = {git = "https://github.com/neverpanic/connexion.git",editable = true,ref = "jsonschema-3"}
watchdog = "*"
python-dotenv = "*"
fetchai-ledger-api = "*"
Expand Down
80 changes: 35 additions & 45 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ A framework for autonomous economic agent (AEA) development

## Get started

First, install the package from [pypi](https://pypi.org/project/aea/):
- Create and launch a virtual environment with Python 3.7:

pipenv --python 3.7 && pipenv shell

- Install the package from [pypi](https://pypi.org/project/aea/):

`
pip install aea
`

Then, build your agent as described in the [AEA CLI readme](../master/aea/cli/README.md) or in the [examples](../master/examples).
pip install aea[all]

## Install from Source

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

## Alternatively: Install from Source

### Cloning

This repository contains submodules. Clone with recursive strategy:

Expand All @@ -39,7 +43,7 @@ Or, you can have more control on the installed dependencies by leveraging the se

pip install .[cli]

## Contribute
### Contribute

The following dependency is only relevant if you intend to contribute to the repository:
- the project uses [Google Protocol Buffers](https://developers.google.com/protocol-buffers/) compiler for message serialization. A guide on how to install it is found [here](https://fetchai.github.io/oef-sdk-python/user/install.html#protobuf-compiler).
Expand Down Expand Up @@ -76,5 +80,6 @@ The following steps are only relevant if you intend to contribute to the reposit

- Docs:

* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build --clean` - Build the documentation site.
* `mkdocs serve` - Start the live-reloading docs server on localhost.

To amend the docs, create a new documentation file in `docs/` and add a reference to it in `mkdocs.yml`.
2 changes: 1 addition & 1 deletion aea/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
__title__ = 'aea'
__description__ = 'Autonomous Economic Agent framework'
__url__ = 'https://github.com/fetchai/agents-aea.git'
__version__ = '0.1.7'
__version__ = '0.1.8'
__author__ = 'Fetch.AI Limited'
__license__ = 'Apache 2.0'
__copyright__ = '2019 Fetch.AI Limited'
1 change: 1 addition & 0 deletions aea/aea.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, name: str,
self._decision_maker = DecisionMaker(self.max_reactions, self.outbox)
self._context = AgentContext(self.name,
self.wallet.public_keys,
self.wallet.addresses,
self.outbox,
self.decision_maker.message_queue,
self.decision_maker.ownership_state,
Expand Down
56 changes: 0 additions & 56 deletions aea/cli/README.md

This file was deleted.

10 changes: 5 additions & 5 deletions aea/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from typing import cast

import click
import click_log
from click import pass_context
from jsonschema import ValidationError

Expand All @@ -35,21 +34,21 @@
from aea.cli.common import Context, pass_ctx, logger, _try_to_load_agent_config, DEFAULT_REGISTRY_PATH
from aea.cli.install import install
from aea.cli.list import list as _list
from aea.cli.loggers import simple_verbosity_option
from aea.cli.remove import remove
from aea.cli.run import run
from aea.cli.scaffold import scaffold
from aea.cli.search import search
from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE, AgentConfig
import aea.cli_gui

DEFAULT_CONNECTION = "oef"
DEFAULT_SKILL = "error"


@click.group()
@click.version_option('0.1.0')
@simple_verbosity_option(logger, default="INFO")
@click.pass_context
@click_log.simple_verbosity_option(logger, default="INFO")
def cli(ctx) -> None:
"""Command-line tool for setting up an Autonomous Economic Agent."""
ctx.obj = Context(cwd=".")
Expand Down Expand Up @@ -127,8 +126,9 @@ def freeze(ctx: Context):
@pass_ctx
def gui(ctx: Context):
"""Run the CLI GUI."""
logger.info("Running the GUI.....(press Ctrl+C to exit)")
aea.cli_gui.run()
import aea.cli_gui # pragma: no cover
logger.info("Running the GUI.....(press Ctrl+C to exit)") # pragma: no cover
aea.cli_gui.run() # pragma: no cover


cli.add_command(add)
Expand Down
1 change: 0 additions & 1 deletion aea/cli/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def protocol(click_context, protocol_name):
except ValidationError as e:
logger.error("Protocol configuration file not valid: {}".format(str(e)))
exit(-1)
return

# copy the protocol package into the agent's supported connections.
src = str(Path(os.path.join(registry_path, "protocols", protocol_name)).absolute())
Expand Down
26 changes: 12 additions & 14 deletions aea/cli/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
from typing import Dict, List, cast

import click
import click_log
import jsonschema # type: ignore
from dotenv import load_dotenv

from aea.cli.loggers import default_logging_config
from aea.configurations.base import DEFAULT_AEA_CONFIG_FILE, AgentConfig, SkillConfig, ConnectionConfig, ProtocolConfig, \
DEFAULT_PROTOCOL_CONFIG_FILE, DEFAULT_CONNECTION_CONFIG_FILE, DEFAULT_SKILL_CONFIG_FILE
from aea.configurations.loader import ConfigLoader

logger = logging.getLogger("aea")
logger = click_log.basic_config(logger=logger)
logger = default_logging_config(logger)

DEFAULT_REGISTRY_PATH = "../packages"

Expand Down Expand Up @@ -113,22 +113,20 @@ def _try_to_load_agent_config(ctx: Context):

def _try_to_load_protocols(ctx: Context):
for protocol_name in ctx.agent_config.protocols:
logger.debug("Processing protocol {}".format(protocol_name))
try:
logger.debug("Processing protocol {}".format(protocol_name))
protocol_config = ctx.protocol_loader.load(open(os.path.join("protocols", protocol_name, DEFAULT_PROTOCOL_CONFIG_FILE)))
if protocol_config is None:
logger.debug("Protocol configuration file for protocol {} not found.".format(protocol_name))
exit(-1)

protocol_spec = importlib.util.spec_from_file_location(protocol_name, os.path.join(ctx.agent_config.registry_path, "protocols", protocol_name, "__init__.py"))
if protocol_spec is None:
logger.warning("Protocol not found in registry.")
continue
ctx.protocol_loader.load(open(os.path.join("protocols", protocol_name, DEFAULT_PROTOCOL_CONFIG_FILE)))
except FileNotFoundError:
logger.error("Protocol configuration file for protocol {} not found.".format(protocol_name))
exit(-1)

try:
protocol_spec = importlib.util.spec_from_file_location(protocol_name, os.path.join("protocols", protocol_name, "__init__.py"))
protocol_module = importlib.util.module_from_spec(protocol_spec)
protocol_spec.loader.exec_module(protocol_module) # type: ignore
sys.modules[protocol_spec.name + "_protocol"] = protocol_module
except FileNotFoundError:
logger.error("Protocol {} not found in registry".format(protocol_name))
except Exception:
logger.error("A problem occurred while processing protocol {}.".format(protocol_name))
exit(-1)


Expand Down
3 changes: 2 additions & 1 deletion aea/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ def install(ctx: Context, requirement: Optional[str]):
dependencies = ctx.get_dependencies()

for d in dependencies:
logger.debug("Installing {}...".format(d))
logger.info("Installing {}...".format(d))
try:
subp = subprocess.Popen([sys.executable, "-m", "pip", "install", d])
subp.wait(30.0)
assert subp.returncode == 0
except Exception:
logger.error("An error occurred while installing {}. Stopping...".format(d))
exit(-1)
Loading

0 comments on commit 9e321f0

Please sign in to comment.