fix: move dev dependencies to hatch env so they don't leak into runtime

pre-commit was leaking into `requires_dist` since v0.24.2 because the
dev deps were declared under [tool.poetry.group.dev.dependencies] while
the build backend is hatchling.  Some versions of hatchling/pip treat
[tool.poetry.group.*.dependencies] as optional/extra dependencies,
causing pre-commit (and its transitive deps) to be installed as a
runtime requirement for all users of the library.

Replace [tool.poetry.group.dev.dependencies] with a proper
[tool.hatch.envs.dev.dependencies] section, which is the native way to
declare development-only dependencies when using hatchling as the build
backend.  These entries are never included in the wheel's metadata, so
they will not appear in `requires_dist` or in `pip show diagrams`.

Fixes #1193
pull/1248/head
Harini 4 weeks ago
parent 364c61d478
commit 24263f7e67

@ -23,13 +23,13 @@ diagrams = "diagrams.cli:main"
Homepage = "https://diagrams.mingrammer.com"
Repository = "https://github.com/mingrammer/diagrams"
[tool.poetry.group.dev.dependencies]
pytest = "^8.3"
pylint = "^3.3"
rope = "^1.13"
isort = "^6.0"
black = "^24.4"
pre-commit = "^4.0"
[tool.hatch.envs.dev.dependencies]
pytest = ">=8.3,<9"
pylint = ">=3.3,<4"
rope = ">=1.13,<2"
isort = ">=6.0,<7"
black = ">=24.4,<25"
pre-commit = ">=4.0,<5"
[tool.hatch.build]
only-include = ["diagrams", "resources"]

Loading…
Cancel
Save