Skip to content

Commit f5f9bb6

Browse files
authored
Merge branch 'main' into ig/parallel_kernels
2 parents e91911a + 099cd51 commit f5f9bb6

3 files changed

Lines changed: 59 additions & 144 deletions

File tree

.pre-commit-config.yaml

Lines changed: 16 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,21 @@ repos:
66
- id: trailing-whitespace
77
- id: no-commit-to-branch
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: v0.14.14
9+
rev: v0.15.4
1010
hooks:
1111
- id: ruff-check
1212
args: [--fix, --exit-non-zero-on-fix]
1313
- id: ruff-check
1414
args: [--preview, --select=CPY]
1515
- id: ruff-format
1616
- repo: https://github.com/tox-dev/pyproject-fmt
17-
rev: v2.12.1
17+
rev: v2.16.2
1818
hooks:
1919
- id: pyproject-fmt
2020
- repo: https://github.com/biomejs/pre-commit
21-
rev: v2.3.10
21+
rev: v2.4.4
2222
hooks:
2323
- id: biome-format
24-
- repo: https://github.com/H4rryK4ne/update-mypy-hook
25-
rev: v0.3.0
26-
hooks:
27-
- id: update-mypy-hook
2824
- repo: https://github.com/pre-commit/mirrors-mypy
2925
rev: v1.19.1
3026
hooks:
@@ -33,77 +29,20 @@ repos:
3329
pass_filenames: false
3430
language_version: '3.13'
3531
additional_dependencies:
36-
- alabaster==1.0.0
37-
- anndata==0.12.7
38-
- array-api-compat==1.13.0
39-
- babel==2.17.0
40-
- certifi==2026.1.4
41-
- cffi==2.0.0
42-
- charset-normalizer==3.4.4
43-
- click==8.3.1
44-
- cloudpickle==3.1.2
45-
- colorama==0.4.6 ; sys_platform == 'win32'
46-
- coverage==7.13.1
47-
- dask==2026.1.1
48-
- docutils==0.22.4
49-
- donfig==0.8.1.post1
50-
- execnet==2.1.2
51-
- fsspec==2026.1.0
52-
- google-crc32c==1.8.0
53-
- h5py==3.15.1
54-
- idna==3.11
55-
- imagesize==1.4.1
56-
- iniconfig==2.3.0
57-
- jinja2==3.1.6
58-
- joblib==1.5.3
59-
- legacy-api-wrap==1.5
60-
- llvmlite==0.46.0
61-
- locket==1.0.0
62-
- markdown-it-py==4.0.0
63-
- markupsafe==3.0.3
64-
- mdurl==0.1.2
65-
- natsort==8.4.0
66-
- numba==0.63.1
67-
- numcodecs==0.16.5
68-
- numpy==2.3.5
69-
- numpy-typing-compat==20251206.2.3
70-
- optype==0.15.0
71-
- packaging==25.0
72-
- pandas==2.3.3
73-
- partd==1.4.2
74-
- pluggy==1.6.0
75-
- pycparser==2.23 ; implementation_name != 'PyPy'
76-
- pygments==2.19.2
77-
- pytest==9.0.2
78-
- pytest-codspeed==4.2.0
79-
- pytest-doctestplus==1.7.0
80-
- pytest-xdist==3.8.0
81-
- python-dateutil==2.9.0.post0
82-
- pytz==2025.2
83-
- pyyaml==6.0.3
84-
- requests==2.32.5
85-
- rich==14.2.0
86-
- roman-numerals==4.1.0
87-
- scikit-learn==1.8.0
88-
- scipy==1.17.0
89-
- scipy-stubs==1.17.0.1
90-
- six==1.17.0
91-
- snowballstemmer==3.0.1
92-
- sphinx==9.1.0
93-
- sphinxcontrib-applehelp==2.0.0
94-
- sphinxcontrib-devhelp==2.0.0
95-
- sphinxcontrib-htmlhelp==2.1.0
96-
- sphinxcontrib-jsmath==1.0.1
97-
- sphinxcontrib-qthelp==2.0.0
98-
- sphinxcontrib-serializinghtml==2.0.0
99-
- threadpoolctl==3.6.0
100-
- toolz==1.1.0
101-
- types-docutils==0.22.3.20251115
102-
- tzdata==2025.3
103-
- urllib3==2.6.3
104-
- zarr==3.1.5
32+
- anndata>=0.12
33+
- array-api-compat>=1.13
34+
- dask>=2026.1
35+
- h5py>=3.15
36+
- numba>=0.63
37+
- packaging>=26
38+
- pytest>=9
39+
- pytest-codspeed>=4.3
40+
- scikit-learn>=1.8
41+
- scipy-stubs>=1.17
42+
- sphinx>=9
43+
- types-docutils>=0.22
44+
- zarr>=3.1
10545
ci:
10646
autoupdate_commit_msg: 'ci: pre-commit autoupdate'
10747
skip:
10848
- mypy # too big
109-
- update-mypy-hook # offline?

pyproject.toml

Lines changed: 42 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ optional-dependencies.dask = [ "dask>=2023.6.1" ]
2929
optional-dependencies.full = [ "fast-array-utils[accel,dask,sparse]", "h5py", "zarr" ]
3030
optional-dependencies.sparse = [ "scipy>=1.13" ]
3131
optional-dependencies.testing = [ "packaging" ]
32-
urls.'Documentation' = "https://icb-fast-array-utils.readthedocs-hosted.com/"
33-
urls.'Issue Tracker' = "https://github.com/scverse/fast-array-utils/issues"
34-
urls.'Source Code' = "https://github.com/scverse/fast-array-utils"
32+
urls."Documentation" = "https://icb-fast-array-utils.readthedocs-hosted.com/"
33+
urls."Issue Tracker" = "https://github.com/scverse/fast-array-utils/issues"
34+
urls."Source Code" = "https://github.com/scverse/fast-array-utils"
3535
entry-points.pytest11.fast_array_utils = "testing.fast_array_utils.pytest"
3636

3737
[dependency-groups]
@@ -42,6 +42,12 @@ test = [
4242
"zarr",
4343
{ include-group = "test-min" },
4444
]
45+
doc = [
46+
"furo>=2024.8.6",
47+
"pytest>=8.4",
48+
"sphinx>=9.0.1",
49+
"sphinx-autofixture>=0.4.1",
50+
]
4551
test-min = [
4652
"coverage[toml]",
4753
"fast-array-utils[sparse,testing]", # include sparse for testing numba-less to_dense
@@ -50,73 +56,40 @@ test-min = [
5056
"pytest-doctestplus",
5157
"pytest-xdist",
5258
]
53-
doc = [
54-
"furo>=2024.8.6",
55-
"pytest>=8.4",
56-
"sphinx>=9.0.1",
57-
"sphinx-autofixture>=0.4.1",
58-
]
59-
# for update-mypy-hook
60-
mypy = [
61-
"fast-array-utils[full]",
62-
"scipy-stubs",
63-
# TODO: replace sphinx with this: { include-group = "doc" },
64-
"sphinx",
65-
"types-docutils",
66-
{ include-group = "test" },
67-
]
6859

69-
[tool.hatch.build.targets.wheel]
70-
packages = [ "src/testing", "src/fast_array_utils" ]
71-
72-
[tool.hatch.envs.default]
73-
installer = "uv"
74-
75-
[tool.hatch.envs.docs]
76-
dependency-groups = [ "doc" ]
77-
scripts.build = "sphinx-build -M html docs docs/_build"
78-
scripts.clean = "git clean -fdX docs"
79-
scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
80-
81-
[tool.hatch.envs.hatch-test]
82-
default-args = [ ]
83-
dependency-groups = [ "test-min" ]
60+
[tool.hatch]
61+
build.targets.wheel.packages = [ "src/testing", "src/fast_array_utils" ]
62+
envs.default.installer = "uv"
63+
envs.docs.dependency-groups = [ "doc" ]
64+
envs.docs.scripts.build = "sphinx-build -M html docs docs/_build"
65+
envs.docs.scripts.clean = "git clean -fdX docs"
66+
envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html"
67+
envs.hatch-test.default-args = []
68+
envs.hatch-test.dependency-groups = [ "test-min" ]
8469
# TODO: remove scipy once https://github.com/pypa/hatch/pull/2127 is released
85-
extra-dependencies = [ "ipykernel", "ipycytoscape", "scipy" ]
86-
env-vars.CODSPEED_PROFILE_FOLDER = "test-data/codspeed"
87-
overrides.matrix.extras.features = [
70+
envs.hatch-test.extra-dependencies = [ "ipykernel", "ipycytoscape", "scipy" ]
71+
envs.hatch-test.env-vars.CODSPEED_PROFILE_FOLDER = "test-data/codspeed"
72+
envs.hatch-test.overrides.matrix.extras.features = [
8873
{ if = [ "full" ], value = "full" },
8974
]
90-
overrides.matrix.extras.dependency-groups = [
75+
envs.hatch-test.overrides.matrix.extras.dependency-groups = [
9176
{ if = [ "full" ], value = "test" },
9277
]
93-
overrides.matrix.resolution.dependencies = [
78+
envs.hatch-test.overrides.matrix.resolution.dependencies = [
9479
# TODO: move to `min-reqs` feature once this is fixed: https://github.com/tlambert03/hatch-min-requirements/issues/11
9580
{ if = [ "lowest" ], value = "numpy==2" },
9681
{ if = [ "lowest" ], value = "dask==2023.6.1" },
9782
{ if = [ "lowest" ], value = "scipy==1.13.0" },
9883
]
99-
100-
[[tool.hatch.envs.hatch-test.matrix]]
101-
python = [ "3.13", "3.12" ]
102-
extras = [ "full", "min" ]
103-
104-
[[tool.hatch.envs.hatch-test.matrix]]
105-
python = [ "3.12" ]
106-
extras = [ "full" ]
107-
resolution = [ "lowest" ]
108-
109-
[tool.hatch.metadata.hooks.docstring-description]
110-
111-
[tool.hatch.metadata.hooks.fancy-pypi-readme]
112-
content-type = "text/x-rst"
113-
[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
114-
path = "README.rst"
115-
start-after = ".. begin"
116-
117-
[tool.hatch.version]
118-
source = "vcs"
119-
raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
84+
envs.hatch-test.matrix = [
85+
{ python = [ "3.13", "3.12" ], extras = [ "full", "min" ] },
86+
{ python = [ "3.12" ], extras = [ "full" ], resolution = [ "lowest" ] },
87+
]
88+
metadata.hooks.docstring-description = {}
89+
metadata.hooks.fancy-pypi-readme.content-type = "text/x-rst"
90+
metadata.hooks.fancy-pypi-readme.fragments = [ { path = "README.rst", start-after = ".. begin" } ]
91+
version.source = "vcs"
92+
version.raw-options = { local_scheme = "no-local-version" } # be able to publish dev version
12093

12194
[tool.uv]
12295
override-dependencies = [ "sphinx>=9.0.1" ]
@@ -141,20 +114,23 @@ lint.ignore = [
141114
"S101", # asserts are fine
142115
"TID252", # relative imports are fine
143116
]
144-
lint.per-file-ignores."docs/**/*.py" = [ "INP001" ] # No __init__.py in docs
145-
lint.per-file-ignores."src/**/stats/*.py" = [ "A001", "A004" ] # Shadows builtins like `sum`
117+
# No __init__.py in docs
118+
lint.per-file-ignores."docs/**/*.py" = [ "INP001" ]
119+
# Shadows builtins like `sum`
120+
lint.per-file-ignores."src/**/stats/*.py" = [ "A001", "A004" ]
146121
lint.per-file-ignores."tests/**/*.py" = [
147122
"D100", # tests need no module docstrings
148123
"D103", # tests need no function docstrings
149124
"INP001", # tests should not have __init__.py
150125
"PLR2004", # tests use magic values
151126
"S101", # tests use `assert`
152127
]
153-
lint.per-file-ignores."typings/**/*.pyi" = [ "A002", "F403", "F405", "N801" ] # Stubs don’t follow name conventions
128+
# Stubs don’t follow name conventions
129+
lint.per-file-ignores."typings/**/*.pyi" = [ "A002", "F403", "F405", "N801" ]
154130
lint.allowed-confusables = [ "×", "" ]
155131
lint.flake8-bugbear.extend-immutable-calls = [ "testing.fast_array_utils.Flags" ]
156132
lint.flake8-copyright.notice-rgx = "SPDX-License-Identifier: MPL-2\\.0"
157-
lint.flake8-type-checking.exempt-modules = [ ]
133+
lint.flake8-type-checking.exempt-modules = []
158134
lint.flake8-type-checking.strict = true
159135
lint.isort.known-first-party = [ "fast_array_utils" ]
160136
lint.isort.lines-after-imports = 2
@@ -183,10 +159,10 @@ markers = [
183159

184160
[tool.coverage]
185161
run.data_file = "test-data/.coverage"
186-
xml.output = "test-data/coverage.xml"
187-
html.directory = "test-data/htmlcov"
188162
run.omit = [ "src/testing/*", "tests/*" ]
189-
report.exclude_also = [ "if TYPE_CHECKING:", "@numba[.]njit", "[.]{3}" ]
163+
report.exclude_also = [ "@numba[.]njit", "[.]{3}", "if TYPE_CHECKING:" ]
164+
html.directory = "test-data/htmlcov"
165+
xml.output = "test-data/coverage.xml"
190166

191167
[tool.mypy]
192168
strict = true

src/testing/fast_array_utils/_array_type.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ def _to_scipy_sparse(
317317
x = to_dense(x, to_cpu_memory=True)
318318

319319
cls = cast("type[types.CSBase]", cls or self.cls)
320-
return cls(x, dtype=dtype) # type: ignore[arg-type]
320+
return cls(x, dtype=dtype) # type: ignore[arg-type,misc]
321321

322322
def _to_cupy_array(self, x: ArrayLike | Array, /, *, dtype: DTypeLike | None = None) -> types.CupyArray:
323323
import cupy as cu

0 commit comments

Comments
 (0)