Repository navigation
Move dev dependencies from requirements.txt into pyproject.toml - #41
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces
requirements.txtwith[dependency-groups] devinpyproject.toml(PEP 735), in both the repo and the template, and drops thetomlitest dependency in favor of the standard librarytomllib(Python 3.11+).What changed
pyproject.toml(both trees): new[dependency-groups] devtable with the same pinsrequirements.txthad. Root keepscookiecutter/pytest-cookiesfor baking/testing the template; the template keepspytest-mockinstead, matching the prior intentional divergence.requirements.txtdeleted in both trees.Makefile(both trees):make initis nowpip install --group dev, which needs pip >= 25.1 (when the--groupflag landed). No fallback or auto-upgrade step — an old pip fails loudly with a clearno such option: --grouperror, which is preferable to silently doing the wrong thing.tests/integration/test_generator.py:import tomli→import tomllib; also fixes two assertions that still expectedrequirements.txt/.flake8to exist in the generated project (same class of miss as the.flake8removal earlier), and adds a positive assertion that the renderedpyproject.toml's dev group actually containsruff/mypy.CLAUDE.md,development-instructions.md,project-structure.md,tool-choices.md) andCHANGELOG.mdupdated to match..github/dependabot.ymlneeded no changes — verified againstdependabot-core's actual parser (pyproject_document.rbchecks@data.key?("dependency-groups"), with a test fixture using the same flatdev = [...]shape we use) that it already understands PEP 735.Testing
All run locally with real pip (26.2.1), not simulated:
pip install --group devfrom a clean venv correctly resolves and installs all direct deps plus transitivesmake check-style/make check-types— passmake test-unit— 24/24 passmake test-integration— 18/18 passmake test-e2e(bakes the template, runs the generated project's ownmake initinside an isolated venv) — 2/2 pass. Inspected that venv afterward and confirmedpip install --group devgenuinely installedruff/mypy/pytest-mockthere, reading the template's own renderedpyproject.toml.pip==24.0withpip install --group devfails immediately withno such option: --group, exit code 2.🤖 Generated with Claude Code