Skip to content

Migrate style extra to a PEP 735 dependency group#1875

Merged
candleindark merged 2 commits into
dandi:masterfrom
candleindark:migrate-style-to-dependency-group
Jun 4, 2026
Merged

Migrate style extra to a PEP 735 dependency group#1875
candleindark merged 2 commits into
dandi:masterfrom
candleindark:migrate-style-to-dependency-group

Conversation

@candleindark
Copy link
Copy Markdown
Member

@candleindark candleindark commented Jun 4, 2026

Migrate the style extra (flake8, pre-commit) to a PEP 735 [dependency-groups] table, since those are pure development tooling never installed by consumers of the published package. Also trims the hatch environments down to the ones actually used.

Closes the style part of #1873. The test extra is intentionally not migrated (it backs the shipped test suite that downstream repos run against released dandi, see this comment).

Changes

Commit 1, migrate style:

  • Move style out of [project.optional-dependencies] into [dependency-groups].
  • Drop dandi[style] from the all extra (extras cannot reference dependency groups).
  • Remove [tool.hatch.envs.style] (the style deps were never used in an isolated env; lint runs via tox -e lint).
  • Update the env-list example in DEVELOPMENT.md.

Commit 2, consolidate hatch envs:

  • Remove the thin per-extra envs extensions, extras, tools, all.
  • Keep default, test, and add dev-all (features = ["all"] + dependency-groups = ["style"]): one environment with every dependency for local development.
Verification that the style and all extras have no consumers

Searched this repo, every dandi-* sibling repo on master, and a workspace-wide literal sweep for dandi[style] / dandi[all]: the only reference anywhere was dandi-cli's own pyproject.toml. So dropping them breaks nothing downstream.

An isolated environment for an individual extra is still one command away when needed: hatch shell, then uv pip install -e ".[<extra>]".

Test plan

  • hatch env show --json lists user envs default, test, dev-all; dev-all resolves to features: ['all'] + dependency-groups: ['style'].
  • pyproject.toml parses; style is gone from extras and present in [dependency-groups]; all extra no longer lists dandi[style].
  • CI lint/typing/test jobs pass (they use tox, unaffected by these changes).

candleindark and others added 2 commits June 3, 2026 22:07
The style dependencies (flake8, pre-commit) are pure development tooling
that are never installed by downstream consumers of the published package,
so they belong in a non-published [dependency-groups] table rather than in
[project.optional-dependencies].

- Move style out of optional-dependencies into [dependency-groups].
- Drop dandi[style] from the all extra (extras cannot reference dependency
  groups, and all had no consumers anyway).
- Remove the [tool.hatch.envs.style] environment; the style dependencies
  were never used in an isolated environment (lint CI uses tox -e lint).
- Update DEVELOPMENT.md example env list accordingly.

Verified that the style and all extras have no consumers across the DANDI
suite repositories.

Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.8 <noreply@anthropic.com>
Most of the per-extra hatch environments (extensions, extras, tools, all)
were thin one-line wrappers that installed a single extra; they added
clutter and were not needed. Remove them, keeping only the environments
that are actually used day to day:

- default: base development environment
- test: runs the test suite
- dev-all: a single environment with every dependency for local
  development, installing all project extras (the all extra) plus the
  development-only style dependency group

An isolated environment for an individual extra is still a command away
when needed: enter the default env with `hatch shell` and
`uv pip install -e ".[<extra>]"`.

Co-Authored-By: Claude Code 2.1.162 / Claude Opus 4.8 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.75%. Comparing base (5101d98) to head (abc444b).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1875      +/-   ##
==========================================
+ Coverage   76.74%   76.75%   +0.01%     
==========================================
  Files          87       87              
  Lines       12788    12788              
==========================================
+ Hits         9814     9816       +2     
+ Misses       2974     2972       -2     
Flag Coverage Δ
unittests 76.75% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@candleindark candleindark added configuration potentially pointing to configuration parameters to be defined etc dependencies Update one or more dependencies version labels Jun 4, 2026
@candleindark candleindark requested a review from yarikoptic June 4, 2026 16:42
Copy link
Copy Markdown
Member

@yarikoptic yarikoptic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kinda see why it might need to be different but imho it is a bit of overengineering as only introduces yet another way to install components necessary for my work on it

@candleindark candleindark merged commit a30de62 into dandi:master Jun 4, 2026
72 of 75 checks passed
@candleindark candleindark deleted the migrate-style-to-dependency-group branch June 4, 2026 19:54
@candleindark
Copy link
Copy Markdown
Member Author

I kinda see why it might need to be different but imho it is a bit of overengineering as only introduces yet another way to install components necessary for my work on it

It seems to be over-engineering at this point since there is only one dependency group. It will not be so once there are more groups of dependencies define for development usage. I proposed #1876 to consolidate more group of dependencies used for development.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

🚀 PR was released in 0.76.4 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration potentially pointing to configuration parameters to be defined etc dependencies Update one or more dependencies version released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants