sympy / sympy.github.com

SymPy's web page (sympy.org)
https://sympy.org/
179 stars 106 forks source link

Cannot generate pages with jinja2 version 3 and newer #166

Closed awvwgk closed 2 years ago

awvwgk commented 2 years ago

Running the generate script fails for me (commit 2979deac867d5be6a064632af0b051a3de0a5e12). This fails due to jinja2 version 3.*, but works find with jinja2 version 2.*.

❯ ./generate
Generating 'cs' pages
Traceback (most recent call last):
  File "/home/awvwgk/projects/src/git/sympy.github.com/./generate", line 51, in <module>
    t = env.get_template(template)
  File "/home/awvwgk/software/opt/conda/envs/sphinx/lib/python3.9/site-packages/jinja2/environment.py", line 997, in get_template
    return self._load_template(name, globals)
  File "/home/awvwgk/software/opt/conda/envs/sphinx/lib/python3.9/site-packages/jinja2/environment.py", line 958, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
  File "/home/awvwgk/software/opt/conda/envs/sphinx/lib/python3.9/site-packages/jinja2/loaders.py", line 137, in load
    code = environment.compile(source, name, filename)
  File "/home/awvwgk/software/opt/conda/envs/sphinx/lib/python3.9/site-packages/jinja2/environment.py", line 757, in compile
    self.handle_exception(source=source_hint)
  File "/home/awvwgk/software/opt/conda/envs/sphinx/lib/python3.9/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "templates/index.html", line 159, in template
    <span class="date">{{ datetime(2020, 08, 9) }}</span> {% trans v='1.6.2' %}Version {{ v }} released{% endtrans %} (<a href="https://github.com/sympy/sympy/wiki/Release-Notes-for-1.6.2">{% trans %}changes{% endtrans %}</a>)<br/>
jinja2.exceptions.TemplateSyntaxError: expected token ',', got 'integer'
environment ``` ❯ mamba list # packages in environment at /home/awvwgk/software/opt/conda/envs/sphinx: # # Name Version Build Channel _libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge ablog 0.10.20 pyhd8ed1ab_0 conda-forge alabaster 0.7.12 py_0 conda-forge argh 0.26.2 pyh9f0ad1d_1002 conda-forge async_generator 1.10 py_0 conda-forge attrs 21.2.0 pyhd8ed1ab_0 conda-forge babel 2.9.1 pyh44b312d_0 conda-forge beautifulsoup4 4.10.0 pyha770c72_0 conda-forge bleach 4.1.0 pyhd8ed1ab_0 conda-forge brotlipy 0.7.0 py39h3811e60_1003 conda-forge ca-certificates 2021.10.8 ha878542_0 conda-forge certifi 2021.10.8 py39hf3d152e_1 conda-forge cffi 1.15.0 py39h4bc2ebd_0 conda-forge chardet 4.0.0 py39hf3d152e_2 conda-forge charset-normalizer 2.0.8 pyhd8ed1ab_0 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge cryptography 36.0.0 py39h95dcef6_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge docutils 0.16 py39hf3d152e_3 conda-forge entrypoints 0.3 py39hde42818_1002 conda-forge feedgen 0.9.0 pyh9f0ad1d_0 conda-forge furo 2021.10.9 pyhd8ed1ab_0 conda-forge icu 69.1 h9c3ff4c_0 conda-forge idna 3.1 pyhd3deb0d_0 conda-forge imagesize 1.3.0 pyhd8ed1ab_0 conda-forge importlib-metadata 4.8.2 py39hf3d152e_0 conda-forge importlib_resources 3.3.1 py39hf3d152e_0 conda-forge invoke 1.6.0 pyhd8ed1ab_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge jinja2 3.0.3 pyhd8ed1ab_0 conda-forge jsonschema 4.2.1 pyhd8ed1ab_0 conda-forge jupyter_client 7.1.0 pyhd8ed1ab_0 conda-forge jupyter_core 4.9.1 py39hf3d152e_1 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge latexcodec 2.0.1 pyh9f0ad1d_0 conda-forge ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge libffi 3.4.2 h7f98852_5 conda-forge libgcc-ng 11.2.0 h1d223b6_11 conda-forge libgomp 11.2.0 h1d223b6_11 conda-forge libiconv 1.16 h516909a_0 conda-forge libsodium 1.0.18 h36c2ea0_1 conda-forge libstdcxx-ng 11.2.0 he4da1e4_11 conda-forge libxml2 2.9.12 h885dcf4_1 conda-forge libxslt 1.1.33 h0ef7038_3 conda-forge libzlib 1.2.11 h36c2ea0_1013 conda-forge lxml 4.6.4 py39h107f48f_0 conda-forge markdown-it-py 1.1.0 pyhd8ed1ab_0 conda-forge markupsafe 2.0.1 py39h3811e60_1 conda-forge mdit-py-plugins 0.2.8 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py39h3811e60_1005 conda-forge myst-parser 0.15.2 pyhd8ed1ab_0 conda-forge nbclient 0.5.9 pyhd8ed1ab_0 conda-forge nbconvert 6.3.0 py39hf3d152e_1 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge nbsphinx 0.8.7 pyhd8ed1ab_0 conda-forge ncurses 6.2 h58526e2_4 conda-forge nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge openssl 1.1.1l h7f98852_0 conda-forge packaging 21.3 pyhd8ed1ab_0 conda-forge pandoc 2.16.2 h7f98852_0 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge pip 21.3.1 pyhd8ed1ab_0 conda-forge pybtex 0.24.0 py39hf3d152e_1 conda-forge pybtex-docutils 1.0.1 py39hf3d152e_1 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydata-sphinx-theme 0.7.2 pyhd8ed1ab_0 conda-forge pygments 2.10.0 pyhd8ed1ab_0 conda-forge pyopenssl 21.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.6 pyhd8ed1ab_0 conda-forge pyrsistent 0.18.0 py39h3811e60_0 conda-forge pysocks 1.7.1 py39hf3d152e_4 conda-forge python 3.9.7 hb7a2778_3_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.9 2_cp39 conda-forge pytz 2021.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py39h3811e60_3 conda-forge pyzmq 22.3.0 py39h37b5a0c_1 conda-forge readline 8.1 h46c0cb4_0 conda-forge requests 2.26.0 pyhd8ed1ab_1 conda-forge setuptools 59.2.0 py39hf3d152e_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3 pyhd8ed1ab_0 conda-forge sphinx 4.3.0 pyh6c4a22f_0 conda-forge sphinx-book-theme 0.1.7 pyhd8ed1ab_0 conda-forge sphinx-copybutton 0.4.0 pyhd8ed1ab_0 conda-forge sphinx-design 0.0.13 pyhd8ed1ab_0 conda-forge sphinx-inline-tabs 2021.8.17b10 pyhd8ed1ab_0 conda-forge sphinx-intl 2.0.1 pyhd8ed1ab_0 conda-forge sphinx-panels 0.6.0 pyhd8ed1ab_0 conda-forge sphinx-togglebutton 0.2.3 pyhd3deb0d_0 conda-forge sphinx_rtd_theme 1.0.0 pyhd8ed1ab_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-bibtex 2.4.1 pyhd8ed1ab_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_1 conda-forge sqlite 3.36.0 h9cd32fc_2 conda-forge testpath 0.5.0 pyhd8ed1ab_0 conda-forge tk 8.6.11 h27826a3_1 conda-forge tomli 2.0.0 pyhd8ed1ab_1 conda-forge tornado 6.1 py39h3811e60_2 conda-forge traitlets 5.1.1 pyhd8ed1ab_0 conda-forge typing_extensions 4.0.0 pyha770c72_0 conda-forge tzdata 2021e he74cb21_0 conda-forge urllib3 1.26.7 pyhd8ed1ab_0 conda-forge watchdog 2.1.6 py39hf3d152e_1 conda-forge webencodings 0.5.1 py_1 conda-forge wheel 0.37.0 pyhd8ed1ab_1 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge zeromq 4.3.4 h9c3ff4c_1 conda-forge zipp 3.6.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h36c2ea0_1013 conda-forge ❯ mamba info __ __ __ __ / \ / \ / \ / \ / \/ \/ \/ \ ███████████████/ /██/ /██/ /██/ /████████████████████████ / / \ / \ / \ / \ \____ / / \_/ \_/ \_/ \ o \__, / _/ \_____/ ` |/ ███╗ ███╗ █████╗ ███╗ ███╗██████╗ █████╗ ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗ ██╔████╔██║███████║██╔████╔██║██████╔╝███████║ ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║ ██║ ╚═╝ ██║██║ ██║██║ ╚═╝ ██║██████╔╝██║ ██║ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝ mamba (0.17.0) supported by @QuantStack GitHub: https://github.com/mamba-org/mamba Twitter: https://twitter.com/QuantStack █████████████████████████████████████████████████████████████ active environment : sphinx active env location : /home/awvwgk/software/opt/conda/envs/sphinx shell level : 2 user config file : /home/awvwgk/.condarc populated config files : /home/awvwgk/software/opt/conda/.condarc conda version : 4.10.3 conda-build version : not installed python version : 3.9.6.final.0 virtual packages : __linux=5.10.89=0 __glibc=2.33=0 __unix=0=0 __archspec=1=x86_64 base environment : /home/awvwgk/software/opt/conda (writable) conda av data dir : /home/awvwgk/software/opt/conda/etc/conda conda av metadata url : None channel URLs : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch package cache : /home/awvwgk/software/opt/conda/pkgs /home/awvwgk/.conda/pkgs envs directories : /home/awvwgk/software/opt/conda/envs /home/awvwgk/.conda/envs platform : linux-64 user-agent : conda/4.10.3 requests/2.26.0 CPython/3.9.6 Linux/5.10.89-1-MANJARO manjaro/21.2.1 glibc/2.33 UID:GID : 1000:1000 netrc file : None offline mode : False ```