Closed kloczek closed 3 years ago
What version of nbconvert do you have? Can you try it on latest?
6.1.0 and this is latest released version.
@kloczek I can't reproduce the warning. Also neither contextfilter
nor markdown2html
are appearing in our codebase.
py.test -W error::DeprecationWarning --pdb
?+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-sphinx-0.3.2~no_loopy_deps-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-sphinx-0.3.2~no_loopy_deps-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ /usr/bin/pytest -ra -W error::DeprecationWarning --pdb
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=949932688
rootdir: /home/tkloczko/rpmbuild/BUILD/jupyter-sphinx-0.3.2
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, randomly-3.8.0, Faker-8.8.2, datadir-1.3.1, regressions-2.2.0
collecting ...
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
tests/test_execute.py:18: in <module>
from jupyter_sphinx.ast import (
../../BUILDROOT/python-jupyter-sphinx-0.3.2~no_loopy_deps-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_sphinx/__init__.py:13: in <module>
from .ast import (
../../BUILDROOT/python-jupyter-sphinx-0.3.2~no_loopy_deps-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_sphinx/ast.py:17: in <module>
import nbconvert
/usr/lib/python3.8/site-packages/nbconvert/__init__.py:4: in <module>
from .exporters import *
/usr/lib/python3.8/site-packages/nbconvert/exporters/__init__.py:3: in <module>
from .html import HTMLExporter
/usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:24: in <module>
class HTMLExporter(TemplateExporter):
/usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:110: in HTMLExporter
def markdown2html(self, context, source):
/usr/lib/python3.8/site-packages/jinja2/filters.py:54: in contextfilter
warnings.warn(
E DeprecationWarning: 'contextfilter' is renamed to 'pass_context', the old name will be removed in Jinja 3.1.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /usr/lib/python3.8/site-packages/jinja2/filters.py(54)contextfilter()
-> warnings.warn(
(Pdb)
OK, that's more informative. The deprecation warning is in how nbconvert uses jinja2, and therefore it isn't a problem with jupyter-sphinx. You may consider reporting the issue to nbconvert (you should observe the same deprecation warning in any script that imports nbconvert).
Just normal build, install and test cycle used on building package from non-root account:
tests/test_execute.py ....... [ 22%] . . [ 25%] tests/test_execute.py ...............s....... [100%]
============================================================================= warnings summary ============================================================================= ../../../../../usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:110 /usr/lib/python3.8/site-packages/nbconvert/exporters/html.py:110: DeprecationWarning: 'contextfilter' is renamed to 'pass_context', the old name will be removed in Jinja 3.1. def markdown2html(self, context, source):
-- Docs: https://docs.pytest.org/en/stable/warnings.html ========================================================================= short test summary info ========================================================================== SKIPPED [1] tests/test_execute.py:637: could not import 'bash_kernel': No module named 'bash_kernel' =========================================================== 30 passed, 1 skipped, 1 warning in 63.09s (0:01:03) ============================================================