Skip to content

Use minijinja's pycompat mode for python methods #2049

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

Closed
wants to merge 1 commit into from

Conversation

mitsuhiko
Copy link
Contributor

What does this PR do?

This PR updates the minijinja engine and enables the pycompat support. This makes minijinja support methods such as .strip() natively on methods and gets rid of the manual hacks with string replace.

While in practice the current mode probably does not create that many issues, this is cleaner and also adds support for other methods such as .title() or .lines().

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Tagging @OlivierDehaene from #1996 which touched these files last.

@drbh drbh mentioned this pull request Jun 11, 2024
@drbh
Copy link
Collaborator

drbh commented Jun 11, 2024

Hi @mitsuhiko thank you for this contribution! This is a nice improvement to minijinja and TGI.

I've opened another PR to run CI here #2054 and re ran the pre-commit command.

CI looks good and I'd be happy to approve this PR once/if those lints are resolved. Otherwise I'm also happy to merge the other PR if thats easier for you 🙂

Thanks!

drbh added a commit that referenced this pull request Jun 13, 2024
* Use minijinja's pycompat mode for python methods

* fix: cargo fmt lint for pre commit

---------

Co-authored-by: Armin Ronacher <[email protected]>
@drbh
Copy link
Collaborator

drbh commented Jun 13, 2024

closing in favor of #2054 which ran CI and updated lints

@drbh drbh closed this Jun 13, 2024
@Narsil Narsil mentioned this pull request Jun 24, 2024
5 tasks
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.

2 participants