Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repoHost": "https://github.com",
"files": [
"README.md",
"CONTRIBUTORS.md"
"docs/CONTRIBUTORS.md"
],
"imageSize": 100,
"commitType": "docs",
Expand Down
File renamed without changes.
4 changes: 1 addition & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

.github/* export-ignore
.git* export-ignore
codecov.yml export-ignore
.codecov.yml export-ignore
pixi.lock export-ignore
RELEASING.md export-ignore
renovate.json export-ignore

# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
File renamed without changes.
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: docs-build
path: docs/build/
path: docs/sphinx/build/

docs-deploy:
name: Deploy
Expand All @@ -60,10 +60,10 @@ jobs:
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: docs-build
path: docs/build/
path: docs/sphinx/build/

- name: Deploy
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
folder: docs/build/
folder: docs/sphinx/build/
ssh-key: ${{ secrets.DEPLOY_KEY }}
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
docs/generated/
docs/sphinx/_build/
docs/sphinx/generated/

# PyBuilder
.pybuilder/
Expand Down Expand Up @@ -163,9 +163,9 @@ Thumbs.db
.pixi
*.egg-info

# Vendor tests
vendor_tests/array_api_compat/
vendor_tests/array_api_extra/
# Vendoring tests
tests/vendoring/array_api_compat/
tests/vendoring/array_api_extra/

# all-contributors
node_modules
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/conf.py → docs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

_SOURCE_REPOSITORY = "https://github.com/data-apis/array-api-extra"
_SOURCE_BRANCH = "main"
_REPOSITORY_ROOT = Path(__file__).resolve().parent.parent
_REPOSITORY_ROOT = Path(__file__).resolve().parent.parent.parent
_PACKAGE_SOURCE_ROOT = _REPOSITORY_ROOT / "src"

project = "array-api-extra"
Expand Down Expand Up @@ -56,7 +56,7 @@
],
"source_repository": _SOURCE_REPOSITORY,
"source_branch": _SOURCE_BRANCH,
"source_directory": "docs/",
"source_directory": "docs/sphinx/",
}

myst_enable_extensions = [
Expand Down
4 changes: 2 additions & 2 deletions docs/contributing.md → docs/sphinx/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ pixi shell --environment=dev
- Add your function to `__all__` at the top of the file.
- Import your function to `src/array_api_extra/__init__.py`
and add it to`__all__` there.
- Add a test class for your function in the corresponding file under `tests/`.
- Add a test class for your function in the corresponding file under `tests/main/`.
- Ensure that `lazy_xp_function` is called on the function if lazy backends
are supposed to be tested.
- Add your function to the corresponding API page under `docs/`.
- Add your function to the corresponding API page under `docs/sphinx/`.
- Don't worry if you are not sure how to do some of the above steps or think you
might have done something wrong —
[make a PR!](https://github.com/data-apis/array-api-extra/pulls)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,3 @@ foreach subdir, files : sources
endforeach

subdir('tests')
subdir('vendor_tests')
28 changes: 14 additions & 14 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,12 @@ scipy = ">=1.15.2"
[feature.tests.tasks]
tests = {
description = "Run tests",
cmd = "pytest -v",
cmd = "pytest -v tests/main",
default-environment = "tests",
}
tests-cov = {
description = "Run tests with coverage",
cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20",
cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20 tests/main",
default-environment = "tests",
}

Expand All @@ -248,36 +248,36 @@ open-coverage = {

clean-vendor-compat = {
description = "Delete the existing vendored version of array-api-compat",
cmd = "rm -rf vendor_tests/array_api_compat",
cmd = "rm -rf tests/vendoring/array_api_compat",
default-environment = "tests",
}
clean-vendor-extra = {
description = "Delete the existing vendored version of array-api-extra",
cmd = "rm -rf vendor_tests/array_api_extra",
cmd = "rm -rf tests/vendoring/array_api_extra",
default-environment = "tests",
}
copy-vendor-compat = {
description = "Vendor a clean copy of array-api-compat",
depends-on = ["clean-vendor-compat"],
cmd = "cp -r $(python -c 'import array_api_compat, pathlib; print(pathlib.Path(array_api_compat.__file__).parent)') vendor_tests/ && rm -rf vendor_tests/array_api_compat/vendor_tests && rm -rf vendor_tests/array_api_compat/tests",
cmd = "cp -r $(python -c 'import array_api_compat, pathlib; print(pathlib.Path(array_api_compat.__file__).parent)') tests/vendoring/ && rm -rf tests/vendoring/array_api_compat/vendor_tests && rm -rf tests/vendoring/array_api_compat/tests",
default-environment = "tests",
}
copy-vendor-extra = {
description = "Vendor a clean copy of array-api-extra",
depends-on = ["clean-vendor-extra"],
cmd = "cp -r src/array_api_extra vendor_tests/",
cmd = "cp -r src/array_api_extra tests/vendoring/",
default-environment = "tests",
}
tests-vendor = {
tests-vendoring = {
description = "Check that array-api-extra and array-api-compat can be vendored together",
depends-on = ["copy-vendor-compat", "copy-vendor-extra"],
cmd = "pytest -v vendor_tests",
cmd = "pytest -v tests/vendoring",
default-environment = "tests",
}

tests-ci = {
description = "Run tests with coverage and vendor tests",
depends-on = ["tests-cov", "tests-vendor"],
depends-on = ["tests-cov", "tests-vendoring"],
}

# tests with only run dependencies
Expand All @@ -288,12 +288,12 @@ pytest-cov = ">=7.1.0"
[feature.tests-run-deps.tasks]
tests-run-deps = {
description = "Run run-dependency tests",
cmd = "pytest -v run_deps_tests",
cmd = "pytest -v tests/run_deps",
default-environment = "tests-run-deps",
}
tests-run-deps-cov = {
description = "Run run-dependency tests with coverage",
cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20 run_deps_tests",
cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20 tests/run_deps",
default-environment = "tests-run-deps",
}

Expand All @@ -312,14 +312,14 @@ numpy = ">=2.1.3"
[feature.docs.tasks]
docs = {
description = "Build docs",
cwd = "docs",
cwd = "docs/sphinx/",
cmd = "sphinx-build -E -W . build/",
default-environment = "docs",
}
open-docs = {
description = "Open the generated docs",
depends-on = ["docs"],
cwd = "docs",
cwd = "docs/sphinx/",
cmd = "open build/index.html",
default-environment = "docs",
}
Expand All @@ -328,7 +328,7 @@ open-docs = {
open-docs = {
description = "Open the generated docs",
depends-on = ["docs"],
cwd = "docs",
cwd = "docs/sphinx/",
cmd = "cmd /c start build/index.html",
default-environment = "docs",
}
Expand Down
37 changes: 20 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ requires = ["meson-python"]
build-backend = "mesonpy"

[tool.basedpyright]
include = ["src", "tests", "vendor_tests", "run_deps_tests"]
exclude = ["vendor_tests/array_api_compat"]
include = ["src", "tests"]
exclude = ["tests/vendoring/array_api_compat"]
pythonVersion = "3.11"
pythonPlatform = "All"
typeCheckingMode = "all"
Expand All @@ -63,17 +63,15 @@ reportUnknownLambdaType = false
reportImplicitStringConcatenation = false

executionEnvironments = [
{ root = "tests", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "vendor_tests", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "run_deps_tests", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "tests/", reportPrivateUsage = false, reportUnknownArgumentType = false },
{ root = "src" },
]

[tool.coverage]
run.source = ["array_api_extra"]

[tool.mypy]
files = ["src", "tests", "vendor_tests", "run_deps_tests"]
files = ["src", "tests"]
python_version = "3.11"
warn_unused_configs = true
strict = true
Expand All @@ -90,17 +88,9 @@ module = ["tests/*"]
disable_error_code = ["no-untyped-def"] # test(...) without -> None

[[tool.mypy.overrides]]
module = ["vendor_tests/*"]
disable_error_code = ["no-untyped-def"] # test(...) without -> None

[[tool.mypy.overrides]]
module = ["vendor_tests/array_api_compat/*"]
module = ["tests/vendoring/array_api_compat/*"]
ignore_errors = true

[[tool.mypy.overrides]]
module = ["run_deps_tests/*"]
disable_error_code = ["no-untyped-def"] # test(...) without -> None

[tool.numpydoc_validation]
checks = [
"all", # report on all checks, except the below
Expand All @@ -110,7 +100,6 @@ checks = [
]
exclude_files = [
"^tests/.*",
"^vendor_tests/.*",
]

[tool.pylint]
Expand Down Expand Up @@ -148,7 +137,7 @@ matches = "tests/*.py"
errors = { unannotated-return = false }

[[tool.pyrefly.sub-config]]
matches = "vendor_tests/*.py"
matches = "tests/vendoring/*.py"
errors = { unannotated-return = false }

[[tool.pyrefly.sub-config]]
Expand Down Expand Up @@ -209,3 +198,17 @@ ignore = [
"N806", # Variable in function should be lowercase
"PLC0415", # `import` should be at the top-level of a file
]

[tool.tombi]
toml-version = "v1.1.0"
format.rules.line-width = 100

[tool.typos.files]
extend-exclude = [".git/", ".pixi/"]
ignore-hidden = false

[tool.typos.default.extend-words]
nd = "nd"
typ = "typ"
cardinalis = "cardinalis"
writeable = "writeable"
2 changes: 1 addition & 1 deletion tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""Needed to import .conftest from the test modules."""
"""Tests"""
1 change: 1 addition & 0 deletions tests/main/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Needed to import .conftest from the test modules."""
File renamed without changes.
24 changes: 24 additions & 0 deletions tests/main/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
py.install_sources([
'__init__.py',
'conftest.py',
'test_at.py',
'test_creation.py',
'test_deprecation.py',
'test_elementwise.py',
'test_helpers.py',
'test_indexing.py',
'test_inspection.py',
'test_lazy.py',
'test_linalg.py',
'test_manipulation.py',
'test_public_api.py',
'test_searching.py',
'test_set.py',
'test_sorting.py',
'test_statistical.py',
'test_testing.py',
'test_version.py',
],
subdir: 'array_api_extra/tests/main',
install_tag: 'tests',
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 6 additions & 22 deletions tests/meson.build
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
py.install_sources([
'__init__.py',
'conftest.py',
'test_at.py',
'test_creation.py',
'test_deprecation.py',
'test_elementwise.py',
'test_helpers.py',
'test_indexing.py',
'test_inspection.py',
'test_lazy.py',
'test_linalg.py',
'test_manipulation.py',
'test_public_api.py',
'test_searching.py',
'test_set.py',
'test_sorting.py',
'test_statistical.py',
'test_testing.py',
'test_version.py',
],
subdir: 'array_api_extra/tests',
py.install_sources(['__init__.py',],
subdir: 'array_api_extra/tests/',
install_tag: 'tests',
)

subdir('main')
subdir('run_deps')
subdir('vendoring')
File renamed without changes.
7 changes: 7 additions & 0 deletions tests/run_deps/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
py.install_sources([
'__init__.py',
'test_run_deps.py',
],
subdir: 'array_api_extra/tests/run_deps',
install_tag: 'tests',
)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion vendor_tests/meson.build → tests/vendoring/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ py.install_sources([
'_array_api_compat_vendor.py',
'test_vendor.py',
],
subdir: 'array_api_extra/vendor_tests',
subdir: 'array_api_extra/tests/vendoring',
install_tag: 'tests',
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import array_api_strict as xp
from numpy.testing import assert_array_equal

from vendor_tests.array_api_compat.common._typing import ( # type: ignore[import-not-found]
from tests.vendoring.array_api_compat.common._typing import ( # type: ignore[import-not-found]
Array,
)

Expand Down
2 changes: 0 additions & 2 deletions tombi.toml

This file was deleted.

9 changes: 0 additions & 9 deletions typos.toml

This file was deleted.