Repository navigation
Fix packaging, validation and CI issues found in review - #39
Merged
Merged
Conversation
- Generated project wheels no longer ship a top-level tests package
([tool.setuptools.packages.find] was including everything under the
project root instead of just the package).
- hooks/pre_gen_project.py now validates project names with
str.isidentifier()/keyword.iskeyword() instead of a hand-rolled regex,
so a project named e.g. "class" is correctly rejected and
single-character names are correctly accepted.
- Migrated to PEP 639 license metadata (license/license-files fields)
in both pyproject.toml files, dropping the deprecated
license = {file = ...} table and License :: classifiers.
cookiecutter.json's _pypi_license_map was renamed to
_spdx_license_map and now holds SPDX identifiers.
- Fixed three broken docs links in the root README.md (missing .md).
- Bumped actions/checkout and actions/setup-python to v7 in all
workflows, clearing the Node 20 deprecation warning.
- Bumped the minimum supported Python version to 3.11 and added 3.14
to the CI matrix, in both the repo and the template (3.10 reaches
EOL 2026-10-31).
- Wired pytest-cov into make test-unit in both trees (it was installed
and configured but never invoked).
- Set black's target-version to silence the "cannot parse code
formatted for a newer Python" warning.
- Dropped the unused wheel dependency from the template's
requirements.txt.
- Replaced the outdated .vscode/settings.json and extensions.json
(dead python.linting.*/python.formatting.provider settings, an
unmaintained TOML extension) with their current equivalents, in both
the repo and the template.
- Added .github/dependabot.yml for pip (both trees) and github-actions.
- tests/e2e/test_e2e.py now installs each generated project's
dependencies into its own throwaway venv instead of the environment
running the test suite, so it can't leak packages into it.
- Declared all Makefile targets .PHONY and documented the ARGS
passthrough on the test-* targets, in both trees.
- Wrote real content for docs/tool-choices.md and CONTRIBUTING.md
(root and template), which were previously stubs linked from the
README as if complete.
Verified locally with real dependencies (Python 3.11): check-style,
check-types, test-unit (with coverage), test-integration (all license
variants) and test-e2e all pass. Additionally baked a project with the
real cookiecutter CLI and confirmed: the built wheel has no tests/
package and correct License-Expression metadata with zero build
warnings, and check-version.sh/release-tag.sh still behave correctly.
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.
Fixes for a batch of issues found while reviewing the project after #37/#38.
Real bugs
testspackage.[tool.setuptools.packages.find]hadinclude = ["*"]/exclude = [], which picked uptests/(it has__init__.py). Anyonepip installing a generated package got atestsmodule dumped into site-packages. Fixed toinclude = ["<snake_case>*"]/exclude = ["tests*"]. Verified by building a real wheel:tests/is gone fromtop_level.txt.^[_a-zA-Z][_a-zA-Z0-9]+$required 2+ characters and didn't check keywords, so a project namedclasswould generate an unimportable package (import classis aSyntaxError), whilexor_were wrongly rejected. Replaced withstr.isidentifier() and not keyword.iskeyword(...). Added test cases for both../docs/development-instructions,./docs/tool-choices,./docs/project-structurewere all missing.md.CI deprecation warnings (confirmed from an actual Windows job log)
project.license as a TOML table is deprecated/License classifiers are deprecated, four times per build, in bothpyproject.tomls. Switched tolicense = "<SPDX id>"/license-files = ["LICENSE"]and dropped theLicense ::classifiers.cookiecutter.json's_pypi_license_mapis renamed_spdx_license_mapand now holds SPDX identifiers. Verified: rebuilt wheel now has zero warnings andLicense-Expression: MITin its metadata.actions/checkout/actions/setup-pythontov7(checked live viagh api, not guessed) in all four workflow files.target-version = ["py311"]in bothpyproject.tomls.Cleanup
pytest-covwas installed and configured but never actually invoked — wired--covintomake test-unitin both trees.wheeldev dependency from the template (the build backend supplies it via the isolated build env)..vscode/settings.json/extensions.jsonreferenced settings and an extension (python.linting.*,python.formatting.provider,bungcip.better-toml) that no longer exist/are unmaintained; replaced with current equivalents, in both the repo and the template..github/dependabot.ymlforpip(both trees) andgithub-actions.tests/e2e/test_e2e.py'smake initwas installing the generated project's dependencies into whatever environment ran the test suite. It now creates a throwaway venv per baked project..PHONY, documented theARGSpassthrough ontest-*targets.docs/tool-choices.mdandCONTRIBUTING.md(root and template) — both were stubs linked from the README as if complete.Testing
All run locally with real dependencies (Python 3.11), not simulated:
make check-style/make check-types— passmake test-unit(now with coverage) — 24/24 passmake test-integration— 18/18 pass, across all license variants (exercises the new SPDX license logic through the realcookiecutterrenderer)make test-e2e(with the new per-project venv isolation) — 2/2 passcookiecutterCLI and confirmed: renderedpyproject.toml/workflows are correct, the built wheel has notests/package and correctLicense-Expressionmetadata with zero build warnings,check-version.sh/release-tag.shstill behave correctly, andmake test-unit/check-style/check-typesall pass inside the generated projectKnown caveat
.github/dependabot.yml'sdirectory: "/{{cookiecutter.__project_name_kebab_case}}"entry parses as valid YAML but wasn't validated against GitHub's actual Dependabot config parser (that needs a live push). Worth checking the Dependabot "Insights" tab after this merges.🤖 Generated with Claude Code