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

MRG: Replace tempita with Jinja2 #10211

Merged
merged 13 commits into from
Jan 17, 2022

Conversation

hoechenberger
Copy link
Member

@hoechenberger hoechenberger commented Jan 16, 2022

Fixes #10204

WIP:

  • Render tutorial
  • Remove tempita from HTML templates for Jupyter
  • Changelog entry

Nice: VS Code has debugging support for Jinja templates:
Screen Shot 2022-01-16 at 14 12 22

@hoechenberger
Copy link
Member Author

hoechenberger commented Jan 17, 2022

One circle job failed because MNE-BIDS depends on our vendored Tempita. This will require an update of MNE-BIDS and can be ignored here for now.

All other checks passed.

I will update the changelog ASAP; in any case, this PR is ready for review.

  • Removed Tempita in favor of Jinja2
  • HTML repr of Info is more robust
  • I could remove some manual string escaping from the Python code, as Jinja2 will do that work for us now
  • All HTML templates are now located under mne/html_templates

Built doc artifact: https://40576-1301584-gh.circle-artifacts.com/0/dev/index.html

@hoechenberger hoechenberger marked this pull request as ready for review January 17, 2022 12:48
@hoechenberger hoechenberger changed the title Replace tempita with Jinja2 MRG: Replace tempita with Jinja2 Jan 17, 2022
Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

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

I think the only thing missing is we need to add jinja2 to README.rst and setup.py, but I've added them to my TODO list for #10199 since I need to update them there anyway. Otherwise this LGTM, so +1 for merge from my end.

@larsoner larsoner merged commit e6336f0 into mne-tools:main Jan 17, 2022
@hoechenberger hoechenberger deleted the hoechenberger/issue10204 branch January 17, 2022 18:24
@jasmainak
Copy link
Member

This broke mne-bids :)

In [1]: import mne_bids
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-b553cc368f26> in <module>
----> 1 import mne_bids

~/Documents/github_repos/mne-bids/mne_bids/__init__.py in <module>
      3 __version__ = '0.10.dev0'
      4 from mne_bids import commands
----> 5 from mne_bids.report import make_report
      6 from mne_bids.path import (BIDSPath, get_datatypes, get_entity_vals,
      7                            print_dir_tree, get_entities_from_fname,

~/Documents/github_repos/mne-bids/mne_bids/report.py in <module>
      9 
     10 import numpy as np
---> 11 from mne.externals.tempita import Template
     12 from mne.utils import warn, logger, verbose
     13 

ImportError: cannot import name 'Template' from 'mne.externals.tempita' (unknown location)

@hoechenberger
Copy link
Member Author

This broke mne-bids :)

Already fixed: mne-tools/mne-bids#944

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.

MAINT: Remove tempita
3 participants