Skip to content

Commit 4d5a85c

Browse files
authored
Run vendor tests locally with pixi (#65)
1 parent 7e6ccf9 commit 4d5a85c

File tree

3 files changed

+20
-68
lines changed

3 files changed

+20
-68
lines changed

.github/workflows/test-vendor.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

pixi.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ numpy = "*"
7979
pytest = "*"
8080

8181
[tool.pixi.feature.lint.tasks]
82-
pre-commit-install = { cmd = "pre-commit install" }
83-
pre-commit = { cmd = "pre-commit run --all-files" }
84-
mypy = { cmd = "mypy", cwd = "." }
85-
pylint = { cmd = ["pylint", "array_api_extra"], cwd = "src" }
86-
pyright = { cmd = "basedpyright", cwd = "." }
82+
pre-commit-install = "pre-commit install"
83+
pre-commit = "pre-commit run --all-files"
84+
mypy = "mypy"
85+
pylint = { cmd = "pylint array_api_extra", cwd = "src" }
86+
pyright = "basedpyright"
8787
lint = { depends-on = ["pre-commit", "pylint", "mypy", "pyright"] }
8888

8989
[tool.pixi.feature.tests.dependencies]
@@ -93,11 +93,18 @@ array-api-strict = "*"
9393
numpy = "*"
9494

9595
[tool.pixi.feature.tests.tasks]
96-
tests = { cmd = "pytest -v" }
97-
tests-ci = { cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20" }
98-
tests-vendor = { cmd = "pytest vendor_tests" }
99-
coverage = { cmd = ["coverage", "html"], depends-on = ["tests-ci"] }
100-
open-coverage = { cmd = ["open", "htmlcov/index.html"], depends-on = ["coverage"] }
96+
tests = "pytest -v"
97+
tests-cov = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20"
98+
99+
clean-vendor-compat = "rm -rf vendor_tests/array_api_compat"
100+
clean-vendor-extra = "rm -rf vendor_tests/array_api_extra"
101+
copy-vendor-compat = { cmd = "cp -r $(python -c 'import site; print(site.getsitepackages()[0])')/array_api_compat vendor_tests/", depends-on = ["clean-vendor-compat"] }
102+
copy-vendor-extra = { cmd = "cp -r src/array_api_extra vendor_tests/", depends-on = ["clean-vendor-extra"] }
103+
tests-vendor = { cmd = "pytest -v vendor_tests", depends-on = ["copy-vendor-compat", "copy-vendor-extra"] }
104+
105+
tests-ci = { depends-on = ["tests-cov", "tests-vendor"] }
106+
coverage = { cmd = "coverage html", depends-on = ["tests-cov"] }
107+
open-coverage = { cmd = "open htmlcov/index.html", depends-on = ["coverage"] }
101108

102109
[tool.pixi.feature.docs.dependencies]
103110
sphinx = ">=7.0"
@@ -107,8 +114,8 @@ sphinx-copybutton = "*"
107114
sphinx-autodoc-typehints = "*"
108115

109116
[tool.pixi.feature.docs.tasks]
110-
docs = { cmd = ["sphinx-build", ".", "build/"], cwd = "docs" }
111-
open-docs = { cmd = ["open", "build/index.html"], cwd = "docs", depends-on = ["docs"] }
117+
docs = { cmd = "sphinx-build . build/", cwd = "docs" }
118+
open-docs = { cmd = "open build/index.html", cwd = "docs", depends-on = ["docs"] }
112119

113120
[tool.pixi.feature.dev.dependencies]
114121
ipython = "*"

0 commit comments

Comments
 (0)