Skip to content

check-dependencies: support [dev-dependencies] and optional = true entries #2480

@DavidMinarsch

Description

@DavidMinarsch

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:

  1. 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.
  2. 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions