Skip to content

Fix packaging, validation and CI issues found in review - #39

Merged
ali92hm merged 1 commit into
masterfrom
fix-review-findings
Sep 27, 2026
Merged

ali92hm merged 1 commit into
masterfrom
fix-review-findings

Conversation

@ali92hm

@ali92hm ali92hm commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Fixes for a batch of issues found while reviewing the project after #37/#38.

Real bugs

  • Generated project wheels no longer ship a top-level tests package. [tool.setuptools.packages.find] had include = ["*"]/exclude = [], which picked up tests/ (it has __init__.py). Anyone pip installing a generated package got a tests module dumped into site-packages. Fixed to include = ["<snake_case>*"]/exclude = ["tests*"]. Verified by building a real wheel: tests/ is gone from top_level.txt.
  • Project-name validation accepted Python keywords and rejected single-character names. The hand-rolled regex ^[_a-zA-Z][_a-zA-Z0-9]+$ required 2+ characters and didn't check keywords, so a project named class would generate an unimportable package (import class is a SyntaxError), while x or _ were wrongly rejected. Replaced with str.isidentifier() and not keyword.iskeyword(...). Added test cases for both.
  • Three broken links in the root README — ./docs/development-instructions, ./docs/tool-choices, ./docs/project-structure were all missing .md.

CI deprecation warnings (confirmed from an actual Windows job log)

  • PEP 639 license migration: project.license as a TOML table is deprecated / License classifiers are deprecated, four times per build, in both pyproject.tomls. Switched to license = "<SPDX id>" / license-files = ["LICENSE"] and dropped the License :: classifiers. cookiecutter.json's _pypi_license_map is renamed _spdx_license_map and now holds SPDX identifiers. Verified: rebuilt wheel now has zero warnings and License-Expression: MIT in its metadata.
  • Node 20 deprecation: bumped actions/checkout/actions/setup-python to v7 (checked live via gh api, not guessed) in all four workflow files.
  • Black interpreter-version warning: set target-version = ["py311"] in both pyproject.tomls.

Cleanup

  • pytest-cov was installed and configured but never actually invoked — wired --cov into make test-unit in both trees.
  • Dropped the unused wheel dev dependency from the template (the build backend supplies it via the isolated build env).
  • .vscode/settings.json/extensions.json referenced 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.
  • Added .github/dependabot.yml for pip (both trees) and github-actions.
  • tests/e2e/test_e2e.py's make init was installing the generated project's dependencies into whatever environment ran the test suite. It now creates a throwaway venv per baked project.
  • Declared all Makefile targets .PHONY, documented the ARGS passthrough on test-* targets.
  • Wrote real content for docs/tool-choices.md and CONTRIBUTING.md (root and template) — both were stubs linked from the README as if complete.
  • Bumped the minimum supported Python version to 3.11 and added 3.14 to the CI matrix (3.10 reaches EOL 2026-10-31 — checked live, not assumed).

Testing

All run locally with real dependencies (Python 3.11), not simulated:

  • make check-style / make check-types — pass
  • make test-unit (now with coverage) — 24/24 pass
  • make test-integration — 18/18 pass, across all license variants (exercises the new SPDX license logic through the real cookiecutter renderer)
  • make test-e2e (with the new per-project venv isolation) — 2/2 pass
  • Manually baked a project with the real cookiecutter CLI and confirmed: rendered pyproject.toml/workflows are correct, the built wheel has no tests/ package and correct License-Expression metadata with zero build warnings, check-version.sh/release-tag.sh still behave correctly, and make test-unit/check-style/check-types all pass inside the generated project

Known caveat

.github/dependabot.yml's directory: "/{{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

- 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>
@ali92hm
ali92hm merged commit 016fca5 into master Sep 27, 2026
12 checks passed
@ali92hm
ali92hm deleted the fix-review-findings branch September 27, 2026 23:54
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