James Parrott
James Parrott
Code from the gists for inspection, so you don't have to download random untrusted .py files: test_bug_148_original.py ``` r""" Commands to reproduce: python -m venv test_bug_148 Posix: source test_bug_148/bin.activate.sh Windows:...
There's no simple functionality in Jinja2 to base this on. ``` >>> import jinja2 >>> t = jinja2.Template(' context.val(: {{context.val}}) is {% if context.val %} truthy {% else %} falsey...
I didn't quite notice at first, that currently Cookiecutter already makes multiple rendering passes over the values in cookiecutter.json that are templates, to pick up self references. But by definition,...
I'm suggesting Yaml anchors, and that cookiecutter just lets a good Yaml library handle everything: ``` anchored_content: &anchor_name This string will appear as the value of two keys. other_anchor: *anchor_name...
Fair enough. It's still a huge change to start processing different data types, within what's essentially a sophisticated text/string global search/replace program, that delegates much of the text/string handling to...
Cookiecutter checks the values of cookiecutter.json, to see if any are Jinja2 templates or strings. https://cookiecutter.readthedocs.io/en/latest/advanced/templates_in_context.html From experimenting, it seems cookiecutter does not recurse through arbitrary many levels of nested...
Nice work Jun-Dai. :)
You have already installed cookiecutter in some venv, or even globally with `pip install cookiecutter`. You do not need to install cookiecutter again in its own special venv using pipx,...
You've definitely got it installed correctly now at least - so well done! From personal experience, not only is it its default mode, but I felt like cookiecutter really really...
For starters I used a yaml file of the form: ``` { 'default_context': { 'repo_name': ... 'drf': ... }, } ```