Skip to content

Commit

Permalink
Pin Jinja2 version to prevent CircleCI build_docs failure
Browse files Browse the repository at this point in the history
Fix fail to build docs in CircleCI observed in testing draft changes made to PR nipreps#280. 

```
#!/bin/bash -eo pipefail
make -C docs SPHINXOPTS="-W" BUILDDIR="_build/no_version_html" html

make: Entering directory '/tmp/gh-pages/docs'
PYTHONPATH=/tmp/gh-pages sphinx-build -b html -d _build/no_version_html/doctrees  -W . _build/no_version_html/html
Traceback (most recent call last):
  File "/home/circleci/.local/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/cmd/build.py", line 23, in <module>
    from sphinx.application import Sphinx
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/application.py", line 42, in <module>
    from sphinx.highlighting import lexer_classes, lexers
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/highlighting.py", line 30, in <module>
    from sphinx.ext import doctest
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/ext/doctest.py", line 28, in <module>
    from sphinx.builders import Builder
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/builders/__init__.py", line 24, in <module>
    from sphinx.io import read_doc
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/io.py", line 42, in <module>
    from sphinx.util.rst import append_epilog, docinfo_re, prepend_prolog
  File "/home/circleci/.local/lib/python3.8/site-packages/sphinx/util/rst.py", line 22, in <module>
    from jinja2 import environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/circleci/.local/lib/python3.8/site-packages/jinja2/__init__.py)
make: *** [Makefile:61: html] Error 1
make: Leaving directory '/tmp/gh-pages/docs'

Exited with code exit status 2

CircleCI received exit code 2

```
From suggested fix for similar behavior: mkdocs/mkdocs#2799
  • Loading branch information
pcamach2 authored Apr 27, 2022
1 parent 426f56a commit c7affdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ sphinx >= 2.1.2, < 3
sphinx_rtd_theme
sphinxcontrib-apidoc ~= 0.3.0
templateflow
jinja2==3.0.3

0 comments on commit c7affdc

Please sign in to comment.