You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generated projects have no .copier-answers.yml, so copier update cannot bring template fixes into them #14
There is no {{ _copier_conf.answers_file }}.jinja under template/ (_subdirectory: template, copier.yml:43). Without it, Copier writes no answers file, so a render records neither its answers nor the template commit it came from. copier update refuses to run, and the only way to get a template fix into an existing library is to copy it by hand. #8 (the ruff config) and #9 (docs.yml) are recent examples. None of the org's libraries has the file: I checked all 15 repos that have a publish.yml.
ls: cannot access 'demo-lib/.copier-answers.yml': No such file or directory
Cannot update because cannot obtain old template references from `.copier-answers.yml`.
gh: Not Found (HTTP 404)
gh: Not Found (HTTP 404)
gh: Not Found (HTTP 404)
gh: Not Found (HTTP 404)
Why
#3 made this template the source of the org standard, and fixes keep landing here. Each fix then has to be redone by hand in every library, and nothing records which template commit a library was generated from, so there is no way to tell which fixes a library already has.
Proposal
Add template/{{_copier_conf.answers_file}}.jinja:
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
{{ _copier_answers|to_nice_yaml -}}
I tried this on a local clone. The render then contains _commit, _src_path and the answers. After a template commit that raised the pytest floor, copier update --trust --defaults --vcs-ref HEAD in the render applied exactly that change (pyproject.toml | 2 +-, plus _commit in the answers file).
For the existing libraries, write the file by hand: _src_path: gh:bedrock-python/python-library-template, the answers, and as _commit the template commit each library was generated from (or the closest one). Then run copier update. The template has no tags, so copier update uses the default branch HEAD and versions it as 0.0.0.postN.devN+sha. Tagging template releases would make the jumps readable.
Plan: add template/{{_copier_conf.answers_file}}.jinja as proposed. I considered other ways to record the source and found none: Copier reads the answers file and nothing else. I tried it with Copier 9.19.1. The render gets _commit, _src_path and the answers, and after a later template commit copier update --trust --defaults applied just that commit's change.
Two more changes that become necessary once update works:
The post-generation _tasks message runs on copier update too and prints "Template generated. Next steps…" into a library that was set up long ago. It gets when: "{{ _copier_operation == 'copy' }}".
The template's CI renders, commits the render, and runs copier update in it. A template change that breaks update then fails the PR instead of the next library's update.
The README gets a short "Pulling template changes into a library" section. Backfilling the answers file in the existing libraries is a per-library follow-up (_commit has to be the template commit each one is closest to), and I'm not making it here.
The fix is in #21: the answers file, the post-generation message on copy only, and a CI job that updates a render of master to the PR commit and diffs it against a fresh render. The README section the PR adds covers backfilling the file in the existing libraries.
Activity
AlexeyShalaev commentedon Oct 16, 2026
Plan: add
template/{{_copier_conf.answers_file}}.jinjaas proposed. I considered other ways to record the source and found none: Copier reads the answers file and nothing else. I tried it with Copier 9.19.1. The render gets_commit,_src_pathand the answers, and after a later template commitcopier update --trust --defaultsapplied just that commit's change.Two more changes that become necessary once update works:
_tasksmessage runs oncopier updatetoo and prints "Template generated. Next steps…" into a library that was set up long ago. It getswhen: "{{ _copier_operation == 'copy' }}".copier updatein it. A template change that breaks update then fails the PR instead of the next library's update.The README gets a short "Pulling template changes into a library" section. Backfilling the answers file in the existing libraries is a per-library follow-up (
_commithas to be the template commit each one is closest to), and I'm not making it here.feat: renders record their answers, so copier update can reach them
AlexeyShalaev commentedon Oct 16, 2026
The fix is in #21: the answers file, the post-generation message on copy only, and a CI job that updates a render of master to the PR commit and diffs it against a fresh render. The README section the PR adds covers backfilling the file in the existing libraries.