canonical / canonical/observability
Use dependency-groups instead of optional-dependencies in charms
- Dominant language
- Just
- Stars
- 10
- Forks
- 25
- Avg merge
- 6h 3m
- Merged PRs (30d)
- 7
Description
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
Contributor guide
Research direction
Review the charms' pyproject.toml files and the CI/tox configuration that installs test dependencies. Identify uses of optional-dependencies and --extra or --all-extras, then compare them with the dependency-groups and --group or --all groups behavior described in the issue. Done means the relevant projects and CI paths consistently use dependency groups for test dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, ci-cd
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100