fail-fast: false
matrix:
include:
- - {name: Linux, python: '3.8', os: ubuntu-latest, tox: py38}
+ - {name: Linux, python: '3.9', os: ubuntu-latest, tox: py39}
+ - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38}
- {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37}
- {name: '3.6', python: '3.6', os: ubuntu-latest, tox: py36}
- {name: 'PyPy', python: pypy3, os: ubuntu-latest, tox: pypy3}
- - {name: Style, python: '3.8', os: ubuntu-latest, tox: style}
- - {name: Docs, python: '3.8', os: ubuntu-latest, tox: docs}
- - {name: Typing, python: '3.8', os: ubuntu-latest, tox: mypy}
- - {name: Windows, python: '3.8', os: windows-latest, tox: py38}
- - {name: Mac, python: '3.8', os: macos-latest, tox: py38}
+ - {name: Docs, python: '3.9', os: ubuntu-latest, tox: docs}
+ - {name: Typing, python: '3.9', os: ubuntu-latest, tox: typing}
+ - {name: Windows, python: '3.9', os: windows-latest, tox: py39}
+ - {name: Mac, python: '3.9', os: macos-latest, tox: py39}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
id: pip-cache
run: echo "::set-output name=dir::$(pip cache dir)"
- name: cache pip
- uses: actions/cache@v1
+ uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: pip|${{ runner.os }}|${{ matrix.python }}|${{ hashFiles('setup.py') }}|${{ hashFiles('requirements/*.txt') }}
- - name: cache pre-commit
- uses: actions/cache@v1
- with:
- path: ~/.cache/pre-commit
- key: pre-commit|${{ matrix.python }}|${{ hashFiles('.pre-commit-config.yaml') }}
- if: matrix.tox == 'style'
- run: pip install tox
- run: tox -e ${{ matrix.tox }}
- id: pyupgrade
args: ["--py36-plus"]
- repo: https://github.com/asottile/reorder_python_imports
- rev: v2.3.6
+ rev: v2.4.0
hooks:
- id: reorder-python-imports
args: ["--application-directories", "src"]
Building the docs
~~~~~~~~~~~~~~~~~
-Install the documentation dependencies if you have not already done so.
-
-.. code-block:: text
-
- $ pip install -r requirements/docs.txt
-
Build the docs in the ``docs`` directory using Sphinx.
.. code-block:: text
-# -r docs.in # can't include due to Sphinx/Jinja mutual dependency
+-r docs.in
-r tests.in
+-r typing.in
pip-tools
pre-commit
tox
#
# pip-compile requirements/dev.in
#
+alabaster==0.7.12
+ # via sphinx
appdirs==1.4.4
# via virtualenv
-attrs==19.3.0
+attrs==20.3.0
# via pytest
-cfgv==3.1.0
+babel==2.9.0
+ # via sphinx
+certifi==2020.12.5
+ # via requests
+cfgv==3.2.0
# via pre-commit
+chardet==4.0.0
+ # via requests
click==7.1.2
# via pip-tools
-distlib==0.3.0
+distlib==0.3.1
# via virtualenv
+docutils==0.16
+ # via sphinx
filelock==3.0.12
# via
# tox
# virtualenv
-identify==1.4.15
+identify==1.5.13
# via pre-commit
-iniconfig==1.0.0
+idna==2.10
+ # via requests
+imagesize==1.2.0
+ # via sphinx
+iniconfig==1.1.1
# via pytest
-nodeenv==1.3.5
+jinja2==2.11.3
+ # via sphinx
+markupsafe==1.1.1
+ # via jinja2
+mypy-extensions==0.4.3
+ # via mypy
+mypy==0.800
+ # via -r requirements/typing.in
+nodeenv==1.5.0
# via pre-commit
-packaging==20.3
+packaging==20.9
# via
+ # pallets-sphinx-themes
# pytest
+ # sphinx
# tox
+pallets-sphinx-themes==1.2.3
+ # via -r requirements/docs.in
pip-tools==5.5.0
# via -r requirements/dev.in
pluggy==0.13.1
# via
# pytest
# tox
-pre-commit==2.10.0
+pre-commit==2.10.1
# via -r requirements/dev.in
-py==1.9.0
+py==1.10.0
# via
# pytest
# tox
+pygments==2.7.4
+ # via sphinx
pyparsing==2.4.7
# via packaging
pytest==6.2.2
# via -r requirements/tests.in
-pyyaml==5.3.1
+pytz==2021.1
+ # via babel
+pyyaml==5.4.1
# via pre-commit
-six==1.14.0
+requests==2.25.1
+ # via sphinx
+six==1.15.0
# via
- # packaging
# tox
# virtualenv
-toml==0.10.1
+snowballstemmer==2.1.0
+ # via sphinx
+sphinx-issues==1.2.0
+ # via -r requirements/docs.in
+sphinx==2.4.4
+ # via
+ # -r requirements/docs.in
+ # pallets-sphinx-themes
+ # sphinx-issues
+ # sphinxcontrib-log-cabinet
+sphinxcontrib-applehelp==1.0.2
+ # via sphinx
+sphinxcontrib-devhelp==1.0.2
+ # via sphinx
+sphinxcontrib-htmlhelp==1.0.3
+ # via sphinx
+sphinxcontrib-jsmath==1.0.1
+ # via sphinx
+sphinxcontrib-log-cabinet==1.0.1
+ # via -r requirements/docs.in
+sphinxcontrib-qthelp==1.0.3
+ # via sphinx
+sphinxcontrib-serializinghtml==1.1.4
+ # via sphinx
+toml==0.10.2
# via
# pre-commit
# pytest
# tox
-tox==3.21.3
+tox==3.21.4
# via -r requirements/dev.in
-virtualenv==20.0.20
+typed-ast==1.4.2
+ # via mypy
+typing-extensions==3.7.4.3
+ # via mypy
+urllib3==1.26.3
+ # via requests
+virtualenv==20.4.2
# via
# pre-commit
# tox
# The following packages are considered to be unsafe in a requirements file:
# pip
+# setuptools
#
# pip-compile requirements/docs.in
#
-alabaster==0.7.12 # via sphinx
-babel==2.9.0 # via sphinx
-certifi==2020.4.5.1 # via requests
-chardet==3.0.4 # via requests
-docutils==0.16 # via sphinx
-idna==2.9 # via requests
-imagesize==1.2.0 # via sphinx
-jinja2==2.11.2 # via sphinx
-markupsafe==1.1.1 # via jinja2
-packaging==20.3 # via pallets-sphinx-themes, sphinx
-pallets-sphinx-themes==1.2.3 # via -r requirements/docs.in
-pygments==2.6.1 # via sphinx
-pyparsing==2.4.7 # via packaging
-pytz==2020.1 # via babel
-requests==2.23.0 # via sphinx
-six==1.14.0 # via packaging
-snowballstemmer==2.0.0 # via sphinx
-sphinx-issues==1.2.0 # via -r requirements/docs.in
-sphinx==2.4.4 # via -r requirements/docs.in, pallets-sphinx-themes, sphinx-issues, sphinxcontrib-log-cabinet
-sphinxcontrib-applehelp==1.0.2 # via sphinx
-sphinxcontrib-devhelp==1.0.2 # via sphinx
-sphinxcontrib-htmlhelp==1.0.3 # via sphinx
-sphinxcontrib-jsmath==1.0.1 # via sphinx
-sphinxcontrib-log-cabinet==1.0.1 # via -r requirements/docs.in
-sphinxcontrib-qthelp==1.0.3 # via sphinx
-sphinxcontrib-serializinghtml==1.1.4 # via sphinx
-urllib3==1.25.9 # via requests
+alabaster==0.7.12
+ # via sphinx
+babel==2.9.0
+ # via sphinx
+certifi==2020.12.5
+ # via requests
+chardet==4.0.0
+ # via requests
+docutils==0.16
+ # via sphinx
+idna==2.10
+ # via requests
+imagesize==1.2.0
+ # via sphinx
+jinja2==2.11.3
+ # via sphinx
+markupsafe==1.1.1
+ # via jinja2
+packaging==20.9
+ # via
+ # pallets-sphinx-themes
+ # sphinx
+pallets-sphinx-themes==1.2.3
+ # via -r requirements/docs.in
+pygments==2.7.4
+ # via sphinx
+pyparsing==2.4.7
+ # via packaging
+pytz==2021.1
+ # via babel
+requests==2.25.1
+ # via sphinx
+snowballstemmer==2.1.0
+ # via sphinx
+sphinx-issues==1.2.0
+ # via -r requirements/docs.in
+sphinx==2.4.4
+ # via
+ # -r requirements/docs.in
+ # pallets-sphinx-themes
+ # sphinx-issues
+ # sphinxcontrib-log-cabinet
+sphinxcontrib-applehelp==1.0.2
+ # via sphinx
+sphinxcontrib-devhelp==1.0.2
+ # via sphinx
+sphinxcontrib-htmlhelp==1.0.3
+ # via sphinx
+sphinxcontrib-jsmath==1.0.1
+ # via sphinx
+sphinxcontrib-log-cabinet==1.0.1
+ # via -r requirements/docs.in
+sphinxcontrib-qthelp==1.0.3
+ # via sphinx
+sphinxcontrib-serializinghtml==1.1.4
+ # via sphinx
+urllib3==1.26.3
+ # via requests
# The following packages are considered to be unsafe in a requirements file:
# setuptools
#
# pip-compile requirements/tests.in
#
-attrs==19.3.0
+attrs==20.3.0
# via pytest
-iniconfig==1.0.0
+iniconfig==1.1.1
# via pytest
-packaging==20.3
+packaging==20.9
# via pytest
pluggy==0.13.1
# via pytest
-py==1.9.0
+py==1.10.0
# via pytest
pyparsing==2.4.7
# via packaging
pytest==6.2.2
# via -r requirements/tests.in
-six==1.14.0
- # via packaging
-toml==0.10.1
+toml==0.10.2
# via pytest
--- /dev/null
+#
+# This file is autogenerated by pip-compile
+# To update, run:
+#
+# pip-compile requirements/typing.in
+#
+mypy-extensions==0.4.3
+ # via mypy
+mypy==0.800
+ # via -r requirements/typing.in
+typed-ast==1.4.2
+ # via mypy
+typing-extensions==3.7.4.3
+ # via mypy
src/jinja2/__init__.py: F401
[mypy]
+files = src/jinja2
allow_redefinition = True
disallow_subclassing_any = True
# disallow_untyped_defs = True
[tox]
envlist =
- py{38,37,36,py3}
+ py{39,38,37,36,py3}
style
docs
- mypy
+ typing
skip_missing_interpreters = true
[testenv]
deps = -r requirements/tests.txt
-commands = pytest --tb=short --basetemp={envtmpdir} {posargs}
+commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}
[testenv:style]
deps = pre-commit
deps = -r requirements/docs.txt
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
-[testenv:mypy]
-deps = mypy
-commands =
- mypy src/jinja2 tests
+[testenv:typing]
+deps = -r requirements/typing.txt
+commands = mypy