Problem
aea-helpers check-dependencies (invoked by tox -e check-dependencies) reads [tool.poetry.dependencies] from pyproject.toml to validate that declared deps match the actual imports in autonomy/, packages/valory/**, plugins/. Two behaviours make it impossible to cleanly model dev-only / optional deps:
- Entries with
optional = true are ignored unless a matching [tool.poetry.extras] lists them. Forces the maintainer to fake an extra just to declare a dep.
- Entries in
[tool.poetry.group.dev.dependencies] are not read at all — a dev-only runtime import (e.g. the legacy slow-tendermint test helper's use of Flask) has to be duplicated into main deps to pass the check, then explained with a comment.
Current workaround
See PR #2477's pyproject.toml, the TODO(cleanup) block. Three entries (protobuf, pytest-asyncio, Flask, Werkzeug) live under main deps with an inline comment explaining they only exist to satisfy check-dependencies. The runtime autonomy wheel doesn't ship them via setup.py.
Desired behaviour
aea-helpers check-dependencies should:
- Read
[tool.poetry.group.dev.dependencies] alongside the main group, so dev-only imports don't need to be shimmed into main deps.
- Treat
[tool.poetry.dependencies] entries with optional = true as declared (no need to cross-reference extras for the "is this declared" check; extras only matter for install resolution).
This eliminates the need for the TODO(cleanup) block in pyproject.toml.
Context
See PR #2477 review #2477 (comment) (non-blocker #10).
Problem
aea-helpers check-dependencies(invoked bytox -e check-dependencies) reads[tool.poetry.dependencies]frompyproject.tomlto validate that declared deps match the actual imports inautonomy/,packages/valory/**,plugins/. Two behaviours make it impossible to cleanly model dev-only / optional deps:optional = trueare ignored unless a matching[tool.poetry.extras]lists them. Forces the maintainer to fake an extra just to declare a dep.[tool.poetry.group.dev.dependencies]are not read at all — a dev-only runtime import (e.g. the legacy slow-tendermint test helper's use ofFlask) has to be duplicated into main deps to pass the check, then explained with a comment.Current workaround
See PR #2477's
pyproject.toml, theTODO(cleanup)block. Three entries (protobuf,pytest-asyncio,Flask,Werkzeug) live under main deps with an inline comment explaining they only exist to satisfycheck-dependencies. The runtime autonomy wheel doesn't ship them viasetup.py.Desired behaviour
aea-helpers check-dependenciesshould:[tool.poetry.group.dev.dependencies]alongside the main group, so dev-only imports don't need to be shimmed into main deps.[tool.poetry.dependencies]entries withoptional = trueas declared (no need to cross-reference extras for the "is this declared" check; extras only matter for install resolution).This eliminates the need for the
TODO(cleanup)block inpyproject.toml.Context
See PR #2477 review #2477 (comment) (non-blocker #10).