feat: migrate all scripts to plugins and tomte CLI#2470
feat: migrate all scripts to plugins and tomte CLI#2470DhairyaPatel7 wants to merge 8 commits intomainfrom
Conversation
Replace all 8 Python scripts from scripts/ with tomte CLI commands and plugin commands: Tomte (0.6.5): - check_copyright.py → tomte check-copyright --author "Valory AG" - check_doc_links.py → tomte check-doc-links (with URL skip flags) - freeze_dependencies.py → tomte freeze-dependencies --exclude-package open-autonomy aea-ci-helpers (requires open-aea >= 2.2.0): - generate_api_documentation.py → aea-ci generate-api-docs - generate_package_list.py → aea-ci generate-pkg-list - check_ipfs_hashes_pushed.py → aea-ci check-ipfs-pushed aea-helpers (OA-specific): - check_third_party_hashes.py → aea-helpers check-third-party-hashes - generate_contract_list.py → aea-helpers generate-contract-list Also: - Bump all tomte pins from 0.6.1 to 0.6.5 (tox.ini, pyproject.toml, workflow) - Fix pre-existing copyright end years - Remaining in scripts/: whitelist.py, git hooks, RELEASE_PROCESS.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The aea-ci generate-api-docs command is designed for open-aea's repo structure (scans aea/), not OA's (scans autonomy/). Moved OA's generate_api_documentation.py to aea-helpers plugin instead. Also regenerated API docs for new aea-helpers modules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Change PyPI package name from "aea-helpers" to "open-aea-helpers" for naming consistency with open-aea-ci-helpers and open-aea-dev-helpers. The CLI entry point stays "aea-helpers" (console_scripts unchanged). The Python import name stays "aea_helpers" (no code changes needed). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2470 +/- ##
=======================================
Coverage 92.55% 92.56%
=======================================
Files 243 243
Lines 17259 17261 +2
=======================================
+ Hits 15974 15977 +3
+ Misses 1285 1284 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
tox.ini
Outdated
| deps = | ||
| {[deps-packages]deps} | ||
| ; requires open-aea-ci-helpers >= 2.2.0 | ||
| open-aea-ci-helpers |
There was a problem hiding this comment.
would be good to pin them, so that we don't surprise ourselves in the future.
tox.ini
Outdated
| aea init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https" | ||
| aea packages sync | ||
| {toxinidir}/scripts/check_doc_links.py | ||
| tomte check-doc-links -n "http://pmg.csail.mit.edu/papers/osdi99.pdf" -u "https://github.com/valory-xyz/open-operator" -u "https://gateway.autonolas.tech/ipfs/<hash>" |
There was a problem hiding this comment.
Blocking. This drops 3 URL skips that the deleted scripts/check_doc_links.py had, and they all still appear in current docs:
http://host.docker.internal:8545—docs/guides/define_service.md,docs/configure_service/configure_access_external_chains.md,docs/configure_service/service_configuration_file.md,docs/advanced_reference/developer_tooling/debugging_in_the_cluster.mdhttp://www.fipa.org/repository/ips.php3—docs/key_concepts/abci_app_async_behaviour.mdhttps://github.com/valory-xyz/open-autonomy/trunk/infrastructure—docs/using_stack_deployment.md,docs/application_deployment.md
tox -e check-doc-links-hashes is also missing from the PR test plan, so this likely wasn't exercised. Add the missing entries (-n for HTTP-allowlist, -u for status-code skips) before merge.
| commands = {toxinidir}/scripts/check_copyright.py --check | ||
| allowlist_externals = {toxinidir}/scripts/check_copyright.py | ||
| tomte[cli]==0.6.5 | ||
| commands = tomte check-copyright --author "Valory AG" --scan-path autonomy --scan-path tests --scan-path packages/valory/agents --scan-path packages/valory/connections/abci --scan-path packages/valory/contracts --scan-path packages/valory/skills --scan-path scripts --scan-path plugins -e protocols -e dummy_packages |
There was a problem hiding this comment.
Non-blocking. The deleted scripts/check_copyright.py excluded _pb2.py, _pb2_grpc.py, build/, t_protocol/, t_protocol_no_ct/. The new invocation only excludes protocols and dummy_packages, but generated _pb2.py files exist outside packages/valory/protocols/ (e.g. packages/valory/connections/abci/gogoproto/gogo_pb2.py, which has no Valory header). This only passes if tomte's check-copyright auto-skips generated files — worth confirming explicitly, otherwise add the exclusions.
| @click.command(name="check-third-party-hashes") | ||
| def check_third_party_hashes() -> None: | ||
| """Check that third-party package hashes match the open-aea repository.""" | ||
| root_dir = Path.cwd() |
There was a problem hiding this comment.
Non-blocking. Hardcoding Path.cwd() as root_dir makes the contract implicit — the command silently does the wrong thing if invoked from outside the OA repo root. Expose it as a click option (--root-dir, default .) so the dependency on cwd is documented.
|
|
||
| setup( | ||
| name="aea-helpers", | ||
| name="open-aea-helpers", |
There was a problem hiding this comment.
Non-blocking but worth calling out in the PR body / release notes: open-aea-helpers is not yet on PyPI (verified — pip index versions open-aea-helpers returns no matches), so the next release will be the first publish under the new name. Anyone with aea-helpers pinned externally will break, and the old PyPI name becomes orphaned (typosquat surface). Confirm someone will claim/reserve it.
Version bumps: - open-aea[all], open-aea-cli-ipfs, open-aea-ledger-ethereum, open-aea-ledger-ethereum-hwi, open-aea-ledger-cosmos, open-aea-ledger-solana: 2.1.0 → 2.2.0 (tox.ini, pyproject.toml, setup.py, aea-test-autonomy/setup.py) - open-aea-ci-helpers: pinned to ==2.2.0 - Python range: ^3.10 → >=3.10,<3.15 (matches open-aea plugins) - Regenerated poetry.lock Review fixes: - Add missing URL skips for check-doc-links: host.docker.internal, fipa.org, open-autonomy/trunk/infrastructure (LOCKhart07 blocking) - Add --root-dir option to check-third-party-hashes (LOCKhart07) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- check-api-docs/generate-api-documentation: install aea-helpers via --no-deps in commands to avoid circular dep resolution (aea-helpers depends on open-autonomy from PyPI which pins open-aea==2.1.0) - Regenerate API docs for check_third_party_hashes (--root-dir added) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| import sys | ||
| from pathlib import Path | ||
|
|
||
| import click |
There was a problem hiding this comment.
why isn't this in open-aea? You can imagine agents building purely on open-aea wanting this
There was a problem hiding this comment.
This script checks third-party packages against the open-aea repo's hashes. We put it in OA's aea-helpers initially, but any downstream repo building on open-aea would want the same check. Should I migrate it to open-aea-ci-helpers?
There was a problem hiding this comment.
yes please - migrate there and re-release for use here
| @@ -24,7 +24,10 @@ | |||
| from aea_helpers.check_binary import check_binary | |||
There was a problem hiding this comment.
So we're extending aea-helpers?
There was a problem hiding this comment.
Yes — aea-helpers already existed in OA with commands like run-agent, run-service, make-release, config-replace, check-binary, etc. We added 3 commands that were previously in scripts/: check-third-party-hashes, generate-contract-list, and generate-api-docs. The first two are arguably OA-specific (contract list generation, third-party hash checking against open-aea). The API doc generator is OA-specific because it scans autonomy/ rather than aea/ — but per your other comment, that could be made configurable upstream instead.
There was a problem hiding this comment.
third-party hash checking should be generic against any upstream repo (or list of repos)
There was a problem hiding this comment.
let's make api thing configurable upstream so we don't need to maintain two versions
There was a problem hiding this comment.
generate contract list can stay here. but what is it's purpose?
| ) | ||
| arguments = parser.parse_args() | ||
|
|
||
| def main(check_clean: bool = False) -> None: |
There was a problem hiding this comment.
Why wasn't this backported to open-aea?
There was a problem hiding this comment.
The open-aea aea-ci generate-api-docs command is hardcoded to scan aea/ and plugins/ with open-aea's directory structure. OA's version scans autonomy/ and packages/valory/. We couldn't reuse the open-aea version as-is, so we kept OA's version in aea-helpers.
The right fix would be to make aea-ci generate-api-docs configurable (e.g. --source-dir, --packages-dir flags) so both repos can use the same command. Should I create a follow-up PR on open-aea for this?
|
|
||
| setup( | ||
| name="aea-helpers", | ||
| name="open-aea-helpers", |
There was a problem hiding this comment.
why aea-helpers in autonomy?
There was a problem hiding this comment.
The other OA plugin follows the same pattern: open-aea-test-autonomy — also an open-aea-* name living in the OA repo. We're renaming this one from aea-helpers to open-aea-helpers on PyPI in this PR to match that convention. The commands it provides (run-agent, run-service, make-release, config-replace, check-binary) are OA-specific and depend on autonomy.
| @@ -7,15 +7,15 @@ license = "Apache-2.0 license" | |||
| packages = [{include = "autonomy"}, {include = "packages"}] | |||
|
|
|||
There was a problem hiding this comment.
why are open-aea-ci-helpers and open-aea-dev-helpers not used here?
There was a problem hiding this comment.
They're not runtime dependencies of open-autonomy — they're CI/dev tools. They're declared in tox.ini as deps for the specific tox envs that need them (e.g. open-aea-ci-helpers==2.2.0 in check-doc-links-hashes). Adding them to pyproject.toml would make them install-time dependencies for every user of open-autonomy, which isn't right since most users don't need CI tooling.
Should we add them under [tool.poetry.group.dev.dependencies] instead so they're available during development but not for end users?
There was a problem hiding this comment.
yes dev dependencies
LOCKhart07
left a comment
There was a problem hiding this comment.
Re-reviewed commits aebd768 and eff13d0b since my previous review.
Prior items — resolved:
- Missing URL skips (
host.docker.internal,fipa.org,open-autonomy/trunk/infrastructure) added tocheck-doc-links-hashes(blocker). --root-dirclick option added tocheck-third-party-hashes.open-aea-ci-helpersnow pinned to==2.2.0.
Minor, non-blocking polish (optional):
tox.inicheck-third-party-hashesstill installsaea-helpersviadeps = {toxinidir}/plugins/aea-helpers, while the other new envs (check-api-docs,generate-api-documentation,check-doc-links-hashes,lock-packages) switched topython -m pip install --no-deps ...incommandsto avoid the circularopen-autonomyresolution. Lower risk here because this env omits{[deps-packages]deps}, but aligning for consistency would be nice.http://host.docker.internal:8545appears in both-nand-ufortomte check-doc-links— intentional (non-HTTPS skip + unreachable status skip), just worth noting so it isn't "simplified" later.- Still outstanding from prior pass (non-blocking): generated
_pb2.pyfiles outsidepackages/valory/protocols/and theopen-aea-helpersPyPI name reservation.
LGTM.
open-aea-cli-ipfs 2.2.0 replaced the underlying ipfshttpclient.Client with an in-tree IPFSHTTPClient that does not expose add_str. Switch to add_bytes which provides equivalent behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Matches the other new tox envs (check-api-docs, generate-api-documentation, check-doc-links-hashes, lock-packages) which install aea-helpers via `python -m pip install --no-deps` in commands to avoid pulling the PyPI open-autonomy via aea-helpers' install_requires. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thanks @LOCKhart07. Aligned Leaving the |
Summary
Replaces all 8 Python scripts from
scripts/with tomte CLI commands and plugin commands. After this PR,scripts/contains only data files (whitelist.py), git hooks, and docs.Tomte (0.6.5)
check_copyright.py→tomte check-copyright --author "Valory AG"check_doc_links.py→tomte check-doc-links(with URL skip flags)freeze_dependencies.py→tomte freeze-dependencies --exclude-package open-autonomyaea-ci-helpers (open-aea >= 2.2.0)
generate_package_list.py→aea-ci generate-pkg-listcheck_ipfs_hashes_pushed.py→aea-ci check-ipfs-pushedaea-helpers (OA plugin)
check_third_party_hashes.py→aea-helpers check-third-party-hashesgenerate_contract_list.py→aea-helpers generate-contract-listgenerate_api_documentation.py→aea-helpers generate-api-docs(OA-specific, scansautonomy/notaea/)Other changes
Scripts remaining
whitelist.py,pre-add,pre-push,RELEASE_PROCESS.md,__init__.pyTest plan
tox -e check-copyright— OKtox -e black-check— OKtox -e isort-check— OKtox -e flake8— OKtox -e check-api-docs— OKtox -e liccheck— OK🤖 Generated with Claude Code