diff --git a/pyproject.toml b/pyproject.toml index 6b13bc3c7..31f49d7dd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -151,34 +151,39 @@ unfixable = [] exclude_dirs = ["quickinstall.py", "*/_tests/*", "*/_ui_tests/*"] skips = ["B101", "B105", "B106", "B307", "B311", "B403", "B608"] -[tool.tox] -legacy_tox_ini = """ # tox configuration - if you change anything here, run this to verify: # tox --recreate # run like this: # tox -# tox -e py39 +# tox run -e py39 # tox -- -v -k test_wikiutil # tox -- -v -[tox] -envlist = py{39,310,311,312},ruff - -[testenv] -deps = -rrequirements.d/development.txt -setenv = - # some tests expect a specific order in dicts... - PYTHONHASHSEED = 0 - # needed so that lxml can build from source (e.g. on pypy): - CFLAGS = -I/usr/include/libxml2 -commands = pytest -rs --pyargs {posargs:moin} - -[testenv:ruff] -skip_sdist=true -skip_install=true -changedir = -deps = - ruff -commands = ruff check . -""" +[tool.tox] +requires = ["tox>=4.21"] +envlist = ["3.9", "3.10", "3.11", "3.12", "ruff"] + +[tool.tox.env_run_base] +description = "Run tests under {base_python}" +deps = [ + "-r requirements.d/development.txt" +] +commands = [ + ["pytest", "-rs", "--pyargs", { replace="posargs", default=["moin"], extend=true }] +] + +[tool.tox.env_run_base.set_env] +# some tests expect a specific order in dicts... +PYTHONHASHSEED = "0" +# needed so that lxml can build from source (e.g. on pypy): +CFLAGS = "-I/usr/include/libxml2" + +[tool.tox.env.ruff] +description = "Run the ruff linter on the moin sources" +deps = ["ruff"] +package = "skip" +change_dir = "" +commands = [ + ["ruff", "check", "."] +] diff --git a/requirements.d/development.txt b/requirements.d/development.txt index 3db56d598..53568f772 100644 --- a/requirements.d/development.txt +++ b/requirements.d/development.txt @@ -1,8 +1,8 @@ -tox +tox>=4.21.0 psutil pytest # we use lxml.etree for xpath-based testing lxml # for sitetesting scrapy>=2.10.1 -pre-commit \ No newline at end of file +pre-commit