-
Notifications
You must be signed in to change notification settings - Fork 568
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
Import Markup and escape directly from MarkupsSafe #1737
Conversation
Revert once jupyter/nbconvert#1737 is merged and released!
Test failure appears related to Jinja2 3.1.0 release. Pin Jinja2 below 3.1.0 and the tests pass. Possibly related to this change? pallets/jinja#1621 |
should we bump the lower bound and add an upper bound for |
I set an upper bound for |
This also closes #1605. |
@davidism could there have been a change in jinja2 behavior between 3.0 and 3.1 that would account for the new failures in these tests? def test_absolute_template_dir(self):
with tempdir.TemporaryDirectory() as td:
template = 'mytemplate'
template_file = os.path.join(td, template, 'index.py.j2')
template_dir = os.path.dirname(template_file)
os.mkdir(template_dir)
test_output = 'absolute!'
with open(template_file, 'w') as f:
f.write(test_output)
config = Config()
config.TemplateExporter.template_name = template
config.TemplateExporter.extra_template_basedirs = [td]
exporter = self._make_exporter(config=config)
> assert exporter.template.filename == template_file
E AssertionError: assert 'C:\\Users\\R...e/index.py.j2' == 'C:\\Users\\R...\\index.py.j2'
E - C:\Users\RUNNER~1\AppData\Local\Temp\tmpd72mcthi\mytemplate\index.py.j2
E ? ^
E + C:\Users\RUNNER~1\AppData\Local\Temp\tmpd72mcthi\mytemplate/index.py.j2
E ? https://github.com/jupyter/nbconvert/runs/5689650683?check_suite_focus=true |
We did fix some issues with unsafe Windows paths in template names. The two filenames being compared are in fact equivalent on Windows, even though they're not textually equivalent, since |
Created pallets/jinja#1637, I will submit a PR and then release 3.1.1. |
Released Jinja2 3.1.1 with the filename fix. |
Thanks everyone. |
I wonder if we should exclude 3.1.0 (while accepting 3.1.1) from the versions in setup.py. |
* Revert PR #1824 to remove restrictions place on Jinja2 given spatialaudio/nbsphinx#641. The issues described there were resolved upstream of nbsphinx in jupyter/nbconvert#1737. - Lower bounds of 'nbconvert>=6.4.5' are not added as lower bound restrictions should be applied upstream of pyhf in nbsphinx. PR #1824 was applied only because it was necessary.
nbconvert has been updated re: jinja=3.10. See spatialaudio/nbsphinx#641 (comment) and jupyter/nbconvert#1737
nbconvert has been updated re: jinja=3.10. See spatialaudio/nbsphinx#641 (comment) and jupyter/nbconvert#1737
Fixes #1736
Jinja 3.1.0 removed
jinja.Markup
andjinja.escape
and suggested importing them from MarkupSafe