Skip to content
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

bugfix - change jinja2 delimiters #1767

Closed

Conversation

liortct
Copy link
Contributor

@liortct liortct commented Aug 24, 2022

Addresses #1736 .

Fixed bug where NonTemplatedInputDirException exception was raised when change jinja2 delimiters via _jinja2_env_vars in the cookiecutter.json.
Also, added a unit-test for recreate this bug.

@stefan-caraiman
Copy link

Any news on this one?

liortct and others added 27 commits December 19, 2022 22:03
…kflow

Fix pip-publish workflow's setup python stage
…r-1.0.0-release

Prepare for release 1.0.0
@jack1902
Copy link

jack1902 commented Jan 4, 2023

@ericof - firstly, apologies on the @ but this PR is seriously needed else i have to use {% raw %} all over the place which is really messy (i've got a repo which has helm charts in there, which is used by my development team to generate an initial starting point to get going with all the good stuff used in other projects.

This change would ensure that i can use afformentioned _jinja2_env_vars feature which was merged recently. I do see this PR and #1666 appear to add similar functionality (haven't looked at them both in depth alongside one another to check if something is being missed)

@jack1902
Copy link

jack1902 commented Jan 4, 2023

For anyone who stumbles upon this in the future, if this hasn't been merged, a workaround i have been using which isn't perfect but gets the job done (i'd rather have a workaround for this than use {%raw%} all over the place

post_gen_project.py

Assumes you have the cookie contents within a folder such as {{<<cookiecutter.project_slug>>}}. The delimiters used aren't important, it just ensures that the delimeters you have used get read and enables you to create a cookie whilst waiting for this PR to get merged.

  import pathlib
  import shutil

  PROJECT_SLUG = "{{ cookiecutter.project_slug }}"
  OUTPUT_DIR = "{{ cookiecutter._output_dir }}"

  {% raw %}
  def move_resources():
    src = pathlib.Path().absolute()
    dest = pathlib.Path(OUTPUT_DIRECTORY)
    shutil.copytree(src, dest, dirs_exist_ok=True)
    shutil.rmtree(src)

  if __name__ == "__main__":
      move_resources()

  {% endraw %}

@liortct
Copy link
Contributor Author

liortct commented Jan 11, 2023

Hi @stefan-caraiman , @jack1902

We started working on a new community fork of the Cookiecutter project, named Cookieninja.
The fork is found at: https://github.com/cookieninja-generator/cookieninja

We have re-opened and merged your PR in the Cookieninja project at: cookieninja-generator/cookieninja#36

We're trying to bring the life back to this amazing project.
We are committed to reviewing and merging each PR in up to 2 weeks from the day it's opened (if there are no issues with it).
We'd really like you to join the fork, star it and contribute to it!

Thank you :)

Copy link
Member

@kurtmckee kurtmckee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️ ⚠️

@jensens @ericof @browniebroke Please close this PR. It hijacks the publishing workflow to publish cookiecutter to a different project name on PyPI.

@jensens jensens closed this Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants