Repository navigation
feat: optional example, data/ML setup and protected project files - #2
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 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.
Adds three Copier questions, prompted by retrofitting the template into fraud-alert-explainer. All are off by default: with the defaults, a generated project is byte-for-byte the same as v0.3.0 (only
.copier-answers.ymlrecords the new answers).include_examplehello()and its tests (and the CLI'sgreet), keeping only__version__. The bare CLI keeps itsversionsubcommand via a Typer callback.include_data_sciencepandas-stubsandipykernel, a mypy override forsklearn.*,notebooks/excluded from Ruff,data/+artifacts/gitignored, CLAUDE.md notes, andbrew install libompon macOS CI. Without libomp, LightGBM fails to import onmacos-latest, which is what broke fraud-alert-explainer's first CI run.protect_project_filescopier updateskipREADME.md,CHANGELOG.mdand the package__init__.pyonce they exist (_skip_if_exists, with patterns that render to nothing when off).Why only those three files are protected: copier recreates a
_skip_if_existsfile the project deleted (checked in copier 9.19's_main.py). So the list only holds files a project keeps but rewrites, not placeholders it might delete.To make the data option possible:
.gitignoreandci.ymlbecame.jinjafiles. The CI file wraps its GitHub expressions in{% raw %}per CONTRIBUTING.Verification (Windows, copier 9.19.1)
make testpasses: 33 hook tests, plus four rendered variants (default, CLI, bare CLI withinclude_example=false, data withinclude_data_science+protect_project_fileson), each running ruff, ruff format, mypy strict and pytest with the coverage gate. The two new variants are added tomake test, so CI covers them on all three OSes.make checkrun inside each rendered project: all four pass.--vcs-ref=v0.3.0:diff -ris identical apart from.copier-answers.yml. This caught two whitespace bugs, both fixed.LogisticRegressionmodule and a test):make checkpasses under mypy strict.data/raw.csvstays untracked andnotebooks/README.mdis tracked. Both rendered workflows parse as YAML.copier updatetest against a throwaway template clone tagged v0.9.0 → v0.9.1, where the update changes README, CHANGELOG,__init__.pyand CLAUDE.md, and the project has rewritten the first three:protect_project_files=true: the three project files are untouched and CLAUDE.md gets the update.protect_project_files=false: the same as today, with conflict markers in all three files.copier update -d protect_project_files=trueon a project made without it): README kept, answer recorded.Not verified: the macOS
brew install libompstep in a rendered project's CI. It's the same step that fixed fraud-alert-explainer's macOS CI.Release
CHANGELOG has a
0.4.0section. After merging, tag on main:git tag -a v0.4.0 -m v0.4.0 && git push --follow-tags.🤖 Generated with Claude Code