1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308
|
[tox]
ignore_basepython_conflict = True
skip_missing_interpreters = True
envlist =
about
autopep8
docformatter
isort
pylint
pylint_tests
flake8
flake8_tests
pydocstyle
mypy
sphinx
py{37,38,39,310,311,312,313,314}
####### Python Test Environments #######
[testenv]
basepython = python3.14
passenv =
TEST_QUICK
TEST_KEYBOARD
TEST_RAW
setenv =
TEST_QUICK = {env:TEST_QUICK:1}
deps =
pytest
pytest-cov
pytest-xdist
commands =
pytest {posargs: --strict-markers --verbose --durations=3} tests
[testenv:py314]
setenv =
TEST_QUICK = {env:TEST_QUICK:0}
TEST_KEYBOARD = {env:TEST_KEYBOARD:1}
####### Linting and Formatting Environments #######
[testenv:autopep8]
deps =
autopep8
commands =
autopep8 --in-place --recursive --aggressive --aggressive blessed/ bin/ tests/
[testenv:docformatter]
# docformatter not yet compatible with py314
basepython = python3.13
deps =
docformatter>=1.7.7
untokenize
commands =
docformatter \
--in-place \
--recursive \
--pre-summary-newline \
--wrap-summaries=100 \
--wrap-descriptions=100 \
{toxinidir}/blessed/ \
{toxinidir}/bin \
{toxinidir}/docs/conf.py
[testenv:docformatter_check]
# docformatter not yet compatible with py314
basepython = python3.13
deps =
docformatter>=1.7.7
untokenize
commands =
docformatter \
--check \
--recursive \
--pre-summary-newline \
--wrap-summaries=100 \
--wrap-descriptions=100 \
{toxinidir}/blessed/ \
{toxinidir}/bin \
{toxinidir}/docs/conf.py
[testenv:flake8]
deps =
flake8
commands =
flake8 --exclude=tests,docs/sphinxext/github.py docs/ blessed/ bin/
[testenv:flake8_tests]
deps =
{[testenv:flake8]deps}
commands =
flake8 --ignore=W504,F401 tests/
[testenv:isort]
extras = docs
deps =
{[testenv]deps}
isort
commands =
isort blessed
[testenv:isort_check]
deps =
{[testenv:isort]deps}
commands =
isort --diff --check-only blessed
[testenv:linkcheck]
extras = docs
commands =
sphinx-build -v -W -d {toxinidir}/docs/_build/doctrees -b linkcheck docs docs/_build/linkcheck
[testenv:mypy]
deps =
mypy
commands =
mypy --config-file=tox.ini --strict --explicit-package-bases blessed
[mypy]
# Our typing information is very poorly done, it was designed by Erik Rose before python
# typing was possible, and was considered "pythonic" at the time, but can't pass mustard
# at all, that 'term.any_thing' can be resolved to a termcap, and that terminical
# capability can be used like a string, but also that it can be called, and those calls
# could be strings, or numbers, it's too much dynamism to handle. It even makes out library difficult
# to work with,
disable_error_code = type-var,name-defined,operator,attr-defined,comparison-overlap,arg-type,no-any-return,has-type,no-untyped-call,return-value,call-overload,misc,override
[mypy-curses.has_key.*]
ignore_missing_imports = True
[mypy-jinxed.*]
ignore_missing_imports = True
[mypy-wcwidth.*]
ignore_missing_imports = True
[testenv:pydocstyle]
deps =
pydocstyle
restructuredtext_lint
doc8
pygments
commands =
pydocstyle --source --explain {toxinidir}/blessed
rst-lint README.rst
doc8 --ignore-path docs/_build --ignore D000 docs
[testenv:pylint]
deps =
pylint
commands =
pylint {posargs} blessed
[testenv:pylint_tests]
deps =
{[testenv]deps}
pylint
commands =
# Disable test-specific checks here. Global disables are in pyproject.toml
pylint \
--disable invalid-name \
--disable import-outside-toplevel \
--disable protected-access \
--disable use-implicit-booleaness-not-comparison-to-string \
--disable unused-argument \
{posargs} tests
[testenv:codespell]
deps =
codespell
commands =
codespell --skip="MANIFEST.in,*.pyc,htmlcov,_build,build,*.egg-info" \
--ignore-words .spelling-ignore-words.txt \
--uri-ignore-words-list '*' \
--summary --count
[testenv:format]
# docformatter not yet compatible with py314
basepython = python3.13
deps =
{[testenv:isort]deps}
{[testenv:docformatter]deps}
{[testenv:autopep8]deps}
commands =
{[testenv:isort]commands}
{[testenv:docformatter]commands}
{[testenv:autopep8]commands}
[testenv:lint]
# docformatter not yet compatible with py314
basepython = python3.13
deps =
{[testenv:docformatter_check]deps}
{[testenv:flake8]deps}
{[testenv:flake8_tests]deps}
{[testenv:isort_check]deps}
{[testenv:mypy]deps}
{[testenv:pydocstyle]deps}
{[testenv:pylint]deps}
{[testenv:pylint_tests]deps}
{[testenv:codespell]deps}
commands =
{[testenv:docformatter_check]commands}
{[testenv:flake8]commands}
{[testenv:flake8_tests]commands}
{[testenv:isort_check]commands}
{[testenv:mypy]commands}
{[testenv:pydocstyle]commands}
{[testenv:pylint]commands}
{[testenv:pylint_tests]commands}
{[testenv:codespell]commands}
####### Utility Environments #######
[testenv:about]
basepython = {env:TOXPYTHON:{[testenv]basepython}}
commands =
python -VV
python {toxinidir}/bin/display-sighandlers.py
python {toxinidir}/bin/display-terminalinfo.py
python {toxinidir}/bin/display-fpathconf.py
python {toxinidir}/bin/display-modes.py
python {toxinidir}/bin/display-version.py
[testenv:develop]
commands =
{posargs}
[testenv:publish_static]
# Synchronize the artifacts in docs/_static/ with https://dxtz6bzwq9sxx.cloudfront.net/
deps =
awscli
commands =
aws s3 sync --exclude '*.DS_Store*' --delete --acl=public-read docs/_static/ s3://python-blessed/
[testenv:sphinx]
extras = docs
commands =
sphinx-build {posargs:-v -W -d {toxinidir}/docs/_build/doctrees -b html docs {toxinidir}/docs/_build/html}
####### TOOL CONFIGS #######
[coverage:run]
branch = True
parallel = True
source =
blessed
omit =
tests/*
data_file = .coverage.${TOX_ENV_NAME}
[coverage:report]
precision = 1
exclude_lines =
pragma: no cover
[doc8]
max-line-length = 100
[flake8]
max-line-length = 100
exclude = .tox,build
[isort]
line_length = 100
indent = ' '
multi_line_output = 1
length_sort = 1
import_heading_stdlib = std imports
import_heading_thirdparty = 3rd party
import_heading_firstparty = local
import_heading_localfolder = local
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
no_lines_before=LOCALFOLDER
known_third_party = jinxed
atomic = true
[pydocstyle]
ignore =
D101, # Missing docstring in public class
D105, # Missing docstring in magic method
D203, # 1 blank line required before class docstring
D204, # 1 blank line required after class docstring
D212, # Multi-line docstring summary should start at the first line
D401 # First line should be in imperative mood
[pytest]
addopts =
--color=yes
--cov
--cov-append
--cov-report=xml
--disable-pytest-warnings
--ignore=.tox
--junit-xml=.tox/results.{envname}.xml
# if any test takes over 30 seconds, dump traceback
faulthandler_timeout = 30
filterwarnings = error
junit_family = xunit1
log_format=%(levelname)s %(relativeCreated)2.2f %(filename)s:%(lineno)d %(message)s
norecursedirs = .git .tox build
|