Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/recover linters #371

Merged
merged 6 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ jobs:
run: sudo npm install -g markdown-spellcheck
- name: Check Docs links and IPFS hashes
run: tox -e check-doc-links-hashes
- name: Check API Docs updated
run: tox -e check-api-docs
Comment on lines +196 to +197
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recovering the check-api-docs

- name: Check spelling
run: tox -e spell-check

Expand Down Expand Up @@ -569,4 +571,4 @@ jobs:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
fail_ci_if_error: false
15 changes: 14 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ignore-patterns=__main__.py,.*_pb2.py,tac.sh,tac_local.sh

[MESSAGES CONTROL]
# Skips after C0209 are temporary
disable=C0103,C0201,C0301,C0302,W0105,W0707,W1202,W1203,R0801,E1136,E0611,C0209,R1710,R1729,C0206,W0237,R1735,W1505,R1732,W1514,R0402,R1714,R1734,W0640,W0621,E0401,R1733
disable=C0103,C0201,C0301,C0302,W0105,W0707,W1202,W1203,R0801,E1136,E0611,C0209,R1710,R1729,C0206,W0237,R1735,R1732,W1514,R0402,R1714,R1734,W0640,R1733

# See here for more options: https://www.codeac.io/documentation/pylint-configuration.html
## Eventually resolve these:
Expand All @@ -21,6 +21,19 @@ disable=C0103,C0201,C0301,C0302,W0105,W0707,W1202,W1203,R0801,E1136,E0611,C0209,
# W0105: pointless-string-statement, # kept as no harm
# R0801: similar lines, # too granular
# W0212: protected-access
# C0209: consider-using-fstring, # kept as no harm
# W1514: unspecified-encoding, # kept as no harm
# R1734: use-list-literal, # kept as no harm
# R1735: use-dict-literal, # kept as no harm
# R1732: consider-using-with
# W0237: arguments-renamed
# R1733: unnecessary-dict-index-lookup
# R1710: inconsistent-return-statements
# R1714: consider-using-in
# R1729: use-a-generator
# R0402: consider-using-from-import
# W0640: cell-var-from-loop
# C0206: consider-using-dict-items
Comment on lines +24 to +36
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these were introduced between pylint 2.6.0 to 2.11.1. Now we have introduced Tomte and making that upgrade, we do not want to change our linter settings so these must be skipped.


[IMPORTS]
ignored-modules=bech32,ecdsa,lru,eth_typing,eth_keys,eth_account,ipfshttpclient,werkzeug,openapi_spec_validator,aiohttp,multidict,yoti_python_sdk,defusedxml,gym,fetch,matplotlib,memory_profiler,numpy,oef,openapi_core,psutil,tensorflow,temper,skimage,web3,aioprometheus,pyaes,Crypto,asn1crypto,cosmpy,google,coverage,pylint,pytest,gitpython,protobuf
Expand Down
2 changes: 1 addition & 1 deletion aea/helpers/async_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def start(self) -> bool:
self._thread = Thread(
target=self._thread_target, name=self.__class__.__name__ # type: ignore # loop was set in set_loop
)
self._thread.setDaemon(True)
self._thread.setDaemon(True) # pylint: disable=deprecated-method
dvilelaf marked this conversation as resolved.
Show resolved Hide resolved
self._thread.start()
self._stop_called = 0
return True
Expand Down
7 changes: 3 additions & 4 deletions docs/api/abstract_agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ None

```python
@abstractmethod
def get_periodic_tasks(
) -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]
def get_periodic_tasks() -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]
```

Get all periodic tasks for agent.
Expand Down Expand Up @@ -154,14 +153,14 @@ List of tuples of callables: handler and coroutine to get a message

```python
@abstractmethod
def exception_handler(exception: Exception,
function: Callable) -> Optional[bool]
def exception_handler(exception: Exception, function: Callable) -> Optional[bool]
```

Handle exception raised during agent main loop execution.

**Arguments**:


- `exception`: exception raised
- `function`: a callable exception raised in.

Expand Down
38 changes: 4 additions & 34 deletions docs/api/aea.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,7 @@ This class implements an autonomous economic agent.
#### `__`init`__`

```python
def __init__(
identity: Identity,
wallet: Wallet,
resources: Resources,
data_dir: str,
loop: Optional[AbstractEventLoop] = None,
period: float = 0.05,
execution_timeout: float = 0,
max_reactions: int = 20,
error_handler_class: Optional[Type[AbstractErrorHandler]] = None,
error_handler_config: Optional[Dict[str, Any]] = None,
decision_maker_handler_class: Optional[
Type[DecisionMakerHandler]] = None,
decision_maker_handler_config: Optional[Dict[str, Any]] = None,
skill_exception_policy: ExceptionPolicyEnum = ExceptionPolicyEnum.
propagate,
connection_exception_policy: ExceptionPolicyEnum = ExceptionPolicyEnum.
propagate,
loop_mode: Optional[str] = None,
runtime_mode: Optional[str] = None,
default_ledger: Optional[str] = None,
currency_denominations: Optional[Dict[str, str]] = None,
default_connection: Optional[PublicId] = None,
default_routing: Optional[Dict[PublicId, PublicId]] = None,
connection_ids: Optional[Collection[PublicId]] = None,
search_service_address: str = DEFAULT_SEARCH_SERVICE_ADDRESS,
storage_uri: Optional[str] = None,
task_manager_mode: Optional[str] = None,
**kwargs: Any) -> None
def __init__(identity: Identity, wallet: Wallet, resources: Resources, data_dir: str, loop: Optional[AbstractEventLoop] = None, period: float = 0.05, execution_timeout: float = 0, max_reactions: int = 20, error_handler_class: Optional[Type[AbstractErrorHandler]] = None, error_handler_config: Optional[Dict[str, Any]] = None, decision_maker_handler_class: Optional[Type[DecisionMakerHandler]] = None, decision_maker_handler_config: Optional[Dict[str, Any]] = None, skill_exception_policy: ExceptionPolicyEnum = ExceptionPolicyEnum.propagate, connection_exception_policy: ExceptionPolicyEnum = ExceptionPolicyEnum.propagate, loop_mode: Optional[str] = None, runtime_mode: Optional[str] = None, default_ledger: Optional[str] = None, currency_denominations: Optional[Dict[str, str]] = None, default_connection: Optional[PublicId] = None, default_routing: Optional[Dict[PublicId, PublicId]] = None, connection_ids: Optional[Collection[PublicId]] = None, search_service_address: str = DEFAULT_SEARCH_SERVICE_ADDRESS, storage_uri: Optional[str] = None, task_manager_mode: Optional[str] = None, **kwargs: Any, ,) -> None
```

Instantiate the agent.
Expand Down Expand Up @@ -201,8 +173,7 @@ None
#### get`_`periodic`_`tasks

```python
def get_periodic_tasks(
) -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]
def get_periodic_tasks() -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]
```

Get all periodic tasks for agent.
Expand Down Expand Up @@ -237,6 +208,7 @@ Handle exception raised during agent main loop execution.

**Arguments**:


- `exception`: exception raised
- `function`: a callable exception raised in.

Expand Down Expand Up @@ -281,9 +253,7 @@ async result for task_id
#### enqueue`_`task

```python
def enqueue_task(func: Callable,
args: Sequence = (),
kwargs: Optional[Dict[str, Any]] = None) -> int
def enqueue_task(func: Callable, args: Sequence = (), kwargs: Optional[Dict[str, Any]] = None) -> int
```

Enqueue a task with the task manager.
Expand Down
Loading