| 1 |
[tox] |
| 2 |
basepython = python3.13 |
| 3 |
envlist = |
| 4 |
py{311,312,313,314,py311}-{low,release,appinstall} |
| 5 |
mypy |
| 6 |
async |
| 7 |
nowebauthn |
| 8 |
nobabel |
| 9 |
noauthlib |
| 10 |
style |
| 11 |
docs |
| 12 |
coverage |
| 13 |
makedist |
| 14 |
skip_missing_interpreters = false |
| 15 |
|
| 16 |
[testenv] |
| 17 |
allowlist_externals = tox |
| 18 |
|
| 19 |
[testenv:pypy311-release] |
| 20 |
dependency_groups = tests |
| 21 |
commands = |
| 22 |
tox -e compile_catalog |
| 23 |
pytest -W ignore --basetemp={envtmpdir} {posargs:tests} |
| 24 |
|
| 25 |
[testenv:py{311,312,313,314}-release] |
| 26 |
dependency_groups = tests |
| 27 |
commands = |
| 28 |
tox -e compile_catalog |
| 29 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 30 |
|
| 31 |
[testenv:py{311,312,313,314,py311}-low] |
| 32 |
deps = pytest |
| 33 |
dependency_groups = low |
| 34 |
commands = |
| 35 |
tox -e compile_catalog |
| 36 |
pytest -W ignore --basetemp={envtmpdir} {posargs:tests} |
| 37 |
|
| 38 |
# manual test to check how we're keeping up with Pallets latest |
| 39 |
[testenv:main] |
| 40 |
basepython = python3.14 |
| 41 |
dependency_groups = tests |
| 42 |
deps = |
| 43 |
git+https://github.com/pallets/werkzeug@main#egg=werkzeug |
| 44 |
git+https://github.com/pallets/flask@main#egg=flask |
| 45 |
git+https://github.com/pallets/flask-sqlalchemy@main#egg=flask-sqlalchemy |
| 46 |
git+https://github.com/pallets/jinja@main#egg=jinja2 |
| 47 |
git+https://github.com/pallets-eco/flask-principal@main#egg=flask-principal |
| 48 |
git+https://github.com/wtforms/wtforms@main#egg=wtforms |
| 49 |
git+https://github.com/maxcountryman/flask-login@main#egg=flask-login |
| 50 |
commands = |
| 51 |
tox -e compile_catalog |
| 52 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 53 |
|
| 54 |
[testenv:async] |
| 55 |
dependency_groups = tests |
| 56 |
commands = |
| 57 |
pip install flask[async] |
| 58 |
tox -e compile_catalog |
| 59 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 60 |
|
| 61 |
[testenv:nowebauthn] |
| 62 |
dependency_groups = tests |
| 63 |
commands = |
| 64 |
pip uninstall -y webauthn |
| 65 |
tox -e compile_catalog |
| 66 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 67 |
|
| 68 |
[testenv:nobabel] |
| 69 |
dependency_groups = tests |
| 70 |
commands = |
| 71 |
pip uninstall -y babel flask_babel |
| 72 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 73 |
|
| 74 |
[testenv:noauthlib] |
| 75 |
dependency_groups = tests |
| 76 |
commands = |
| 77 |
pip uninstall -y authlib |
| 78 |
tox -e compile_catalog |
| 79 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 80 |
|
| 81 |
[testenv:noflasksqlalchemy] |
| 82 |
dependency_groups = tests |
| 83 |
commands = |
| 84 |
pip uninstall -y flask_sqlalchemy flask_sqlalchemy_lite |
| 85 |
tox -e compile_catalog |
| 86 |
pytest --basetemp={envtmpdir} {posargs:tests} |
| 87 |
|
| 88 |
[testenv:style] |
| 89 |
deps = pre-commit |
| 90 |
skip_install = true |
| 91 |
commands = |
| 92 |
pre-commit run --all-files --show-diff-on-failure |
| 93 |
|
| 94 |
[testenv:docs] |
| 95 |
dependency_groups = docs |
| 96 |
commands = sphinx-build -E -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html |
| 97 |
|
| 98 |
[testenv:update-actions] |
| 99 |
description = Update GitHub Action Pins |
| 100 |
labels = update |
| 101 |
deps = gha-update; python_full_version >= '3.12' |
| 102 |
skip_install = true |
| 103 |
commands = gha-update |
| 104 |
|
| 105 |
[testenv:update-pre_commit] |
| 106 |
description = Update pre-commit Pins |
| 107 |
labels = update |
| 108 |
deps = pre-commit |
| 109 |
skip_install = true |
| 110 |
commands = pre-commit autoupdate --freeze -j4 |
| 111 |
|
| 112 |
|
| 113 |
[testenv:coverage] |
| 114 |
dependency_groups = tests |
| 115 |
commands = |
| 116 |
tox -e compile_catalog |
| 117 |
coverage run --source=flask_security -m pytest |
| 118 |
coverage xml |
| 119 |
|
| 120 |
[testenv:realpostgres] |
| 121 |
dependency_groups = tests |
| 122 |
deps = psycopg2-binary |
| 123 |
commands = |
| 124 |
# Requires that --realdburl be set otherwise doesn't actually use DB |
| 125 |
tox -e compile_catalog |
| 126 |
pytest --basetemp={envtmpdir} {posargs} |
| 127 |
|
| 128 |
[testenv:makedist] |
| 129 |
dependency_groups = tests |
| 130 |
deps = |
| 131 |
flit |
| 132 |
twine |
| 133 |
check-wheel-contents |
| 134 |
commands = |
| 135 |
tox -e compile_catalog |
| 136 |
flit build --no-use-vcs |
| 137 |
check-wheel-contents dist |
| 138 |
|
| 139 |
[testenv:makedist-too] |
| 140 |
dependency_groups = tests |
| 141 |
deps = |
| 142 |
flit |
| 143 |
twine |
| 144 |
check-wheel-contents |
| 145 |
commands = |
| 146 |
tox -e compile_catalog |
| 147 |
flit -f pyproject-too.toml build --no-use-vcs |
| 148 |
check-wheel-contents dist |
| 149 |
|
| 150 |
[testenv:mypy] |
| 151 |
dependency_groups = |
| 152 |
tests |
| 153 |
typing |
| 154 |
commands = |
| 155 |
mypy --install-types --non-interactive flask_security tests |
| 156 |
# basedpyright --verifytypes flask_security --ignoreexternal |
| 157 |
|
| 158 |
|
| 159 |
[testenv:py{311,312,313,314}-appinstall] |
| 160 |
commands = python -c "from flask_security import Security; s = Security()" |
| 161 |
|
| 162 |
[testenv:compile_catalog] |
| 163 |
deps = babel |
| 164 |
skip_install = true |
| 165 |
commands = |
| 166 |
pybabel compile --domain flask_security -d flask_security/translations |
| 167 |
pybabel compile --domain flask_security -d tests/translations |
| 168 |
|
| 169 |
[testenv:extract_messages] |
| 170 |
deps = |
| 171 |
babel |
| 172 |
jinja2 |
| 173 |
skip_install = true |
| 174 |
commands = |
| 175 |
pybabel extract --version 5.9.1 --keyword=_fsdomain --project=Flask-Security \ |
| 176 |
-o flask_security/translations/flask_security.pot \ |
| 177 |
[email protected] --mapping-file=babel.ini \ |
| 178 |
--add-comments=NOTE flask_security |
| 179 |
|
| 180 |
[testenv:update_catalog] |
| 181 |
deps = babel |
| 182 |
skip_install = true |
| 183 |
commands = |
| 184 |
pybabel update --domain flask_security -i flask_security/translations/flask_security.pot \ |
| 185 |
-d flask_security/translations --no-fuzzy-matching |
| 186 |
pybabel update --domain flask_security -l cic_US -i flask_security/translations/flask_security.pot \ |
| 187 |
-d tests/translations --no-fuzzy-matching |
| 188 |
[flake8] |
| 189 |
max-line-length = 88 |
| 190 |
per-file-ignores = |
| 191 |
tests/view_scaffold.py: E402 |