Skip to content

Commit

Permalink
Merge pull request #2429 from fetchai/develop
Browse files Browse the repository at this point in the history
Release v1.0.0
  • Loading branch information
DavidMinarsch authored Mar 30, 2021
2 parents 3d7a775 + 321b1a1 commit 6659920
Show file tree
Hide file tree
Showing 383 changed files with 3,396 additions and 3,127 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- AEA Version [e.g. 0.11.0]
- AEA Version [e.g. 1.0.0]

**Additional context**
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ _Put an `x` in the boxes that apply._
- [ ] I bumped the version number in the `aea/__version__.py` file.
- [ ] I bumped the version number in every Docker image of the repo and published it. Also, I built and published them with tag `latest`
(check the READMEs of [`aea-develop`](../develop-image/README.md#publish)
and [`aea-deploy`](../deploy-image/README.md#publish))
and [`aea-user`](../user-image/README.md#publish))
- [ ] I have pushed the latest packages to the registry.
- [ ] I have uploaded the latest `aea` to PyPI.
- [ ] I have uploaded the latest plugins to PyPI.
Expand Down
13 changes: 7 additions & 6 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,21 @@
ignore-patterns=__main__.py,.*_pb2.py,tac.sh,tac_local.sh

[MESSAGES CONTROL]
disable=C0103,C0201,C0301,C0302,E1136,W0105,W0707,W1202,W1203,R0801
disable=C0103,C0201,C0301,C0302,W0105,W0707,W1202,W1203,R0801

# See here for more options: https://www.codeac.io/documentation/pylint-configuration.html
## Eventually resolve these:
# W0707: raise-missing-from
# decide on a logging policy:

## Eventually decide on a logging policy:
# W1202: logging-format-interpolation
# W1203: logging-fstring-interpolation

## Keep the following:
# C0103: invalid-name
# C0201: consider-iterating-dictionary
# 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)
# C0103: invalid-name, # kept as no harm
# C0201: consider-iterating-dictionary, # kept as no harm
# C0301: http://pylint-messages.wikidot.com/messages:c0301 > Line too long (%s/%s), # kept as no harm
# C0302: http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module (%s) , # kept as no harm
# W0105: pointless-string-statement, # kept as no harm
# R0801: similar lines, # too granular

Expand Down
4 changes: 4 additions & 0 deletions .spelling
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ Perun
1.0.0rc1
docstrings
1.0.0rc2
install.ps1
pylint
quickstart
CVE-2021-27291
- docs/language-agnostic-definition.md
fetchai
protocol_id
Expand Down
88 changes: 84 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,90 @@
# Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.
Contributions to the framework, its plugins, related tools and packages are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

If you need support, want to report/fix a bug, ask for/implement features, you can check the
[Issues page](https://github.com/fetchai/agents-aea/issues)
or [submit a Pull request](https://github.com/fetchai/agents-aea/pulls)
There are various ways to contribute:

- If you need support, want to report a bug or ask for features, you can check the [Issues page](https://github.com/fetchai/agents-aea/issues) and raise an issue, if applicable.

- If you would like to contribute a bug fix of feature then [submit a Pull request](https://github.com/fetchai/agents-aea/pulls).

For other kinds of feedback, you can contact one of the
[authors](https://github.com/fetchai/agents-aea/blob/main/AUTHORS.md) by email.

Before reading on, please have a look at the [code of conduct](https://github.com/fetchai/agents-aea/blob/main/CODE_OF_CONDUCT.md).

## A few simple rules

- All Pull Requests should be opened against the `develop` branch. Do **not** open a Pull Request against `main`!

- Before working on a feature, reach out to one of the core developers or discuss the feature in an issue. The framework caters a diverse audience and new features require upfront coordination.

- Include unit tests for 100% coverage when you contribute new features, as they help to a) prove that your code works correctly, and b) guard against future breaking changes to lower the maintenance cost.

- Bug fixes also generally require unit tests, because the presence of bugs usually indicates insufficient test coverage.

- Keep API compatibility in mind when you change code in the `aea`. The `aea` has passed version 1.0 and hence cannot make non-backward-compatible API changes without a major release. Reviewers of your pull request will comment on any API compatibility issues.

- When you contribute a new feature to `aea`, the maintenance burden is transferred to the core team. This means that the benefit of the contribution must be compared against the cost of maintaining the feature.

- Where possible, add new functionality via plugins. Currently, CLI and ledger plugins are supported. Furthermore, the `aea` native packages also allow for extensibility.

- All files must include a license header.

- Before committing and opening a PR, run all tests locally. This saves CI hours and ensures you only commit clean code.

## Contributing code

If you have improvements, send us your pull requests!

A team member will be assigned to review your pull requests. All tests are run as part of CI as well as various other checks (linters, static type checkers, security checkers, etc). If there are any problems, feedback is provided via GitHub. Once the pull requests is approved and passes continuous integration checks, you or a team member can merge it.

If you want to contribute, start working through the codebase, navigate to the Github "issues" tab and start looking through interesting issues. If you are not sure of where to start, then start by trying one of the smaller/easier issues here i.e. issues with the "good first issue" label and then take a look at the issues with the "contributions welcome" label. These are issues that we believe are particularly well suited for outside contributions, often because we probably won't get to them right now. If you decide to start on an issue, leave a comment so that other people know that you're working on it. If you want to help out, but not alone, use the issue comment thread to coordinate.

## Development setup

First, setup your environment by either using the `develop-image` or by following these steps:

- The simplest way to get setup for development on the framework is to install Python `>=3.6` and `pipenv`, then run the following:

make new_env
pipenv shell

- 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).

## Further commands needed during development

We have various commands which are helpful during development.

- For linting and static analysis use:

make lint
make static
make pylint
make security

- For checking packages integrity:

make package_checks

- To run tests: `make test`.

- For testing `aea.{SUBMODULE}` with `tests/test_{TESTMODULE}` use:

make dir={SUBMODULE} tdir={TESTMODULE} test-sub

e.g.

make dir=cli tdir=cli test-sub

- When making changes to one of the `packages`, then use `python scripts/generate_ipfs_hashes.py` to generate the latest hashes.

### Go Development

- The `fetchai/p2p_libp2p` package is partially developed in Go.

- To install Go visit the [Golang site](https://golang.org/doc/install).

- We use [`golines`](https://github.com/segmentio/golines) and [`golangci-lint`](https://golangci-lint.run) for linting.

- To run tests, use `go test -p 1 -timeout 0 -count 1 -v ./...` from the root directory of the package. If you experience installation or build issues run `go clean -modcache`.
14 changes: 14 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Release History

## 1.0.0 (2020-03-30)

- Improves contributor guide
- Enables additional pylint checks
- Adds configuration support on exception behaviour in ledger plugins
- Improves exception handling in `aea-ledger-cosmos` and `aea-ledger-fetchai` plugins
- Improves quickstart guide
- Fixes multiple flaky tests
- Fixes various outdated metadata
- Resolves a CVE (CVE-2021-27291) affecting development dependencies
- Adds end-to-end support and tests for simple oracle on Ethereum and Fetch.ai ledgers
- Multiple minor fixes
- Multiple additional tests and test stability fixes

## 1.0.0rc2 (2020-03-28)

- Extends CLI command `aea fingerprint` to allow fingerprinting of agents
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ clean-build:
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -fr {} +
rm -fr Pipfile.lock
rm -rf plugins/*/build
rm -rf plugins/*/dist

.PHONY: clean-docs
clean-docs:
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ psutil = "==5.7.0"
pycryptodome = ">=3.10.1"
pydoc-markdown = "==3.3.0"
pydocstyle = "==3.0.0"
pygments = "==2.5.2"
pygments = "==2.7.4"
pylint = "==2.6.0"
pymdown-extensions = "==6.3"
pytest = "==5.4.3"
Expand Down
82 changes: 9 additions & 73 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ A framework for autonomous economic agent (AEA) development
<img src="/data/aea.png?raw=true" alt="AEA Description" width="70%"/>
</p>

## Get started
## Get started developing AEAs

1. Create and launch a clean virtual environment with Python 3.7 (any Python `>=` 3.6 works):

Expand All @@ -73,7 +73,7 @@ A framework for autonomous economic agent (AEA) development
</a>
</p>

## Alternatively: Use `pipx` (CLI usage only)
## Alternatively (1): Use `pipx` (CLI usage only)

1. Install [pipx](https://github.com/pipxproject/pipx)

Expand All @@ -85,7 +85,7 @@ A framework for autonomous economic agent (AEA) development

aea --help

## Alternatively: Install from Source
## Alternatively (2): Install from Source

This approach is not recommended!

Expand Down Expand Up @@ -121,82 +121,18 @@ You can have more control on the installed dependencies by leveraging the setupt

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

## Contribute
## Documentation

The following dependency is **only relevant if you intend to contribute** to the repository:

- All Pull Requests should be opened against the `develop` branch. Do **not** open a Pull Request against `main`!

- 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).

The following steps are **only relevant if you intend to contribute** to the repository. They are **not required** for agent development.

### Recommended commands

- The simplest way to get setup for development on the framework is to run the following:

make new_env
pipenv shell

- For linting and static analysis use:

make lint
make static
make pylint
make security

- For checking packages integrity:

make package_checks

- For testing `aea.{SUBMODULE}` with `tests/test_{TESTMODULE}` use:

make dir={SUBMODULE} tdir={TESTMODULE} test-sub

e.g.

make dir=cli tdir=cli test-sub

### Alternative commands

- To install development dependencies manually (here optionally skipping `Pipfile.lock` creation):

pipenv install --dev --skip-lock

- To install the package from source in development mode:

pip install -e .[all]

Of, if you use `zsh` rather than `bash`:

pip install -e ".[all]"

- To run tests: `tox -e py3.7` or `make test`. To only test specific modules try `make dir=PATH_TO_MODULE tdir=PATH_TO_TESTS test-sub` where (e.g. `make dir=cli tdir=cli test-sub`).

- To run linters (code style checks) and code formatters: `tox -e flake8` and `tox -e black` and ` tox -e isort` or `make lint`

- To run static type checks: `tox -e mypy` or `make static`

- To run `pylint`: `tox -e pylint` or `make pylint`

- To run security checks: `tox -e bandit` and `tox -e safety` or `make security`

### Go Development

- The `fetchai/p2p_libp2p` package is partially developed in Go.

- To install Go visit the [Golang site](https://golang.org/doc/install).

- We use [`golines`](https://github.com/segmentio/golines) and [`golangci-lint`](https://golangci-lint.run) for linting.

- To run tests, use `go test -p 1 -timeout 0 -count 1 -v ./...` from the root directory of the package. If you experience installation or build issues run `go clean -modcache`.

### Documentation
- All documentation is hosted [here](https://docs.fetch.ai/aea).

- To start a live-reloading docs server on localhost: `mkdocs serve`. To amend the docs, create a new documentation file in `docs/` and add a reference to it in `mkdocs.yml`.

- To run demos against local packages use flag `--local` in `aea` CLI commands.

## Contributing

We welcome contributions to the framework, its plugins, related tools and packages. Please consult the [contributing guide](https://github.com/fetchai/agents-aea/blob/main/CONTRIBUTING.md) for details.

## Cite

If you are using our software in a publication, please
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The following table shows which versions of `aea` are currently being supported
| Version | Supported |
| --------- | ------------------ |
| `1.0.x` | :white_check_mark: |
| `< 1.0.0rc2` | :x: |
| `< 1.0.0` | :x: |

## Reporting a Vulnerability

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__ = "1.0.0rc2"
__version__ = "1.0.0"
__author__ = "Fetch.AI Limited"
__license__ = "Apache-2.0"
__copyright__ = "2019 Fetch.AI Limited"
6 changes: 3 additions & 3 deletions aea/aea_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1254,8 +1254,8 @@ def _build_identity_from_wallet(self, wallet: Wallet) -> Identity:
)
return identity

def _process_connection_ids(
self, connection_ids: Optional[Collection[PublicId]] = None
def _process_connection_ids( # pylint: disable=unsubscriptable-object
self, connection_ids: Optional[Collection[PublicId]] = None,
) -> List[PublicId]:
"""
Process connection ids.
Expand Down Expand Up @@ -1317,7 +1317,7 @@ def install_pypi_dependencies(self) -> None:
"""Install components extra dependencies."""
self._package_dependency_manager.install_dependencies()

def build(
def build( # pylint: disable=unsubscriptable-object
self,
connection_ids: Optional[Collection[PublicId]] = None,
password: Optional[str] = None,
Expand Down
4 changes: 1 addition & 3 deletions aea/cli/add_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ def _add_private_key(

key_file_argument.convert(file, None, click_context)
try:
try_validate_private_key_path(
type_, file, password=password, exit_on_error=False
)
try_validate_private_key_path(type_, file, password=password)
except Exception as e:
raise click.ClickException(repr(e)) from e
_try_add_key(ctx, type_, file, connection)
Expand Down
8 changes: 1 addition & 7 deletions aea/cli/utils/package_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import os
import re
import shutil
import sys
from pathlib import Path
from typing import Any, Dict, Optional, Set, Tuple

Expand Down Expand Up @@ -78,10 +77,7 @@


def verify_private_keys_ctx(
ctx: Context,
aea_project_path: Path = ROOT,
exit_on_error: bool = False,
password: Optional[str] = None,
ctx: Context, aea_project_path: Path = ROOT, password: Optional[str] = None,
) -> None:
"""
Verify private keys with ctx provided.
Expand All @@ -104,8 +100,6 @@ def verify_private_keys_ctx(
if ctx is not None:
ctx.agent_config = agent_config
except ValueError as e: # pragma: nocover
if exit_on_error:
sys.exit(1)
raise click.ClickException(str(e))


Expand Down
2 changes: 1 addition & 1 deletion aea/components/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def load_aea_package(configuration: ComponentConfiguration) -> None:
# this handles the case when 'subpackage_init_file'
# is path/to/package/__init__.py
import_path = prefix_pkg
else:
else: # pragma: nocover
import_path = prefix_pkg + "." + ".".join(relative_parent_dir.parts)

spec = importlib.util.spec_from_file_location(import_path, subpackage_init_file)
Expand Down
Loading

0 comments on commit 6659920

Please sign in to comment.