Преглед на файлове

Merge pull request #8880 from Atharva-Varpe/master

tox: use native pyproject.toml configuration
TW преди 1 месец
родител
ревизия
04000f7fed
променени са 2 файла, в които са добавени 39 реда и са изтрити 50 реда
  1. 39 0
      pyproject.toml
  2. 0 50
      tox.ini

+ 39 - 0
pyproject.toml

@@ -156,3 +156,42 @@ module = [
     "borg.platform.*",
     "borg.platform.*",
 ]
 ]
 ignore_missing_imports = true
 ignore_missing_imports = true
+
+[tool.tox]
+requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
+env_list = ["py{310,311,312,313}-{none,fuse2,fuse3}", "docs", "ruff", "mypy"]
+
+[tool.tox.env_run_base]
+package = "editable-legacy"  # without this it does not find setup_docs when running under fakeroot
+deps = ["-rrequirements.d/development.txt"]
+commands = [["pytest", "-v", "-n", "{env:XDISTN:1}", "-rs", "--cov=borg", "--cov-config=.coveragerc", "--benchmark-skip", "--pyargs", "{posargs:borg.testsuite}"]]
+pass_env = ["*"]  # fakeroot -u needs some env vars
+
+[tool.tox.env_pkg_base]
+pass_env = ["*"]  # needed by tox4, so env vars are visible for building borg
+
+# Environment-specific configurations
+[tool.tox.env."py{310,311,312,313}-fuse2"]
+set_env = {BORG_FUSE_IMPL = "llfuse"}
+deps = ["-rrequirements.d/development.txt", "llfuse"]
+
+[tool.tox.env."py{310,311,312,313}-fuse3"]
+set_env = {BORG_FUSE_IMPL = "pyfuse3"}
+deps = ["-rrequirements.d/development.txt", "pyfuse3"]
+
+[tool.tox.env."py{310,311,312,313}-none"]
+deps = ["-rrequirements.d/development.txt"]
+
+[tool.tox.env.ruff]
+skip_install = true
+deps = ["ruff"]
+commands = [["ruff", "check", "."]]
+
+[tool.tox.env.mypy]
+deps = ["pytest", "mypy", "pkgconfig"]
+commands = [["mypy", "--ignore-missing-imports"]]
+
+[tool.tox.env.docs]
+change_dir = "docs"
+deps = ["sphinx", "sphinxcontrib-jquery", "guzzle_sphinx_theme"]
+commands = [["sphinx-build", "-n", "-v", "-W", "--keep-going", "-b", "html", "-d", "{envtmpdir}/doctrees", ".", "{envtmpdir}/html"]]

+ 0 - 50
tox.ini

@@ -1,50 +0,0 @@
-# tox configuration - if you change anything here, run this to verify:
-# fakeroot -u tox --recreate
-
-[tox]
-envlist = py{310,311,312,313}-{none,fuse2,fuse3},docs
-minversion = 3.2
-requires =
-    pkgconfig
-    cython
-    wheel
-    setuptools_scm
-
-[testenv]
-package = editable-legacy  # without this it does not find setup_docs when running under fakeroot
-setenv =
-   fuse2: BORG_FUSE_IMPL=llfuse
-   fuse3: BORG_FUSE_IMPL=pyfuse3
-deps =
-    fuse2: llfuse
-    fuse3: pyfuse3
-    -rrequirements.d/development.txt
-commands = pytest -v -n {env:XDISTN:1} -rs --cov=borg --cov-config=.coveragerc --benchmark-skip --pyargs {posargs:borg.testsuite}
-# fakeroot -u needs some env vars:
-passenv = *
-
-[testenv:.pkg]
-passenv = *  # needed by tox4, so env vars are visible for building borg
-
-[testenv:ruff]
-skip_sdist=true
-skip_install=true
-deps =
-    ruff
-commands = ruff check .
-
-[testenv:mypy]
-deps =
-    pytest
-    mypy
-    pkgconfig
-commands = mypy --ignore-missing-imports
-
-[testenv:docs]
-changedir = docs
-deps =
-    sphinx
-    sphinxcontrib-jquery
-    guzzle_sphinx_theme
-commands =
-    sphinx-build -n -v -W --keep-going -b html -d {envtmpdir}/doctrees . {envtmpdir}/html