Browse Source

Merge pull request #8889 from Atharva-Varpe/1.4-maint

tox: use native pyproject.toml configuration
TW 4 days ago
parent
commit
391248da6c
2 changed files with 49 additions and 32 deletions
  1. 49 0
      pyproject.toml
  2. 0 32
      tox.ini

+ 49 - 0
pyproject.toml

@@ -166,3 +166,52 @@ python_files = "testsuite/*.py"
 markers = [
     "allow_cache_wipe",
 ]
+
+# tox configuration - if you change anything here, run this to verify:
+# fakeroot -u tox --recreate
+[tool.tox]
+min_version = "4.19"
+requires = ["tox>=4.19", "pkgconfig", "cython", "wheel", "setuptools_scm"]
+env_list = ["py{39,310,311,312,313}-{none,fuse2,fuse3}", "ruff"]
+
+# Base configuration for test environments
+[tool.tox.env_run_base]
+description = "Run tests with pytest"
+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
+labels = ["test"]
+
+# Base configuration for package building
+[tool.tox.env_pkg_base]
+pass_env = ["*"]  # needed by tox4, so env vars are visible for building borg
+
+# Test environments with different FUSE implementations
+[tool.tox.env."py{39,310,311,312,313}-fuse2"]
+description = "Run tests with llfuse (FUSE2) implementation"
+set_env = {BORG_FUSE_IMPL = "llfuse"}
+deps = ["-rrequirements.d/development.txt", "llfuse"]
+labels = ["test", "fuse"]
+
+[tool.tox.env."py{39,310,311,312,313}-fuse3"]
+description = "Run tests with pyfuse3 (FUSE3) implementation"
+set_env = {BORG_FUSE_IMPL = "pyfuse3"}
+deps = ["-rrequirements.d/development.txt", "pyfuse3"]
+labels = ["test", "fuse"]
+
+[tool.tox.env."py{39,310,311,312,313}-none"]
+description = "Run tests without FUSE support"
+deps = ["-rrequirements.d/development.txt"]
+labels = ["test", "nofuse"]
+
+[tool.tox.env.ruff]
+description = "Run ruff linter and formatter"
+skip_install = true
+deps = ["ruff"]
+commands = [
+    ["ruff", "check", "."]
+]
+labels = ["lint"]

+ 0 - 32
tox.ini

@@ -1,32 +0,0 @@
-# tox configuration - if you change anything here, run this to verify:
-# fakeroot -u tox --recreate
-
-[tox]
-envlist = py{39,310,311,312,313}-{none,fuse2,fuse3}
-requires =
-    pkgconfig
-    cython
-    wheel
-    setuptools_scm
-
-[testenv]
-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 .