salt icon indicating copy to clipboard operation
salt copied to clipboard

[BUG] Documentation fails to build due to too new Jinja version

Open faivirol opened this issue 3 years ago • 1 comments

Description The documentation in this repo fails to build when following these instructions.

Steps to Reproduce the behavior

rm -rf ~/.pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
git clone https://github.com/pyenv/pyenv-virtualenv.git $(pyenv root)/plugins/pyenv-virtualenv

# this would be in ~/.bashrc
export PATH="$HOME/.pyenv/bin:$PATH"
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

pyenv install 3.7.0
CC=clang pyenv install 3.7.0
pyenv virtualenv 3.7.0 salt
pyenv activate salt
git clone --depth=1 --origin salt https://github.com/saltstack/salt.git
cd salt/
git remote add faivirol https://github.com/faivirol/salt.git
git fetch salt/upstream
git pull
pip install --upgrade pip  # package installation failed otherwise
python -m pip install pre-commit nox
pre-commit install

pyenv install 3.7.15
pyenv virtualenv 3.7.15 salt-docs
echo 'salt-docs' > .python-version
pyenv exec pip install -U pip setuptools wheel
pyenv exec pip install nox
python -m nox -e 'docs-html(compress=False, clean=False)'; cd doc/_build/html; python -m webbrowser http://localhost:8000/contents.html; python -m http.server

This gives this traceback:

Traceback (most recent call last):
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/sphinx/cmd/build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/sphinx/application.py", line 43, in <module>
    from sphinx.registry import SphinxComponentRegistry
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/sphinx/registry.py", line 24, in <module>
    from sphinx.builders import Builder
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 26, in <module>
    from sphinx.util import import_object, logging, progress_message, rst, status_iterator
  File "/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/sphinx/util/rst.py", line 21, in <module>
    from jinja2 import Environment, environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (/home/user/salt/.nox/docs-html-compress-false-clean-false/lib/python3.7/site-packages/jinja2/__init__.py)

Additional context Pinning jinja2 in requirements/static/ci/py3.7/docs.txt to 3.0.3 instead of 3.1.2 as suggested here and here fixes the issue for me, although I don't know if that breaks something else.

faivirol avatar Feb 11 '23 10:02 faivirol

Thanks for the original report. This issue has been open for more than three years without recent activity and carries a severity label below severity-high. As part of a backlog cleanup, we're closing older low- and medium-severity issues so triage can focus on reports against currently supported releases.

Closing isn't a judgement that the problem wasn't real — only that the codebase has moved through several releases since this was filed, and much of the surrounding code has changed.

If you — or anyone else — can still reproduce this on the 3008.x LTS release, please leave a comment with a reproduction and a maintainer will reopen. The original reporter can also reopen directly.

dwoz avatar Oct 16 '26 01:10 dwoz