diff --git a/Pipfile b/Pipfile index 0a816bf..d0f3fc0 100644 --- a/Pipfile +++ b/Pipfile @@ -9,7 +9,7 @@ name = "pypi" [dev-packages] # we fix exact versions as it's sufficient to have at least one set of compatible dependencies for development -aiohttp = "==3.7.4.post0" +aiohttp = "<4.0.0,>=3.8.5" asn1crypto = "==1.5.1" certifi = "==2021.10.8" grpcio = "==1.53.0" @@ -21,16 +21,16 @@ pytest = "==7.2.1" pytest-asyncio = "==0.20.3" pytest-cov = "==4.0.0" pytest-randomly = "==3.12.0" -requests = "==2.28.2" -open-aea = "==1.41.0.post1" -open-aea-ledger-ethereum = "==1.41.0.post1" -open-aea-ledger-cosmos = "==1.41.0.post1" -open-aea-cli-ipfs = "==1.41.0.post1" -open-aea-test-autonomy = "==0.13.4" -open-autonomy = {version = "==0.13.4", extras = ["all"]} -tomte = {version = "==0.2.12", extras = ["cli", "tests"]} -openapi-core = "==0.13.4" -openapi-spec-validator = "==0.2.8" +requests = "==2.28.1" +open-aea = "==1.42.0" +open-aea-ledger-ethereum = "==1.42.0" +open-aea-ledger-cosmos = "==1.42.0" +open-aea-cli-ipfs = "==1.42.0" +open-aea-test-autonomy = "==0.13.8" +open-autonomy = {version = "==0.13.8", extras = ["all"]} +tomte = {version = "==0.2.15", extras = ["cli", "tests"]} +openapi-core = "==0.15.0" +openapi-spec-validator = "<0.5.0,>=0.4.0" protobuf = "<4.25.0,>=4.21.6" [requires] diff --git a/docs/index.md b/docs/index.md index d0d271c..70c77c9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -26,7 +26,7 @@ In order to run a local demo based on the SMPKit: 2. Fetch the Smart Managed Pools service. ```bash - autonomy fetch balancer/autonomous_fund_goerli:0.1.0:bafybeihpplxzdxfs3eg6saqw6nqldb2rzdiymdafs3436yn674xxeqpyvi --service + autonomy fetch balancer/autonomous_fund_goerli:0.1.0:bafybeiev5tw4sivr5wpuxzjp3p6k3qxute7d6bht6z2arolqmf6suv27py --service ``` 3. Build the Docker image of the service agents diff --git a/mkdocs.yml b/mkdocs.yml index 16559cb..ab362bd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,8 +56,8 @@ markdown_extensions: alternate_style: true - pymdownx.highlight - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg - pymdownx.arithmatex: generic: true - pymdownx.superfences: diff --git a/packages/balancer/agents/autonomous_fund/aea-config.yaml b/packages/balancer/agents/autonomous_fund/aea-config.yaml index 7371e6c..0d0d8a9 100644 --- a/packages/balancer/agents/autonomous_fund/aea-config.yaml +++ b/packages/balancer/agents/autonomous_fund/aea-config.yaml @@ -20,28 +20,28 @@ fingerprint: tests/test_contracts/test_managed_pool/test_contract.py: bafybeidpicr2wskkl65w43p5vowxn2kjnvhjziqdlr4pypqtuczhp3vmse fingerprint_ignore_patterns: [] connections: -- fetchai/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u -- valory/abci:0.1.0:bafybeigzgupmh6kwwx4jbqkw7qri5vr6vz53xbi4uksulh6oiovdplmviu -- valory/http_client:0.23.0:bafybeifgeqgryx6b3s6eseyzyezygmeitcpt3tkor2eiycozoi6clgdrny -- valory/ipfs:0.1.0:bafybeigfmqvlzbp67fttccpl4hsu3zaztbxv6vd7ikzra2hfppfkalgpji -- valory/ledger:0.19.0:bafybeigdckv3e6bz6kfloz4ucqrsufft6k4jp6bwkbbcvh4fxvgbmzq3dm +- valory/http_server:0.22.0:bafybeiesafy2af2wakqvsal4hz6ldycb73j5w62szhwy25iyhlf2wgyg44 +- valory/abci:0.1.0:bafybeiejo5uyurbmafretedivyci2ktastxclbmgrkwcwc2yt36jftyqgm +- valory/http_client:0.23.0:bafybeiddrfvomrmgvh5yuv2coq7ci72wcdf663stayi3m5aawnj4srggce +- valory/ipfs:0.1.0:bafybeihx7wb5hngjobw2salzqqryrhxvmxfuw7o2npjyqd2talmh2flqeq +- valory/ledger:0.19.0:bafybeia47rr37ianvwsh77tjjpv3nwif5sywhhy2fbdshnz4a2icwln76a - valory/p2p_libp2p_client:0.1.0:bafybeihge56dn3xep2dzomu7rtvbgo4uc2qqh7ljl3fubqdi2lq44gs5lq contracts: -- balancer/managed_pool:0.1.0:bafybeia6hf4fcnmqtvsgg4zf6k6tlb3rl4afcfp7cqllhd534qf3f4hvaq +- balancer/managed_pool:0.1.0:bafybeib2gq3tzy7delqs7bv34zr5cknajuzjuudhh3fu6ljxyvtsx5swju protocols: - open_aea/signing:1.0.0:bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii - valory/ipfs:0.1.0:bafybeiedxeismnx3k5ty4mvvhlqideixlhqmi5mtcki4lxqfa7uqh7p33u skills: -- balancer/autonomous_fund_abci:0.1.0:bafybeifto2oqc6ipc72ucnbyujesf3yls7uk5apo2ewwau6dwoivdvfhj4 -- balancer/fear_and_greed_oracle_abci:0.1.0:bafybeihynfeuhthc4oufmdqkdvbwhzbrrrnpy57sk5ejvbzebqhtesdp5u -- balancer/liquidity_provision_abci:0.1.0:bafybeiafxpihq6cl7mrxyk7l2my2fgob24n24ry6gcuwbj7irpb6tjz5pq -- balancer/pool_manager_abci:0.1.0:bafybeif67bjpbmmyk5vjl5q2qer5v7bujo64e6m7ffqmqryzuqw4ases3y -- valory/abstract_abci:0.1.0:bafybeifmfv4bgt5vzvgawlocksacqeadzg72zs4usvgjaf245hbbptpiki -- valory/abstract_round_abci:0.1.0:bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q -- valory/registration_abci:0.1.0:bafybeib2whqixp5265d53sa6szkz7woet4awuqr4dekb2hokpgps5codme -- valory/reset_pause_abci:0.1.0:bafybeiflxcl2dtzayyzzddc4f2astzxunyp66meutornanrgeemicdea5q -- valory/termination_abci:0.1.0:bafybeifazwrksp756h7z42qqfcgi6lya6wmhbx46l7ghlaooe45gqnju7q -- valory/transaction_settlement_abci:0.1.0:bafybeigxkdujugzvve2dszkwr5kgfx4uhz2epofo4lorbcnthmzfjegwzi +- balancer/autonomous_fund_abci:0.1.0:bafybeih446sc6iypcl2vthbu2tfq2yoznbf3abcbmf6stywpt3yzapk3lq +- balancer/fear_and_greed_oracle_abci:0.1.0:bafybeidyo5olysqg3gb6t3wvt4okd2licwwonpc42ui5h5yoahlowz6bly +- balancer/liquidity_provision_abci:0.1.0:bafybeiazku5mtwakg2retim2anquikzuxxtmx26qndjcwbhcwzhsvs4pce +- balancer/pool_manager_abci:0.1.0:bafybeiciyf2n5t6jee4eiz6pbn756rszqrs4b2aoqjxehqkolxkwxjkuby +- valory/abstract_abci:0.1.0:bafybeiflcfufixmsrhobf56bn5745m2iipcfqyulwk2qegtnagb3kvaaxi +- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq +- valory/registration_abci:0.1.0:bafybeic2ynseiak7jpta7jfwuqwyp453b4p7lolr4wihxmpn633uekv5am +- valory/reset_pause_abci:0.1.0:bafybeidzajbe3erygeh2xbd6lrjv7nsptznjuzrt24ykgvhgotdeyhfnba +- valory/termination_abci:0.1.0:bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa +- valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja default_ledger: ethereum required_ledgers: - ethereum @@ -73,9 +73,9 @@ logging_config: skill_exception_policy: stop_and_exit dependencies: open-aea-ledger-cosmos: - version: <2.0.0,>=1.41.0.post1 + version: ==1.42.0 open-aea-ledger-ethereum: - version: <2.0.0,>=1.41.0.post1 + version: ==1.42.0 default_connection: null --- public_id: valory/abci:0.1.0 @@ -196,7 +196,7 @@ models: light_slash_unit_amount: ${int:5000000000000000} serious_slash_unit_amount: ${int:8000000000000000} --- -public_id: fetchai/http_server:0.22.0:bafybeicblltx7ha3ulthg7bzfccuqqyjmihhrvfeztlgrlcoxhr7kf6nbq +public_id: valory/http_server:0.22.0:bafybeicblltx7ha3ulthg7bzfccuqqyjmihhrvfeztlgrlcoxhr7kf6nbq type: connection config: host: 0.0.0.0 diff --git a/packages/balancer/contracts/managed_pool/contract.yaml b/packages/balancer/contracts/managed_pool/contract.yaml index 658d1da..ada1473 100644 --- a/packages/balancer/contracts/managed_pool/contract.yaml +++ b/packages/balancer/contracts/managed_pool/contract.yaml @@ -16,6 +16,6 @@ contract_interface_paths: ethereum: build/IManagedPool.json dependencies: open-aea-ledger-ethereum: - version: ==1.41.0.post1 + version: ==1.42.0 web3: version: <7,>=6.0.0 diff --git a/packages/balancer/services/autonomous_fund/service.yaml b/packages/balancer/services/autonomous_fund/service.yaml index ec6ba7f..f72118e 100644 --- a/packages/balancer/services/autonomous_fund/service.yaml +++ b/packages/balancer/services/autonomous_fund/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeibfahh3htjez7vf7lwx2s7tth26cwxgtalgn5hj7yg7akhk67f4ny fingerprint_ignore_patterns: [] -agent: balancer/autonomous_fund:0.1.0:bafybeidhhtozpdptrzdx65tczogih2kpnlvy6l7rjuvkeljoyrm3cv3xru +agent: balancer/autonomous_fund:0.1.0:bafybeieg4inxzntqs2gy67rjqm4pxz4filfv5fvvj5ks2jdhjayocap3hm number_of_agents: 4 deployment: {} --- diff --git a/packages/balancer/services/autonomous_fund_gnosis/service.yaml b/packages/balancer/services/autonomous_fund_gnosis/service.yaml index 204f232..4a05918 100644 --- a/packages/balancer/services/autonomous_fund_gnosis/service.yaml +++ b/packages/balancer/services/autonomous_fund_gnosis/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeieehvmcyig6zmiwoueqihxgnwvwfsqhadxbgwk7olus3jfdw4cn3q fingerprint_ignore_patterns: [] -agent: balancer/autonomous_fund:0.1.0:bafybeidhhtozpdptrzdx65tczogih2kpnlvy6l7rjuvkeljoyrm3cv3xru +agent: balancer/autonomous_fund:0.1.0:bafybeieg4inxzntqs2gy67rjqm4pxz4filfv5fvvj5ks2jdhjayocap3hm number_of_agents: 4 deployment: {} --- diff --git a/packages/balancer/services/autonomous_fund_goerli/service.yaml b/packages/balancer/services/autonomous_fund_goerli/service.yaml index 4d1aee6..30f761c 100644 --- a/packages/balancer/services/autonomous_fund_goerli/service.yaml +++ b/packages/balancer/services/autonomous_fund_goerli/service.yaml @@ -7,7 +7,7 @@ license: Apache-2.0 fingerprint: README.md: bafybeie36flrik7sho37ynqzv7vc4thd5daw7h3af6fvi4o467fddbwgte fingerprint_ignore_patterns: [] -agent: balancer/autonomous_fund:0.1.0:bafybeidhhtozpdptrzdx65tczogih2kpnlvy6l7rjuvkeljoyrm3cv3xru +agent: balancer/autonomous_fund:0.1.0:bafybeieg4inxzntqs2gy67rjqm4pxz4filfv5fvvj5ks2jdhjayocap3hm number_of_agents: 4 deployment: {} --- diff --git a/packages/balancer/skills/autonomous_fund_abci/handlers.py b/packages/balancer/skills/autonomous_fund_abci/handlers.py index 616234f..e87a9e1 100644 --- a/packages/balancer/skills/autonomous_fund_abci/handlers.py +++ b/packages/balancer/skills/autonomous_fund_abci/handlers.py @@ -34,7 +34,7 @@ ) from packages.balancer.skills.autonomous_fund_abci.models import SharedState from packages.balancer.skills.fear_and_greed_oracle_abci.rounds import SynchronizedData -from packages.fetchai.connections.http_server.connection import ( +from packages.valory.connections.http_server.connection import ( PUBLIC_ID as HTTP_SERVER_PUBLIC_ID, ) from packages.valory.protocols.http.message import HttpMessage diff --git a/packages/balancer/skills/autonomous_fund_abci/skill.yaml b/packages/balancer/skills/autonomous_fund_abci/skill.yaml index 4d5f03f..51ae1d6 100644 --- a/packages/balancer/skills/autonomous_fund_abci/skill.yaml +++ b/packages/balancer/skills/autonomous_fund_abci/skill.yaml @@ -11,7 +11,7 @@ fingerprint: composition.py: bafybeibutsu26t5ut7l6ubeiv52jezvn4alg435fsbsxwgavembgv4qgbi dialogues.py: bafybeiffd2prpsv5uk4xxr2qixgpbgy2flonh2etz2fdtnojj2mrey4qty fsm_specification.yaml: bafybeidko26po77yapfol625vkpkxdeecib2m3iounzbn6q36ztveg4z4y - handlers.py: bafybeigozvyjknr3x4zknssh7p2aqigkq22vefc7uqs76knzmluhzbzsie + handlers.py: bafybeidcnplrkk2vpda46cmh2rtmhxp24tcjjh5ordyvln454qmgb4vdty models.py: bafybeidjbf67nnjjwjrrk5rvt624nhabfl5c6iessgvywvxkvjmmgm4uny multiplexer.py: bafybeigojtg2jbwnpqja6dseftwwf3udacdpaoz6jxv7gv4kx6bbzaueiq tests/__init__.py: bafybeifmqejm4fafrtnbvkjabydi66lxkccimykioqakigduke4cy32i24 @@ -22,19 +22,19 @@ fingerprint: tests/test_multiplexer.py: bafybeidqskxfcqsxbjbfus2qcpsqtuo5ynh7quyyyoiz4vj5ckcqmql33y fingerprint_ignore_patterns: [] connections: -- fetchai/http_server:0.22.0:bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u +- valory/http_server:0.22.0:bafybeiesafy2af2wakqvsal4hz6ldycb73j5w62szhwy25iyhlf2wgyg44 contracts: [] protocols: - valory/http:1.0.0:bafybeiejoqgv7finfxo3rcvvovrlj5ccrbgxodjq43uo26ylpowsa3llfe skills: -- balancer/fear_and_greed_oracle_abci:0.1.0:bafybeihynfeuhthc4oufmdqkdvbwhzbrrrnpy57sk5ejvbzebqhtesdp5u -- balancer/liquidity_provision_abci:0.1.0:bafybeiafxpihq6cl7mrxyk7l2my2fgob24n24ry6gcuwbj7irpb6tjz5pq -- balancer/pool_manager_abci:0.1.0:bafybeif67bjpbmmyk5vjl5q2qer5v7bujo64e6m7ffqmqryzuqw4ases3y -- valory/abstract_round_abci:0.1.0:bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q -- valory/registration_abci:0.1.0:bafybeib2whqixp5265d53sa6szkz7woet4awuqr4dekb2hokpgps5codme -- valory/reset_pause_abci:0.1.0:bafybeiflxcl2dtzayyzzddc4f2astzxunyp66meutornanrgeemicdea5q -- valory/termination_abci:0.1.0:bafybeifazwrksp756h7z42qqfcgi6lya6wmhbx46l7ghlaooe45gqnju7q -- valory/transaction_settlement_abci:0.1.0:bafybeigxkdujugzvve2dszkwr5kgfx4uhz2epofo4lorbcnthmzfjegwzi +- balancer/fear_and_greed_oracle_abci:0.1.0:bafybeidyo5olysqg3gb6t3wvt4okd2licwwonpc42ui5h5yoahlowz6bly +- balancer/liquidity_provision_abci:0.1.0:bafybeiazku5mtwakg2retim2anquikzuxxtmx26qndjcwbhcwzhsvs4pce +- balancer/pool_manager_abci:0.1.0:bafybeiciyf2n5t6jee4eiz6pbn756rszqrs4b2aoqjxehqkolxkwxjkuby +- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq +- valory/registration_abci:0.1.0:bafybeic2ynseiak7jpta7jfwuqwyp453b4p7lolr4wihxmpn633uekv5am +- valory/reset_pause_abci:0.1.0:bafybeidzajbe3erygeh2xbd6lrjv7nsptznjuzrt24ykgvhgotdeyhfnba +- valory/termination_abci:0.1.0:bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa +- valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja behaviours: main: args: {} @@ -203,5 +203,5 @@ models: class_name: TendermintDialogues dependencies: open-aea-cli-ipfs: - version: <2.0.0,>=1.41.0.post1 + version: ==1.42.0 is_abstract: false diff --git a/packages/balancer/skills/fear_and_greed_oracle_abci/skill.yaml b/packages/balancer/skills/fear_and_greed_oracle_abci/skill.yaml index b64ddf8..bd4cfe4 100644 --- a/packages/balancer/skills/fear_and_greed_oracle_abci/skill.yaml +++ b/packages/balancer/skills/fear_and_greed_oracle_abci/skill.yaml @@ -27,7 +27,7 @@ connections: [] contracts: [] protocols: [] skills: -- valory/abstract_round_abci:0.1.0:bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q +- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq behaviours: main: args: {} diff --git a/packages/balancer/skills/liquidity_provision_abci/skill.yaml b/packages/balancer/skills/liquidity_provision_abci/skill.yaml index fac3f7a..e7d0ba5 100644 --- a/packages/balancer/skills/liquidity_provision_abci/skill.yaml +++ b/packages/balancer/skills/liquidity_provision_abci/skill.yaml @@ -24,14 +24,14 @@ fingerprint: fingerprint_ignore_patterns: [] connections: [] contracts: -- balancer/managed_pool:0.1.0:bafybeia6hf4fcnmqtvsgg4zf6k6tlb3rl4afcfp7cqllhd534qf3f4hvaq -- valory/gnosis_safe:0.1.0:bafybeifmsjpgbifvk7y462rhfczvjvpigkdniavghhg5utza3hbnffioq4 +- balancer/managed_pool:0.1.0:bafybeib2gq3tzy7delqs7bv34zr5cknajuzjuudhh3fu6ljxyvtsx5swju +- valory/gnosis_safe:0.1.0:bafybeidll7frtdsq2ckiluazkwk4zpkp7natt4kdejjehwvykqwzyuf6ei - valory/multisend:0.1.0:bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y protocols: - valory/contract_api:1.0.0:bafybeialhbjvwiwcnqq3ysxcyemobcbie7xza66gaofcvla5njezkvhcka skills: -- valory/abstract_round_abci:0.1.0:bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q -- valory/transaction_settlement_abci:0.1.0:bafybeigxkdujugzvve2dszkwr5kgfx4uhz2epofo4lorbcnthmzfjegwzi +- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq +- valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja behaviours: main: args: {} diff --git a/packages/balancer/skills/pool_manager_abci/skill.yaml b/packages/balancer/skills/pool_manager_abci/skill.yaml index 6f57c14..df77407 100644 --- a/packages/balancer/skills/pool_manager_abci/skill.yaml +++ b/packages/balancer/skills/pool_manager_abci/skill.yaml @@ -24,13 +24,13 @@ fingerprint: fingerprint_ignore_patterns: [] connections: [] contracts: -- balancer/managed_pool:0.1.0:bafybeia6hf4fcnmqtvsgg4zf6k6tlb3rl4afcfp7cqllhd534qf3f4hvaq -- valory/gnosis_safe:0.1.0:bafybeifmsjpgbifvk7y462rhfczvjvpigkdniavghhg5utza3hbnffioq4 +- balancer/managed_pool:0.1.0:bafybeib2gq3tzy7delqs7bv34zr5cknajuzjuudhh3fu6ljxyvtsx5swju +- valory/gnosis_safe:0.1.0:bafybeidll7frtdsq2ckiluazkwk4zpkp7natt4kdejjehwvykqwzyuf6ei protocols: - valory/contract_api:1.0.0:bafybeialhbjvwiwcnqq3ysxcyemobcbie7xza66gaofcvla5njezkvhcka skills: -- valory/abstract_round_abci:0.1.0:bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q -- valory/transaction_settlement_abci:0.1.0:bafybeigxkdujugzvve2dszkwr5kgfx4uhz2epofo4lorbcnthmzfjegwzi +- valory/abstract_round_abci:0.1.0:bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq +- valory/transaction_settlement_abci:0.1.0:bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja behaviours: main: args: {} diff --git a/packages/packages.json b/packages/packages.json index f146df1..90bf166 100644 --- a/packages/packages.json +++ b/packages/packages.json @@ -1,39 +1,39 @@ { "dev": { - "agent/balancer/autonomous_fund/0.1.0": "bafybeidhhtozpdptrzdx65tczogih2kpnlvy6l7rjuvkeljoyrm3cv3xru", - "skill/balancer/autonomous_fund_abci/0.1.0": "bafybeifto2oqc6ipc72ucnbyujesf3yls7uk5apo2ewwau6dwoivdvfhj4", - "skill/balancer/pool_manager_abci/0.1.0": "bafybeif67bjpbmmyk5vjl5q2qer5v7bujo64e6m7ffqmqryzuqw4ases3y", - "skill/balancer/fear_and_greed_oracle_abci/0.1.0": "bafybeihynfeuhthc4oufmdqkdvbwhzbrrrnpy57sk5ejvbzebqhtesdp5u", - "contract/balancer/managed_pool/0.1.0": "bafybeia6hf4fcnmqtvsgg4zf6k6tlb3rl4afcfp7cqllhd534qf3f4hvaq", - "service/balancer/autonomous_fund_gnosis/0.1.0": "bafybeihzmq4h7lqh7pbrciqeqeedhhfxrj52ocufmerkku6hab3kbuvova", - "service/balancer/autonomous_fund_goerli/0.1.0": "bafybeihpplxzdxfs3eg6saqw6nqldb2rzdiymdafs3436yn674xxeqpyvi", - "service/balancer/autonomous_fund/0.1.0": "bafybeicii3kyb4cywwxlsshnzbwdqywgeyopfhbtpv347br2brqde3fc5u", - "skill/balancer/liquidity_provision_abci/0.1.0": "bafybeiafxpihq6cl7mrxyk7l2my2fgob24n24ry6gcuwbj7irpb6tjz5pq" + "agent/balancer/autonomous_fund/0.1.0": "bafybeieg4inxzntqs2gy67rjqm4pxz4filfv5fvvj5ks2jdhjayocap3hm", + "skill/balancer/autonomous_fund_abci/0.1.0": "bafybeih446sc6iypcl2vthbu2tfq2yoznbf3abcbmf6stywpt3yzapk3lq", + "skill/balancer/pool_manager_abci/0.1.0": "bafybeiciyf2n5t6jee4eiz6pbn756rszqrs4b2aoqjxehqkolxkwxjkuby", + "skill/balancer/fear_and_greed_oracle_abci/0.1.0": "bafybeidyo5olysqg3gb6t3wvt4okd2licwwonpc42ui5h5yoahlowz6bly", + "contract/balancer/managed_pool/0.1.0": "bafybeib2gq3tzy7delqs7bv34zr5cknajuzjuudhh3fu6ljxyvtsx5swju", + "service/balancer/autonomous_fund_gnosis/0.1.0": "bafybeiaenbaptjwjtzqajjol7blk66cri6sz2agrqnsnggytns5t5ia77m", + "service/balancer/autonomous_fund_goerli/0.1.0": "bafybeiev5tw4sivr5wpuxzjp3p6k3qxute7d6bht6z2arolqmf6suv27py", + "service/balancer/autonomous_fund/0.1.0": "bafybeiaf7ltrydplckhgpbdswz67har74h7p2wruadfgbvjous7twgywmq", + "skill/balancer/liquidity_provision_abci/0.1.0": "bafybeiazku5mtwakg2retim2anquikzuxxtmx26qndjcwbhcwzhsvs4pce" }, "third_party": { "protocol/valory/abci/0.1.0": "bafybeihmzlmmb4pdo3zkhg6ehuyaa4lhw7bfpclln2o2z7v3o6fcep26iu", - "connection/valory/abci/0.1.0": "bafybeigzgupmh6kwwx4jbqkw7qri5vr6vz53xbi4uksulh6oiovdplmviu", + "connection/valory/abci/0.1.0": "bafybeiejo5uyurbmafretedivyci2ktastxclbmgrkwcwc2yt36jftyqgm", "protocol/valory/contract_api/1.0.0": "bafybeialhbjvwiwcnqq3ysxcyemobcbie7xza66gaofcvla5njezkvhcka", "protocol/valory/http/1.0.0": "bafybeiejoqgv7finfxo3rcvvovrlj5ccrbgxodjq43uo26ylpowsa3llfe", "protocol/valory/ledger_api/1.0.0": "bafybeige5agrztgzfevyglf7mb4o7pzfttmq4f6zi765y4g2zvftbyowru", - "connection/valory/http_client/0.23.0": "bafybeifgeqgryx6b3s6eseyzyezygmeitcpt3tkor2eiycozoi6clgdrny", - "connection/valory/ledger/0.19.0": "bafybeigdckv3e6bz6kfloz4ucqrsufft6k4jp6bwkbbcvh4fxvgbmzq3dm", - "contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeigejiv4fkksyjwmr6doo23kfpicfbktuwspbamasyvjusfdyjtrxy", - "contract/valory/service_registry/0.1.0": "bafybeic4bgql6x5jotp43ddazybmyb7macifjzudavqll3547ayhawttpi", + "connection/valory/http_client/0.23.0": "bafybeiddrfvomrmgvh5yuv2coq7ci72wcdf663stayi3m5aawnj4srggce", + "connection/valory/ledger/0.19.0": "bafybeia47rr37ianvwsh77tjjpv3nwif5sywhhy2fbdshnz4a2icwln76a", + "contract/valory/gnosis_safe_proxy_factory/0.1.0": "bafybeidvcgnbbmjtha6tl7st2ysna2l3iiqfhnzjfasyvml5unecozeeka", + "contract/valory/service_registry/0.1.0": "bafybeia2swgpmczn3iykmptigabklk2eqbqxzhmbnunq3givmjygvmgtbm", "protocol/open_aea/signing/1.0.0": "bafybeie7xyems76v5b4wc2lmaidcujizpxfzjnnwdeokmhje53g7ym25ii", "protocol/valory/tendermint/0.1.0": "bafybeig6g6twajlwssfbfp5rlnu5mwzuu5kgak5cs4fich7rlkx6whesnu", - "skill/valory/abstract_abci/0.1.0": "bafybeifmfv4bgt5vzvgawlocksacqeadzg72zs4usvgjaf245hbbptpiki", - "contract/valory/gnosis_safe/0.1.0": "bafybeifmsjpgbifvk7y462rhfczvjvpigkdniavghhg5utza3hbnffioq4", + "skill/valory/abstract_abci/0.1.0": "bafybeiflcfufixmsrhobf56bn5745m2iipcfqyulwk2qegtnagb3kvaaxi", + "contract/valory/gnosis_safe/0.1.0": "bafybeidll7frtdsq2ckiluazkwk4zpkp7natt4kdejjehwvykqwzyuf6ei", "protocol/valory/acn/1.1.0": "bafybeic2pxzfc3voxl2ejhcqyf2ehm4wm5gxvgx7bliloiqi2uppmq6weu", - "skill/valory/abstract_round_abci/0.1.0": "bafybeigrqhygo2hl2owisj5rqyh3acdvee773ajije64snlzalcgtaac7q", + "skill/valory/abstract_round_abci/0.1.0": "bafybeiaqcl7h2famylusiffigwem7tevkcsyocdu5xd42jkmgq6kvowzgq", "connection/valory/p2p_libp2p_client/0.1.0": "bafybeihge56dn3xep2dzomu7rtvbgo4uc2qqh7ljl3fubqdi2lq44gs5lq", - "skill/valory/transaction_settlement_abci/0.1.0": "bafybeigxkdujugzvve2dszkwr5kgfx4uhz2epofo4lorbcnthmzfjegwzi", - "skill/valory/registration_abci/0.1.0": "bafybeib2whqixp5265d53sa6szkz7woet4awuqr4dekb2hokpgps5codme", - "skill/valory/reset_pause_abci/0.1.0": "bafybeiflxcl2dtzayyzzddc4f2astzxunyp66meutornanrgeemicdea5q", + "skill/valory/transaction_settlement_abci/0.1.0": "bafybeiaefgqbs7zsn5xe5kdwrujj7ivygkn3ujpw6crnvi3knvxw75qmja", + "skill/valory/registration_abci/0.1.0": "bafybeic2ynseiak7jpta7jfwuqwyp453b4p7lolr4wihxmpn633uekv5am", + "skill/valory/reset_pause_abci/0.1.0": "bafybeidzajbe3erygeh2xbd6lrjv7nsptznjuzrt24ykgvhgotdeyhfnba", "contract/valory/multisend/0.1.0": "bafybeig5byt5urg2d2bsecufxe5ql7f4mezg3mekfleeh32nmuusx66p4y", - "skill/valory/termination_abci/0.1.0": "bafybeifazwrksp756h7z42qqfcgi6lya6wmhbx46l7ghlaooe45gqnju7q", + "skill/valory/termination_abci/0.1.0": "bafybeie4zvjfxvdu7qrulmur3chpjz3kpj5m4bjsxvpk4gvj5zbyyayfaa", "protocol/valory/ipfs/0.1.0": "bafybeiedxeismnx3k5ty4mvvhlqideixlhqmi5mtcki4lxqfa7uqh7p33u", - "connection/valory/ipfs/0.1.0": "bafybeigfmqvlzbp67fttccpl4hsu3zaztbxv6vd7ikzra2hfppfkalgpji", - "connection/fetchai/http_server/0.22.0": "bafybeihvscddpxjbtqsetngmxo3kiht2wqhosmwiyuh3f6zjti3x3byu5u" + "connection/valory/ipfs/0.1.0": "bafybeihx7wb5hngjobw2salzqqryrhxvmxfuw7o2npjyqd2talmh2flqeq", + "connection/valory/http_server/0.22.0": "bafybeiesafy2af2wakqvsal4hz6ldycb73j5w62szhwy25iyhlf2wgyg44" } } \ No newline at end of file diff --git a/scripts/bump.py b/scripts/bump.py new file mode 100644 index 0000000..a868d23 --- /dev/null +++ b/scripts/bump.py @@ -0,0 +1,316 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------------------------ +# +# Copyright 2023 Valory AG +# +# 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. +# +# ------------------------------------------------------------------------------ + +""" +Script for bumping core dependencies. + +This script + +- Fetches the latest core dependency versions from github +- Updates the tox.ini, packages and Pipfile/pyproject.toml files +- Performs the packages sync +""" + +import os +import re +import typing as t +from pathlib import Path + +import click +import requests +from aea.cli.utils.click_utils import PackagesSource, PyPiDependency +from aea.configurations.constants import PACKAGES, PACKAGE_TYPE_TO_CONFIG_FILE +from aea.configurations.data_types import Dependency +from aea.helpers.logging import setup_logger +from aea.helpers.yaml_utils import yaml_dump, yaml_dump_all, yaml_load, yaml_load_all +from aea.package_manager.v1 import PackageManagerV1 + +from autonomy.cli.helpers.ipfs_hash import load_configuration + + +BUMP_BRANCH = "chore/bump" +PIPFILE = Path.cwd() / "Pipfile" +PYPROJECT_TOML = Path.cwd() / "pyproject.toml" +TOX_INI = Path.cwd() / "tox.ini" + +TAGS_URL = "https://api.github.com/repos/{repo}/tags" +FILE_URL = "https://raw.githubusercontent.com/{repo}/{tag}/{file}" + +VERISON_RE = re.compile(r"(__version__|version)( )?=( )?\"(?P[0-9a-z\.]+)\"") + +OPEN_AEA_REPO = "valory-xyz/open-aea" +OPEN_AUTONOMY_REPO = "valory-xyz/open-autonomy" + +DEPENDENCY_SPECS = { + "open-aea": { + "repo": OPEN_AEA_REPO, + "file": "aea/__version__.py", + }, + "open-aea-ledger-ethereum": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-ledger-ethereum/setup.py", + }, + "open-aea-ledger-ethereum-flashbots": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-ledger-ethereum-flashbots/setup.py", + }, + "open-aea-ledger-ethereum-hwi": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-ledger-ethereum-hwi/setup.py", + }, + "open-aea-ledger-cosmos": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-ledger-cosmos/setup.py", + }, + "open-aea-ledger-solana": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-ledger-solana/setup.py", + }, + "open-aea-cli-ipfs": { + "repo": OPEN_AEA_REPO, + "file": "plugins/aea-cli-ipfs/setup.py", + }, + "open-autonomy": { + "repo": OPEN_AUTONOMY_REPO, + "file": "autonomy/__version__.py", + }, + "open-aea-test-autonomy": { + "repo": OPEN_AUTONOMY_REPO, + "file": "plugins/aea-test-autonomy/setup.py", + }, +} + +_cache_file = Path.home() / ".aea" / ".gitcache" +_version_cache = {} +_logger = setup_logger("bump") + + +def load_git_cache() -> None: + """Load versions cache.""" + if not _cache_file.exists(): + return + with _cache_file.open("r", encoding="utf-8") as stream: + _version_cache.update(yaml_load(stream=stream)) + + +def dump_git_cache() -> None: + """Dump versions cache.""" + with _cache_file.open("w", encoding="utf-8") as stream: + yaml_dump(data=_version_cache, stream=stream) + + +def make_git_request(url: str) -> requests.Response: + """Make git request""" + auth = os.environ.get("GITHUB_AUTH") + if auth is None: + return requests.get(url=url) + return requests.get(url=url, headers={"Authorization": f"Bearer {auth}"}) + + +def get_latest_tag(repo: str) -> str: + """Fetch latest git tag.""" + if repo in _version_cache: + return _version_cache[repo] + + response = make_git_request(url=TAGS_URL.format(repo=repo)) + if response.status_code != 200: + raise ValueError( + f"Fetching tags from `{repo}` failed with message '" + + response.json()["message"] + + "'" + ) + latest_tag_data, *_ = response.json() + _version_cache[repo] = latest_tag_data["name"] + return _version_cache[repo] + + +def get_dependency_version(repo: str, file: str) -> str: + """Get version spec .""" + response = make_git_request( + FILE_URL.format( + repo=repo, + tag=get_latest_tag(repo=repo), + file=file, + ) + ) + if response.status_code != 200: + raise ValueError( + f"Fetching packages from `{repo}` failed with message '" + + response.text + + "'" + ) + ((*_, version),) = VERISON_RE.findall(response.content.decode()) + return f"=={version}" + + +def get_dependencies() -> t.Dict: + """Get dependency->version mapping.""" + dependencies = {} + for dependency, specs in DEPENDENCY_SPECS.items(): + version = _version_cache.get( + dependency, + get_dependency_version( + repo=specs["repo"], + file=specs["file"], + ), + ) + dependencies[dependency] = version + _version_cache.update(dependencies) + return dependencies + + +def bump_pipfile_or_pyproject(file: Path, dependencies: t.Dict[str, str]) -> None: + """Bump Pipfile.""" + if not file.exists(): + return + + _logger.info(f"Updating {file.name}") + updated = "" + content = file.read_text(encoding="utf-8") + for line in content.split("\n"): + try: + spec = Dependency.from_pipfile_string(line) + update = dependencies.get(spec.name) + if update is None: + updated += line + "\n" + continue + spec = Dependency( + name=spec.name, + version=update, + extras=spec.extras, + ) + updated += spec.to_pipfile_string() + "\n" + except ValueError: + updated += line + "\n" + file.write_text(updated[:-1], encoding="utf-8") + + +def bump_tox(dependencies: t.Dict[str, str]) -> None: + """Bump tox file.""" + if not TOX_INI.exists(): + return + + _logger.info("Updating tox.ini") + updated = "" + content = TOX_INI.read_text(encoding="utf-8") + for line in content.split("\n"): + try: + spec = Dependency.from_string(line.lstrip().rstrip()) + update = dependencies.get(spec.name) + if update is None: + updated += line + "\n" + continue + spec = Dependency( + name=spec.name, + version=update, + extras=spec.extras, + ) + updated += " " + spec.to_pip_string() + "\n" + except ValueError: + updated += line + "\n" + TOX_INI.write_text(updated[:-1], encoding="utf-8") + + +def bump_packages(dependencies: t.Dict[str, str]) -> None: + """Bump packages.""" + _logger.info("Updating packages") + manager = PackageManagerV1.from_dir(Path(PACKAGES)) + for package_id in manager.dev_packages: + path = ( + manager.package_path_from_package_id( + package_id=package_id, + ) + / PACKAGE_TYPE_TO_CONFIG_FILE[package_id.package_type.value] + ) + with path.open("r", encoding="utf-8") as stream: + config, *extra = yaml_load_all(stream=stream) + + for name in config.get("dependencies", {}): + update = dependencies.get(name) + if update is None: + continue + config["dependencies"][name]["version"] = update + + with path.open("w", encoding="utf-8") as stream: + yaml_dump_all([config, *extra], stream=stream) + + +@click.command(name="bump") +@click.option( + "-d", + "--dependency", + "extra", + type=PyPiDependency(), + multiple=True, + help="Specify extra dependency.", +) +@click.option( + "-s", + "--source", + "sources", + type=PackagesSource(), + multiple=True, + help="Specify extra sources.", +) +@click.option("--sync", is_flag=True, help="Perform sync.") +@click.option( + "--no-cache", + is_flag=True, + default=False, + help="Avoid using cache to bump.", +) +def main( + extra: t.Tuple[Dependency, ...], + sources: t.Tuple[str, ...], + sync: bool, + no_cache: bool, +) -> None: + """Run the bump script.""" + + if not no_cache: + load_git_cache() + + dependencies = {} + dependencies.update(get_dependencies()) + dependencies.update({dep.name: dep.version for dep in extra or []}) + + bump_pipfile_or_pyproject(PIPFILE, dependencies=dependencies) + bump_pipfile_or_pyproject(PYPROJECT_TOML, dependencies=dependencies) + bump_tox(dependencies=dependencies) + bump_packages(dependencies=dependencies) + dump_git_cache() + + if sync: + pm = PackageManagerV1.from_dir( + Path.cwd() / PACKAGES, config_loader=load_configuration + ) + pm.sync( + sources=[ + f"{OPEN_AEA_REPO}:{_version_cache[OPEN_AEA_REPO]}", + f"{OPEN_AUTONOMY_REPO}:{_version_cache[OPEN_AUTONOMY_REPO]}", + *sources, + ], + update_packages=True, + ) + pm.update_package_hashes() + pm.dump() + + +if __name__ == "__main__": + main() # pylint: disable=no-value-for-parameter diff --git a/tox.ini b/tox.ini index 4d89aad..a4c232a 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ whitelist_externals = /bin/sh passenv = * extras = all deps = - aiohttp==3.7.4.post0 + aiohttp<4.0.0,>=3.8.5 asn1crypto==1.5.1 certifi==2021.10.8 grpcio==1.53.0 @@ -28,15 +28,15 @@ deps = pytest-randomly==3.12.0 pytest-cov==4.0.0 pytest-asyncio==0.20.3 - requests==2.28.2 - open-aea==1.41.0.post1 - open-aea-ledger-ethereum==1.41.0.post1 - open-aea-ledger-cosmos==1.41.0.post1 - open-aea-cli-ipfs==1.41.0.post1 - open-aea-test-autonomy==0.13.4 - open-autonomy==0.13.4 - openapi-core==0.13.2 - openapi-spec-validator==0.2.8 + requests==2.28.1 + open-aea==1.42.0 + open-aea-ledger-ethereum==1.42.0 + open-aea-ledger-cosmos==1.42.0 + open-aea-cli-ipfs==1.42.0 + open-aea-test-autonomy==0.13.8 + open-autonomy==0.13.8 + openapi-core==0.15.0 + openapi-spec-validator<0.5.0,>=0.4.0 protobuf<4.25.0,>=4.21.6 setenv = @@ -159,7 +159,7 @@ setenv = skipsdist = True skip_install = True deps = - tomte[bandit]==0.2.12 + tomte[bandit]==0.2.15 commands = bandit -s B101 -r packages bandit -s B101 -r tests scripts @@ -211,7 +211,7 @@ commands = skipsdist = True skip_install = True deps = - tomte[flake8]==0.2.12 + tomte[flake8]==0.2.15 commands = flake8 {env:PACKAGES_PATHS} scripts [testenv:mypy] @@ -219,7 +219,7 @@ skipsdist = True skip_install = True deps = {[testenv]deps} - tomte[mypy]==0.2.12 + tomte[mypy]==0.2.15 commands = mypy {env:PACKAGES_PATHS} scripts --disallow-untyped-defs --config-file tox.ini [testenv:pylint] @@ -227,29 +227,29 @@ whitelist_externals = /bin/sh skipsdist = True deps = {[testenv]deps} - tomte[pylint]==0.2.12 + tomte[pylint]==0.2.15 commands = pylint --ignore-patterns=".*_pb2.py" --ignore-paths="^packages/valory/.*$" --disable=C0103,R0801,R0912,C0301,C0201,C0204,C0209,W1203,C0302,R1735,R1729,W0511 {env:PACKAGES_PATHS} scripts [testenv:safety] skipsdist = True skip_install = True deps = - tomte[safety]==0.2.12 + tomte[safety]==0.2.15 commands = safety check -i 37524 -i 38038 -i 37776 -i 38039 -i 39621 -i 40291 -i 39706 -i 41002 -i 51358 -i 51499 [testenv:darglint] skipsdist = True skip_install = True deps = - tomte[darglint]==0.2.12 + tomte[darglint]==0.2.15 commands = darglint scripts {env:PACKAGES_PATHS}/* [testenv:check-generate-all-protocols] skipsdist = True usedevelop = True deps = - tomte[isort]==0.2.12 - tomte[black]==0.2.12 + tomte[isort]==0.2.15 + tomte[black]==0.2.15 commands = aea generate-all-protocols --check-clean [testenv:abci-docstrings] @@ -288,7 +288,7 @@ commands = tomte check-spelling skipsdist = True usedevelop = True deps = - tomte[liccheck,cli]==0.2.12 + tomte[liccheck,cli]==0.2.15 commands = tomte freeze-dependencies --output-path {envtmpdir}/requirements.txt liccheck -s tox.ini -r {envtmpdir}/requirements.txt -l PARANOID @@ -414,6 +414,12 @@ ignore_missing_imports=True [mypy-openapi_spec_validator.*] ignore_missing_imports=True +[mypy-click.*] +ignore_missing_imports=True + +[mypy-autonomy.*] +ignore_missing_imports=True + [darglint] docstring_style=sphinx strictness=short