Repository navigation
fix(template): ship a src-layout starter package and smoke test - #37
Merged
Merged
Conversation
A fresh render failed scripts/check.sh (pytest exit 5, no tests) and the starter build-system could not build a flat-layout package. Declare [tool.setuptools.packages.find] where = ["src"] and create the starter src package, py.typed and tests/test_import.py from a copy-only _tasks entry, so `copier update` never adds them to existing consumers. The copy now needs --trust; package_name is validated to start with a letter or underscore. Refs #33 Co-Authored-By: Claude Sonnet 5.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.
Summary
A fresh render failed
scripts/check.sh(pytest exit 5, no tests) and the starter[build-system]could not build a flat-layout package. The template now declares asrclayout andcopier copycreates a starter package and smoke test.Issues
Refs #33
Changes
template/pyproject.toml.jinja:[tool.setuptools.packages.find] where = ["src"].copier.yml: a_tasksentry gated on_copier_operation == 'copy'(skipped when the repo already has a Python package, so--overwriteadoption keeps its layout) createssrc/<module>/__init__.py,py.typedandtests/test_import.pywhen missing. Template files were rejected becausecopier updatewould add them to existing consumers.package_moduleis a derivedwhen: falsequestion;package_namegets a validator (leading letter or underscore, not a Python keyword).copier copynow needs--trust(tasks); docs, README, AGENTS.md validate command andscripts/tests/agent-template.shupdated.Test plan
package_name=My-Pkgwith--trust,uv lock,bash scripts/check.sh: passes (1 test).copier update --trustto this commit: nosrc/ortests/added.bash scripts/tests/agent-template.sh <check-project-agents.py>: passes.Screenshots
N/A
Risk
Intent change, depth standard: localized template behavior with understood contracts.
copier copynow requires--trust;copier updateis unaffected for existing consumers.How to revert
Revert the squash commit.
Deployment notes
Merging a
fix:PR makes Release Please publish a patch release (v6.0.1 expected).Post-deploy verification
N/A
🤖 Generated with Claude Code