Skip to content

Use dependency-groups instead of optional-dependencies in charms #389

@lucabello

Description

@lucabello

From a café topic, @ca-scribner reported that the way we currently set up our test dependencies in pyproject.toml is incorrect.

There's a distinction between:

  • dependency-groups: test dependencies that won't ship with the code
  • optional-dependencies: deps that ship with the code as optional additional installs (e.g., mypackage[extra-thing])

We currently use optional-dependencies to capture our test dependencies. As part of this issue, we should go through all of our charms (and probably projects in general) to make sure we start using dependency-groups instead.

Note: this also require a CI / tox change; instead of installing things with the --extra X or --all-extras flag, we should change that to --group X or --all groups.

More context: https://discourse.charmhub.io/t/charm-techs-positive-experience-with-uv-tox-uv/18059/3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions