Skip to content

Commit

Permalink
Merge pull request #268 from valory-xyz/fix/linters
Browse files Browse the repository at this point in the history
Fix/linters
  • Loading branch information
0xArdi authored Nov 22, 2024
2 parents cd1cf45 + 732f2ef commit fd86736
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .gitleaksignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,5 @@ eecbf34a242377fb07d28230cf11ea43fb07de8d:packages/valory/skills/task_execution/s
d7f9fd6ad8bcf9ea2bf14bf3de221971ddb56268:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
c0dee637e3d520b9706e91db197e859ca5fce23a:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
c0aaf1331142b5e804d41ebe1a17be19b6014eb4:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
bead325392d69c64be89a862c92134e5b8663832:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
bead325392d69c64be89a862c92134e5b8663832:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
0d067561292282eee8a0b8036daeafba0eaa7734:packages/valory/skills/task_execution/skill.yaml:generic-api-key:15
12 changes: 6 additions & 6 deletions packages/packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
"contract/valory/mech_marketplace/0.1.0": "bafybeigulghv7bvx4evl6kmogvv6gjxovyt22tkwlbdmeretmop2crdmem",
"connection/valory/websocket_client/0.1.0": "bafybeic4ag3gqc7kd3k2o3pucddj2odck5yrfbgmwh5veqny7zao5qayli",
"skill/valory/contract_subscription/0.1.0": "bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy",
"skill/valory/mech_abci/0.1.0": "bafybeibqrc3k3f5ozjzoe46p3tpsuwifn44xhhxlcigtx6hv6ozkbfaaoi",
"skill/valory/task_submission_abci/0.1.0": "bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e",
"skill/valory/task_execution/0.1.0": "bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q",
"skill/valory/mech_abci/0.1.0": "bafybeihshsjc2pngbaglptgeijgpcd6ns7darhhp75ryhfao5t4uuw3hym",
"skill/valory/task_submission_abci/0.1.0": "bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy",
"skill/valory/task_execution/0.1.0": "bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm",
"skill/valory/websocket_client/0.1.0": "bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m",
"skill/valory/subscription_abci/0.1.0": "bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq",
"agent/valory/mech/0.1.0": "bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324",
"service/valory/mech/0.1.0": "bafybeifai4fbkcxrljyko4jqqibaetg7npc3etksntu4tnnwazifodghgu",
"service/valory/mech_quickstart/0.1.0": "bafybeig544gw6i7ahlwj6d64djlwfltjuznz3p66kmwk4m6bzqtn2bjfbq"
"agent/valory/mech/0.1.0": "bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4",
"service/valory/mech/0.1.0": "bafybeic7hnfs3gum33ndinhyzablfa4yf5y4lkvivuxg4bgvhz5zdxn6oa",
"service/valory/mech_quickstart/0.1.0": "bafybeiezswb5cbhuauk23kd6gsdbwnp2ndjysgc4uabk44k3vy2lmwz5mu"
},
"third_party": {
"protocol/valory/default/1.0.0": "bafybeifqcqy5hfbnd7fjv4mqdjrtujh2vx3p2xhe33y67zoxa6ph7wdpaq",
Expand Down
6 changes: 3 additions & 3 deletions packages/valory/agents/mech/aea-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ skills:
- valory/abstract_abci:0.1.0:bafybeieo7pe5wqjphs5izpz5aujjbubymlxub62b3rhx6yglu65ibalffu
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/contract_subscription:0.1.0:bafybeiefuemlp75obgpxrp6iuleb3hn6vcviwh5oetk5djbuprf4xsmgjy
- valory/mech_abci:0.1.0:bafybeibqrc3k3f5ozjzoe46p3tpsuwifn44xhhxlcigtx6hv6ozkbfaaoi
- valory/mech_abci:0.1.0:bafybeihshsjc2pngbaglptgeijgpcd6ns7darhhp75ryhfao5t4uuw3hym
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
- valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e
- valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq
- valory/task_execution:0.1.0:bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q
- valory/task_submission_abci:0.1.0:bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e
- valory/task_execution:0.1.0:bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm
- valory/task_submission_abci:0.1.0:bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/websocket_client:0.1.0:bafybeif7rrvsu6z4evqkhblxj3u6wwv2eqou576hgkyoehxuj7cntw7o2m
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/mech/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeif7ia4jdlazy6745ke2k2x5yoqlwsgwr6sbztbgqtwvs3ndm2p7ba
fingerprint_ignore_patterns: []
agent: valory/mech:0.1.0:bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324
agent: valory/mech:0.1.0:bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4
number_of_agents: 4
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/services/mech_quickstart/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license: Apache-2.0
fingerprint:
README.md: bafybeiaqaedhfzjxxdfxtygjulorvd4x2h3cbwtiw3xgbigjgsc6qfn7zy
fingerprint_ignore_patterns: []
agent: valory/mech:0.1.0:bafybeicg5ioivs2ryaim6uf3cws2ashc5ldxtrvxgbjbhv3y2ic63qx324
agent: valory/mech:0.1.0:bafybeifvo3s5mjidovenei6wwozejatfh4kjcapqnipuou4q3v6ff6ycl4
number_of_agents: 1
deployment:
agent:
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/mech_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ skills:
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/registration_abci:0.1.0:bafybeib3n6vqkfbrcubcbliebjnuwyywdinxkbzt76n6gbn2kg7ace47dq
- valory/reset_pause_abci:0.1.0:bafybeihkj6lmaypspyxe5qqrjgnolyck62pyvqoylr24ab6ue4steqcw7e
- valory/task_submission_abci:0.1.0:bafybeibecej5hkjzm4f2vteklafkxlb2h5ov7t7u6ydiuleljhe6slnz7e
- valory/task_submission_abci:0.1.0:bafybeihzghxmvmylj2gehkfbleek5e6q3qyggfmnpve2sov437nyzvu5gy
- valory/termination_abci:0.1.0:bafybeifi2uodnrjsrivj53g3sjutocmyusbx6mlsb6oanqdyt2mfbyvusy
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/subscription_abci:0.1.0:bafybeifilanuxfvuypcccjku7nphurgp27i2iwncdmug3in6xuzfmslgaq
Expand Down
11 changes: 8 additions & 3 deletions packages/valory/skills/task_execution/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ def _handle_timeout_task(self) -> None:
def _safely_get_task_data(self, message: IpfsMessage) -> Optional[Dict[str, Any]]:
"""Safely get task data."""
try:
[json.loads(content) for content in message.files.values()][0]
task_data = [json.loads(content) for content in message.files.values()][0]
return task_data
except Exception as e: # pylint: disable=broad-except
self.context.logger.error(
f"Exception raised while decoding task data: {str(e)}"
Expand All @@ -436,9 +437,13 @@ def _handle_get_task(self, message: IpfsMessage, dialogue: Dialogue) -> None:
and "prompt" in task_data
and "tool" in task_data
) # pylint: disable=C0301
if is_data_valid and task_data["tool"] in self._tools_to_package_hash:
if (
is_data_valid
and task_data is not None
and task_data["tool"] in self._tools_to_package_hash
):
self._prepare_task(task_data)
elif is_data_valid:
elif is_data_valid and task_data is not None:
tool = task_data["tool"]
executing_task = cast(Dict[str, Any], self._executing_task)
executing_task["tool"] = tool
Expand Down
2 changes: 1 addition & 1 deletion packages/valory/skills/task_execution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""This module contains the shared state for the abci skill of Mech."""
import dataclasses
from collections import defaultdict
from typing import Any, Callable, Dict, Optional, List
from typing import Any, Callable, Dict, List, Optional

from aea.exceptions import enforce
from aea.skills.base import Model
Expand Down
6 changes: 4 additions & 2 deletions packages/valory/skills/task_execution/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeidqhvvlnthkbnmrdkdeyjyx2f2ab6z4xdgmagh7welqnh2v6wczx4
behaviours.py: bafybeiexshowozpbzuomhezg3a5b2re77ikidjkiy3fov2tsfiqyk6dmwe
behaviours.py: bafybeihuja3eox24bl7kyym2hbyrkuktkhso5s7yt3cvrjn7ng73bzvvga
dialogues.py: bafybeid4zxalqdlo5mw4yfbuf34hx4jp5ay5z6chm4zviwu4cj7fudtwca
handlers.py: bafybeidbt5ezj74cgfogk3w4uw4si2grlnk5g54veyumw7g5yh6gdscywu
models.py: bafybeibsnirbekd7ondvm2lkrabm5wxzwsl6xkf2ccmrbfugkz4cola77u
models.py: bafybeicohoprd4f6rxnt6zxgwzzb3djpyk4o72bepoty4lybnf7fdpkgbu
utils/__init__.py: bafybeiccdijaigu6e5p2iruwo5mkk224o7ywedc7nr6xeu5fpmhjqgk24e
utils/apis.py: bafybeigu73lfz3g3mc6iupisrvlsp3fyl4du3oqlyajgdpfvtqypddh3w4
utils/benchmarks.py: bafybeiafnee7iay6dyjnatyqyzjov5c4ibl3ojamjmgfjri7cyghl7qayq
Expand Down Expand Up @@ -92,4 +92,6 @@ dependencies:
version: ==0.2.1
eth-abi:
version: ==4.0.0
pyyaml:
version: ==6.0.1
is_abstract: false
14 changes: 7 additions & 7 deletions packages/valory/skills/task_submission_abci/behaviours.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,13 @@ def to_multihash(hash_string: str) -> str:
return hex_multihash[6:]

def get_contract_api_response(
self,
performative: ContractApiMessage.Performative,
contract_address: Optional[str],
contract_id: str,
contract_callable: str,
ledger_id: Optional[str] = None,
**kwargs: Any,
self,
performative: ContractApiMessage.Performative,
contract_address: Optional[str],
contract_id: str,
contract_callable: str,
ledger_id: Optional[str] = None,
**kwargs: Any,
) -> Generator[None, None, ContractApiMessage]:
"""Get the contract api response."""
return super().get_contract_api_response(
Expand Down
4 changes: 2 additions & 2 deletions packages/valory/skills/task_submission_abci/skill.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license: Apache-2.0
aea_version: '>=1.0.0, <2.0.0'
fingerprint:
__init__.py: bafybeiholqak7ltw6bbmn2c5tn3j7xgzkdlfzp3kcskiqsvmxoih6m4muq
behaviours.py: bafybeicq6246kgnfbbk4gyp4ptje4u56bc5mkwsi7eln6bnmrtg7cdlepq
behaviours.py: bafybeigsgqxuwoacedl5yz36riqcl2j2bdohhpkq3m2u5c66rbvsan77ee
dialogues.py: bafybeibmac3m5u5h6ucoyjr4dazay72dyga656wvjl6z6saapluvjo54ne
fsm_specification.yaml: bafybeidtmsmpunr3t77pshd3k2s6dd6hlvhze6inu3gj7xyvlg4wi3tnuu
handlers.py: bafybeibe5n7my2vd2wlwo73sbma65epjqc7kxgtittewlylcmvnmoxtxzq
Expand All @@ -32,7 +32,7 @@ protocols:
skills:
- valory/abstract_round_abci:0.1.0:bafybeibiw4oqwqvo4jccwz5fb73iardzychgvcl66tceiildohoju2ikti
- valory/transaction_settlement_abci:0.1.0:bafybeigh2vkt74jrad5gtsczrgqcuhcqe7jkgjy7jdw56yamlzwwnaymjy
- valory/task_execution:0.1.0:bafybeigmps4dtqlvmrn42bt46cmsqoyvgtd7ltojm2t3ogf5rijxftmr5q
- valory/task_execution:0.1.0:bafybeiafc6rgv46qd2hfl5fxqdegjyyb6f2fxhqxe33g6j342lutbb6fsm
behaviours:
main:
args: {}
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

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

0 comments on commit fd86736

Please sign in to comment.