Skip to content

Commit d3a5bc4

Browse files
committed
Merge branch 'main' into at
2 parents ec90884 + 7ff0d0a commit d3a5bc4

18 files changed

+79
-105
lines changed

.all-contributorsrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@
171171
"profile": "https://github.com/crusaderky",
172172
"contributions": [
173173
"code",
174-
"doc"
174+
"doc",
175+
"tool"
175176
]
176177
}
177178
]

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ repos:
1212
additional_dependencies: [black==24.*]
1313

1414
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: "v4.6.0"
15+
rev: "v5.0.0"
1616
hooks:
1717
- id: check-added-large-files
1818
- id: check-case-conflict
@@ -35,14 +35,14 @@ repos:
3535
- id: rst-inline-touching-normal
3636

3737
- repo: https://github.com/rbubley/mirrors-prettier
38-
rev: "v3.3.3"
38+
rev: "v3.4.2"
3939
hooks:
4040
- id: prettier
4141
types_or: [yaml, markdown, html, css, scss, javascript, json]
4242
args: [--prose-wrap=always]
4343

4444
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
rev: "v0.6.1"
45+
rev: "v0.8.2"
4646
hooks:
4747
- id: ruff
4848
args: ["--fix", "--show-fixes"]
@@ -68,13 +68,13 @@ repos:
6868
exclude: .pre-commit-config.yaml
6969

7070
- repo: https://github.com/abravalheri/validate-pyproject
71-
rev: "v0.19"
71+
rev: "v0.23"
7272
hooks:
7373
- id: validate-pyproject
7474
additional_dependencies: ["validate-pyproject-schema-store[all]"]
7575

7676
- repo: https://github.com/python-jsonschema/check-jsonschema
77-
rev: "0.29.1"
77+
rev: "0.30.0"
7878
hooks:
7979
- id: check-dependabot
8080
- id: check-github-workflows

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ This project exists thanks to the following contributors
2828
</tr>
2929
<tr>
3030
<td align="center" valign="top" width="14.28%"><a href="https://ogrisel.com"><img src="https://avatars.githubusercontent.com/u/89061?v=4?s=100" width="100px;" alt="Olivier Grisel"/><br /><sub><b>Olivier Grisel</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=ogrisel" title="Code">💻</a></td>
31-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/crusaderky"><img src="https://avatars.githubusercontent.com/u/6213168?v=4?s=100" width="100px;" alt="Guido Imperiale"/><br /><sub><b>Guido Imperiale</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Code">💻</a> <a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Documentation">📖</a></td>
31+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/crusaderky"><img src="https://avatars.githubusercontent.com/u/6213168?v=4?s=100" width="100px;" alt="Guido Imperiale"/><br /><sub><b>Guido Imperiale</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Code">💻</a> <a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Documentation">📖</a> <a href="#tool-crusaderky" title="Tools">🔧</a></td>
3232
</tr>
3333
</tbody>
3434
</table>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ This project exists thanks to the following contributors
6666
</tr>
6767
<tr>
6868
<td align="center" valign="top" width="14.28%"><a href="https://ogrisel.com"><img src="https://avatars.githubusercontent.com/u/89061?v=4?s=100" width="100px;" alt="Olivier Grisel"/><br /><sub><b>Olivier Grisel</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=ogrisel" title="Code">💻</a></td>
69-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/crusaderky"><img src="https://avatars.githubusercontent.com/u/6213168?v=4?s=100" width="100px;" alt="Guido Imperiale"/><br /><sub><b>Guido Imperiale</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Code">💻</a> <a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Documentation">📖</a></td>
69+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/crusaderky"><img src="https://avatars.githubusercontent.com/u/6213168?v=4?s=100" width="100px;" alt="Guido Imperiale"/><br /><sub><b>Guido Imperiale</b></sub></a><br /><a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Code">💻</a> <a href="https://github.com/data-apis/array-api-extra/commits?author=crusaderky" title="Documentation">📖</a> <a href="#tool-crusaderky" title="Tools">🔧</a></td>
7070
</tr>
7171
</tbody>
7272
</table>

docs/conf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
import importlib.metadata
42
from typing import Any
53

@@ -38,7 +36,7 @@
3836
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
3937
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
4038
</svg>
41-
""",
39+
""", # noqa: E501
4240
"class": "",
4341
},
4442
],

docs/contributing.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,25 @@ pixi shell -e dev
4343
pixi run tests
4444
```
4545

46+
- To generate the coverage report:
47+
48+
```
49+
pixi run coverage
50+
```
51+
52+
- To generate and display the coverage report:
53+
54+
```
55+
pixi run open-coverage
56+
```
57+
4658
- To build the docs locally:
4759

4860
```
4961
pixi run docs
5062
```
5163

52-
- To open and preview the locally-built docs:
64+
- To build and preview the docs locally:
5365

5466
```
5567
pixi run open-docs

pixi.lock

Lines changed: 29 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,14 @@ pre-commit = "*"
7878
pylint = "*"
7979
basedmypy = "*"
8080
basedpyright = "*"
81-
typing_extensions = ">=4.12.2,<4.13"
8281
# import dependencies for mypy:
8382
array-api-strict = "*"
8483
numpy = "*"
8584
pytest = "*"
8685

8786
[tool.pixi.feature.lint.tasks]
8887
pre-commit-install = { cmd = "pre-commit install" }
89-
pre-commit = { cmd = "pre-commit run -v --all-files --show-diff-on-failure" }
88+
pre-commit = { cmd = "pre-commit run --all-files" }
9089
mypy = { cmd = "mypy", cwd = "." }
9190
pylint = { cmd = ["pylint", "array_api_extra"], cwd = "src" }
9291
pyright = { cmd = "basedpyright", cwd = "." }
@@ -99,21 +98,22 @@ array-api-strict = "*"
9998
numpy = "*"
10099

101100
[tool.pixi.feature.tests.tasks]
102-
tests = { cmd = "pytest" }
103-
tests-ci = { cmd = "pytest -ra --cov --cov-report=xml --cov-report=term --durations=20" }
101+
tests = { cmd = "pytest -v" }
102+
tests-ci = { cmd = "pytest -v -ra --cov --cov-report=xml --cov-report=term --durations=20" }
104103
tests-vendor = { cmd = "pytest vendor_tests" }
104+
coverage = { cmd = ["coverage", "html"], depends-on = ["tests-ci"] }
105+
open-coverage = { cmd = ["open", "htmlcov/index.html"], depends-on = ["coverage"] }
105106

106107
[tool.pixi.feature.docs.dependencies]
107108
sphinx = ">=7.0"
108109
furo = ">=2023.08.17"
109110
myst-parser = ">=0.13"
110111
sphinx-copybutton = "*"
111112
sphinx-autodoc-typehints = "*"
112-
typing_extensions = ">=4.12.2,<4.13"
113113

114114
[tool.pixi.feature.docs.tasks]
115115
docs = { cmd = ["sphinx-build", ".", "build/"], cwd = "docs" }
116-
open-docs = { cmd = ["open", "build/index.html"], cwd = "docs" }
116+
open-docs = { cmd = ["open", "build/index.html"], cwd = "docs", depends-on = ["docs"] }
117117

118118
[tool.pixi.feature.dev.dependencies]
119119
ipython = "*"
@@ -189,6 +189,7 @@ run.source = ["array_api_extra"]
189189
report.exclude_also = [
190190
'\.\.\.',
191191
'if typing.TYPE_CHECKING:',
192+
'if TYPE_CHECKING:',
192193
]
193194

194195

@@ -237,11 +238,16 @@ target-version = "py310"
237238
[tool.ruff.lint]
238239
extend-select = [
239240
"B", # flake8-bugbear
241+
"F", # Pyflakes
240242
"I", # isort
243+
"E", # Pycodestyle
244+
"W", # Pycodestyle
245+
"N", # pep8-naming
241246
"ARG", # flake8-unused-arguments
242247
"C4", # flake8-comprehensions
243248
"EM", # flake8-errmsg
244249
"ICN", # flake8-import-conventions
250+
"ISC", # flake8-implicit-str-concat
245251
"G", # flake8-logging-format
246252
"PGH", # pygrep-hooks
247253
"PIE", # flake8-pie
@@ -257,11 +263,15 @@ extend-select = [
257263
"EXE", # flake8-executable
258264
"NPY", # NumPy specific rules
259265
"PD", # pandas-vet
266+
"UP", # Pyupgrade
260267
]
261268
ignore = [
262269
"PLR09", # Too many <...>
263270
"PLR2004", # Magic value used in comparison
264271
"ISC001", # Conflicts with formatter
272+
"N801", # Class name should use CapWords convention
273+
"N802", # Function name should be lowercase
274+
"N806", # Variable in function should be lowercase
265275
"PD008", # Use `.loc` instead of `.at`
266276
]
267277

src/array_api_extra/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990
2-
31
from ._funcs import (
42
at,
53
atleast_nd,

src/array_api_extra/_funcs.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from __future__ import annotations # https://github.com/pylint-dev/pylint/pull/9990
1+
from __future__ import annotations
22

33
import operator
4-
import typing
54
import warnings
65

76
# https://github.com/pylint-dev/pylint/issues/10112
@@ -14,9 +13,7 @@
1413
is_jax_array,
1514
is_writeable_array,
1615
)
17-
18-
if typing.TYPE_CHECKING:
19-
from ._lib._typing import Array, Index, ModuleType
16+
from ._lib._typing import Array, Index, ModuleType
2017

2118
__all__ = [
2219
"at",

0 commit comments

Comments
 (0)