Skip to content

Inline jinja2-time extension code#1779

Merged
ericof merged 2 commits intocookiecutter:mainfrom
tranzystorekk:inline-jinja2-time
Jun 13, 2023
Merged

Inline jinja2-time extension code#1779
ericof merged 2 commits intocookiecutter:mainfrom
tranzystorekk:inline-jinja2-time

Conversation

@tranzystorekk
Copy link
Copy Markdown
Contributor

Closes #1755

This is the jinja2-time code copied almost verbatim, save for minute modern python code changes, and the hackebrot/jinja2-time#19 patch for compatibility across more arrow versions.

Didn't specify arrow version in requirements since I wasn't sure what to put there.

@cookiecutter cookiecutter deleted a comment from yuvaldolev Jun 13, 2023
@ericof ericof added this to the 2.2.0 milestone Jun 13, 2023
@ericof ericof added the feature This issue/PR relates to major feature request. label Jun 13, 2023
@ericof ericof self-requested a review June 13, 2023 13:45
Copy link
Copy Markdown
Member

@ericof ericof left a comment

Choose a reason for hiding this comment

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

Thank you, @tranzystorek-io, for the contribution.

@ericof ericof merged commit bc493bf into cookiecutter:main Jun 13, 2023
@tranzystorekk tranzystorekk deleted the inline-jinja2-time branch June 13, 2023 14:00
@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Jul 6, 2023

Is there any way to detect this? Now "_extensions": ["jinja2_time.TimeExtension"], no longer works out of the box unless a user installs/injects jinja2_time, instead "cookiecutter.extensions.TimeExtension" is needed. Can I template on the cookiecutter version?

(I think it would have bene nice to keep the dependency for a version or two to allow cookies to adjust...)

@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Jul 6, 2023

FYI, https://cookiecutter.readthedocs.io/en/stable/advanced/template_extensions.html still tells users to use jinja2_time.TimeExtension and jinja2_time is no longer included.

@henryiii
Copy link
Copy Markdown
Contributor

henryiii commented Jul 6, 2023

FYI, since you handle the processing of that string, what about making jinja2_time.TimeExtension provide cookiecutter.extensions.TimeExtension if jinja2_time isn't' installed? Just a thought.

jonathansick added a commit to lsst/templates that referenced this pull request Jul 10, 2023
We're doing this temporarily to continue usage of the jinja2_time
extension.

See cookiecutter/cookiecutter#1779

The next step of this resolution is to update templatebot and the
templates here in concert to adopt the new inlined time extension
available in cookiecutter 2.2+.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature This issue/PR relates to major feature request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Discussion] Dropping jinja2-time as dependency

3 participants