Migrate style extra to a PEP 735 dependency group#1875
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yarikoptic
left a comment
There was a problem hiding this comment.
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. |
|
🚀 PR was released in |
Migrate the
styleextra (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
stylepart of #1873. Thetestextra is intentionally not migrated (it backs the shipped test suite that downstream repos run against releaseddandi, see this comment).Changes
Commit 1, migrate
style:styleout of[project.optional-dependencies]into[dependency-groups].dandi[style]from theallextra (extras cannot reference dependency groups).[tool.hatch.envs.style](the style deps were never used in an isolated env; lint runs viatox -e lint).DEVELOPMENT.md.Commit 2, consolidate hatch envs:
extensions,extras,tools,all.default,test, and adddev-all(features = ["all"]+dependency-groups = ["style"]): one environment with every dependency for local development.Verification that the
styleandallextras have no consumersSearched this repo, every
dandi-*sibling repo onmaster, and a workspace-wide literal sweep fordandi[style]/dandi[all]: the only reference anywhere was dandi-cli's ownpyproject.toml. So dropping them breaks nothing downstream.An isolated environment for an individual extra is still one command away when needed:
hatch shell, thenuv pip install -e ".[<extra>]".Test plan
hatch env show --jsonlists user envsdefault,test,dev-all;dev-allresolves tofeatures: ['all']+dependency-groups: ['style'].pyproject.tomlparses;styleis gone from extras and present in[dependency-groups];allextra no longer listsdandi[style].