copier-templates-extensions (deprecated, use copier-template-extensions)

raw JSON →
0.3.3 verified Mon Apr 27 auth: no python deprecated

Deprecated package. The project has been renamed to `copier-template-extensions` (singular). Install the new package instead. Current version 0.3.3 provides backward-compatible shims for the old import paths.

pip install copier-template-extensions
error ModuleNotFoundError: No module named 'copier_template_extensions'
cause You installed the old package name but used the new singular import path, or vice versa.
fix
Install the correct package: pip install copier-template-extensions (singular). Then use: from copier_template_extensions import ContextHook
error ImportError: cannot import name 'ContextHook' from 'copier_templates_extensions'
cause You are using the old plural package name but the import path changed.
fix
Switch to the new singular package: pip install copier-template-extensions, then use: from copier_template_extensions import ContextHook
error AttributeError: module 'copier_templates_extensions' has no attribute 'ContextHook'
cause Old package stopped exporting ContextHook directly after rename (shims may be incomplete).
fix
Install and import from the new package: pip install copier-template-extensions; from copier_template_extensions import ContextHook
breaking Package renamed from 'copier-templates-extensions' to 'copier-template-extensions' (singular). The old package is deprecated and will no longer receive updates.
fix pip uninstall copier-templates-extensions && pip install copier-template-extensions
breaking The import path changed: from 'copier_templates_extensions' (plural) to 'copier_template_extensions' (singular). Old imports will break in future versions.
fix Change imports to 'from copier_template_extensions import ...'
deprecated The old package (copier-templates-extensions) is deprecated. Installing it will pull in the new package but this compatibility shim may be removed.
fix Install copier-template-extensions directly.
gotcha Requires Copier >= 9.2. If you have an older Copier version, the extensions may fail to load.
fix Upgrade Copier: pip install --upgrade copier

Basic usage of ContextHook. Note the singular import path.

# Install the new package
# pip install copier-template-extensions

from copier_template_extensions import ContextHook

class MyHook(ContextHook):
    def hook(self, context: dict) -> dict:
        context['my_key'] = 'value'
        return context