-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: ContextHook is executed for before each question since copier 9.4 #7
Comments
Thanks for the report @noirbizarre, I was able to reproduce the issue with my own template. I suppose we have to find a new way to detect when is the right time to run then 🤔 EDIT: ah, that's exactly what you say in the other issue 👍
|
I have trouble replicating the bug programmatically 🤔 Not providing data to |
Erm I can't reproduce this issue anymore 🤔 Could you provide a script/zip that does? |
Description of the bug
Since copier 9.4, since copier-org/copier#1840 more precisely (I think),
ContextHoook.hook
is called before each question during the update phase.This is due to
_copier_conf
being already present during update questions, cf. https://github.com/copier-org/copier-templates-extensions/blob/main/src/copier_templates_extensions/extensions/context.py#L46To Reproduce
copier>=9.4.0
ContextUpdater
as extensionctx["the_question"]
in theContextHook.hook
methodcopier copy
on the templatecopier update
on the generated projectKeyError
Full traceback
Full traceback
Expected behavior
One of:
ContextHook
only run in the project rendering phase (was the case forcopier<9.4
)ContextHook
has a way to know all questions have been answeredAdditional context
I fill this issue for tracking, but I am also filling a feature request/proposal on copier to have a stable solution: copier-org/copier#1883
The text was updated successfully, but these errors were encountered: