Copier Template Extensions (copier-template-extensions) is a specialized Jinja2 extension for Copier, enabling the loading of other Jinja2 extensions using file paths relative to the template root, rather than standard Python dotted paths. As of version 0.3.3, it offers improved migration support. The project maintains an active release cadence with periodic updates.
pip install copier-template-extensionsVerified import paths — ran on the pinned version, not inferred.
To enable `copier-template-extensions`, include its module path in the `_extensions` list within your `copier.yaml`. This allows Copier to load other Jinja2 extensions specified by relative file paths within your template, such as `my_template_utils.py` shown here. The example demonstrates a custom filter named `custom_filter`.
Update your `pip install` commands and all references in `copier.yaml` and Python code from `copier_templates_extensions` to `copier_template_extensions`.
Ensure your `copier` installation is updated to version 9.2 or newer (`pip install --upgrade copier`).
Always include `"copier_template_extensions.CopierExtension"` in the `_extensions` list in your `copier.yaml` when you intend to use relative paths for other extensions.