Skip to content

Move dev dependencies from requirements.txt into pyproject.toml - #41

Merged
ali92hm merged 2 commits into
masterfrom
move-deps-to-pyproject
Sep 28, 2026
Merged

ali92hm merged 2 commits into
masterfrom
move-deps-to-pyproject

Conversation

@ali92hm

@ali92hm ali92hm commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Replaces requirements.txt with [dependency-groups] dev in pyproject.toml (PEP 735), in both the repo and the template, and drops the tomli test dependency in favor of the standard library tomllib (Python 3.11+).

What changed

  • pyproject.toml (both trees): new [dependency-groups] dev table with the same pins requirements.txt had. Root keeps cookiecutter/pytest-cookies for baking/testing the template; the template keeps pytest-mock instead, matching the prior intentional divergence.
  • requirements.txt deleted in both trees.
  • Makefile (both trees): make init is now pip install --group dev, which needs pip >= 25.1 (when the --group flag landed). No fallback or auto-upgrade step — an old pip fails loudly with a clear no such option: --group error, which is preferable to silently doing the wrong thing.
  • tests/integration/test_generator.py: import tomli → import tomllib; also fixes two assertions that still expected requirements.txt/.flake8 to exist in the generated project (same class of miss as the .flake8 removal earlier), and adds a positive assertion that the rendered pyproject.toml's dev group actually contains ruff/mypy.
  • Docs (CLAUDE.md, development-instructions.md, project-structure.md, tool-choices.md) and CHANGELOG.md updated to match.

.github/dependabot.yml needed no changes — verified against dependabot-core's actual parser (pyproject_document.rb checks @data.key?("dependency-groups"), with a test fixture using the same flat dev = [...] shape we use) that it already understands PEP 735.

Testing

All run locally with real pip (26.2.1), not simulated:

  • pip install --group dev from a clean venv correctly resolves and installs all direct deps plus transitives
  • make check-style / make check-types — pass
  • make test-unit — 24/24 pass
  • make test-integration — 18/18 pass
  • make test-e2e (bakes the template, runs the generated project's own make init inside an isolated venv) — 2/2 pass. Inspected that venv afterward and confirmed pip install --group dev genuinely installed ruff/mypy/pytest-mock there, reading the template's own rendered pyproject.toml.
  • Explicitly tested the failure mode: pip==24.0 with pip install --group dev fails immediately with no such option: --group, exit code 2.

🤖 Generated with Claude Code

ali92hm and others added 2 commits September 28, 2026 16:22
Replaces requirements.txt with [dependency-groups] dev in pyproject.toml
(PEP 735), in both the repo and the template, and drops the tomli test
dependency in favor of the standard library tomllib (Python 3.11+).

- pyproject.toml (both trees): new [dependency-groups] dev table with
  the same pins requirements.txt had. Root keeps cookiecutter/
  pytest-cookies for baking/testing the template; the template keeps
  pytest-mock instead, matching the prior intentional divergence.
- requirements.txt deleted in both trees.
- Makefile (both trees): `make init` is now `pip install --group dev`,
  which needs pip >= 25.1 (when the --group flag landed). No fallback
  or auto-upgrade step - an old pip fails loudly with a clear
  "no such option: --group" error, which is preferable to silently
  doing the wrong thing.
- tests/integration/test_generator.py: import tomli -> import tomllib;
  also fixes two assertions that still expected requirements.txt/.flake8
  to exist in the generated project (same class of miss as the .flake8
  removal earlier), and adds a positive assertion that the rendered
  pyproject.toml's dev group actually contains ruff/mypy.
- Docs (CLAUDE.md, development-instructions.md, project-structure.md,
  tool-choices.md) and CHANGELOG.md updated to match.

.github/dependabot.yml needed no changes - verified against
dependabot-core's actual parser (pyproject_document.rb checks
@data.key?("dependency-groups"), with a test fixture using the same
flat dev = [...] shape we use) that it already understands PEP 735.

Verified locally with real pip (26.2.1): `pip install --group dev` from
a clean venv correctly resolves and installs all direct deps plus
transitives. check-style, check-types, test-unit (24/24) and
test-integration (18/18) all pass. test-e2e (2/2) bakes the template
and runs the generated project's own make init inside an isolated venv;
inspected that venv afterward and confirmed pip install --group dev
genuinely installed ruff/mypy/pytest-mock there. Also explicitly tested
the failure mode: pip==24.0 with `pip install --group dev` fails
immediately with "no such option: --group", exit code 2.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The e2e test creates a fresh venv per baked project and runs the
generated project's own `make init` (`pip install --group dev`) inside
it. On the 3.11 and 3.12 CI legs, that venv's ensurepip-bundled pip
predates 25.1 (when --group/PEP 735 landed), so it failed with:

    no such option: --group

The outer CI environment's own pip (provisioned by actions/setup-python)
was unaffected, which is why check-style/check-types/test-unit/
test-integration all passed before test-e2e hit this.

Upgrade pip inside the freshly created venv before using it.

Verified: reproduced the exact failure locally by installing pip==24.0
into a venv and running `pip install --group dev` against it (same
"no such option: --group" error), confirmed `python -m pip install
--upgrade pip` resolves it and `--group dev` then installs correctly,
and ran the full local suite (check-style, check-types, test-e2e) with
the fix applied.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ali92hm
ali92hm merged commit a5e6dbc into master Sep 28, 2026
12 checks passed
@ali92hm
ali92hm deleted the move-deps-to-pyproject branch September 28, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant