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

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

Open
faivirol opened this issue Feb 11, 2023 · 0 comments
Open

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

faivirol opened this issue Feb 11, 2023 · 0 comments
Labels
Bug broken, incorrect, or confusing behavior needs-triage

Comments

@faivirol
Copy link
Contributor

faivirol commented Feb 11, 2023

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 faivirol added Bug broken, incorrect, or confusing behavior needs-triage labels Feb 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant