Skip to content

Commit e35c4fc

Browse files
d-v-bjhammanDimitriPapadopoulose-marshallsanketverma1704
authored
move v3/tests to tests (#2396)
* move v3/tests to tests and fix various mypy issues * test(ci): change branch name in v3 workflows (#2368) * Use lazy % formatting in logging functions (#2366) * Use lazy % formatting in logging functions * f-string should be more efficient * Space before unit symbol From "SI Unit rules and style conventions": https://physics.nist.gov/cuu/Units/checklist.html There is a space between the numerical value and unit symbol, even when the value is used in an adjectival sense, except in the case of superscript units for plane angle. * Enforce ruff/flake8-logging-format rules (G) --------- Co-authored-by: Joe Hamman <[email protected]> * Move roadmap and v3-design documument to docs (#2354) * move roadmap to docs * formatting and minor copy editing * Multiple imports for an import name (#2367) Co-authored-by: Joe Hamman <[email protected]> * Enforce ruff/pycodestyle warnings (W) (#2369) * Apply ruff/pycodestyle rule W291 W291 Trailing whitespace * Enforce ruff/pycodestyle warnings (W) It looks like `ruff format` does not catch all trailing spaces. --------- Co-authored-by: Joe Hamman <[email protected]> * Apply ruff/pycodestyle preview rule E262 (#2370) E262 Inline comment should start with `# ` Co-authored-by: Joe Hamman <[email protected]> * Fix typo (#2382) Co-authored-by: Joe Hamman <[email protected]> * Imported name is not used anywhere in the module (#2379) * Missing mandatory keyword argument `shape` (#2376) * Update ruff rules to ignore (#2374) Co-authored-by: Joe Hamman <[email protected]> * Docstrings for arraymodule (#2276) * start to docstrings for arraymodule * incorporating toms edits, overriding mypy error... * fix attrs * Update src/zarr/core/array.py Co-authored-by: Sanket Verma <[email protected]> * fix store -> storage * remove properties from asyncarray docstring --------- Co-authored-by: Sanket Verma <[email protected]> Co-authored-by: Joe Hamman <[email protected]> * fix/normalize storage paths (#2384) * bring in path normalization function from v2, and add a failing test * rephrase comment * simplify storepath creation * Update tests/v3/test_api.py Co-authored-by: Joe Hamman <[email protected]> * refactor: remove redundant zarr format fixture * replace assertion with an informative error message * fix incorrect path concatenation in make_store_path, and refactor store_path tests * remove upath import because we don't need it * apply suggestions from code review --------- Co-authored-by: Joe Hamman <[email protected]> * Enforce ruff/flake8-pyi rule PYI013 (#2389) PYI013 Non-empty class body must not contain `...` Note that documentation is enough to fill the class body. * deps: remove fasteners from list of dependencies (#2386) * Enforce ruff/flake8-annotations rule ANN003 (#2388) ANN003 Missing type annotation Co-authored-by: Joe Hamman <[email protected]> * Enforce ruff/Perflint rules (PERF) (#2372) * Apply ruff/Perflint rule PERF401 PERF401 Use a list comprehension to create a transformed list * Enforce ruff/Perflint rules (PERF) * chore: update package maintainers (#2387) * chore: update package maintainers * Update pyproject.toml Co-authored-by: David Stansby <[email protected]> --------- Co-authored-by: David Stansby <[email protected]> * Fixed consolidated Group getitem with multi-part key (#2363) * Fixed consolidated Group getitem with multi-part key This fixes `Group.__getitem__` when indexing with a key like 'subgroup/array'. The basic idea is to rewrite the indexing operation as `group['subgroup']['array']` by splitting the key and doing each operation independently. Closes #2358 --------- Co-authored-by: Joe Hamman <[email protected]> * chore: add python 3.13 to ci / pyproject.toml (#2385) * chore: add python 3.13 to ci / pyproject.toml * update hatch matrix * remove references to dead test dir in pyproject.toml * remove v3 reference in test --------- Co-authored-by: Joe Hamman <[email protected]> Co-authored-by: Dimitri Papadopoulos Orfanos <[email protected]> Co-authored-by: Emma Marshall <[email protected]> Co-authored-by: Sanket Verma <[email protected]> Co-authored-by: David Stansby <[email protected]> Co-authored-by: Tom Augspurger <[email protected]>
1 parent 435073c commit e35c4fc

40 files changed

+27
-19
lines changed

pyproject.toml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pypro
153153
run = "run-coverage --no-cov"
154154
run-verbose = "run-coverage --verbose"
155155
run-mypy = "mypy src"
156-
run-hypothesis = "pytest --hypothesis-profile ci tests/v3/test_properties.py tests/v3/test_store/test_stateful*"
156+
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
157157
list-env = "pip list"
158158

159159
[tool.hatch.envs.gputest]
@@ -173,7 +173,7 @@ run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov=tests"
173173
run = "run-coverage --no-cov"
174174
run-verbose = "run-coverage --verbose"
175175
run-mypy = "mypy src"
176-
run-hypothesis = "pytest --hypothesis-profile ci tests/v3/test_properties.py tests/v3/test_store/test_stateful*"
176+
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
177177
list-env = "pip list"
178178

179179
[tool.hatch.envs.docs]
@@ -282,18 +282,17 @@ ignore_errors = true
282282

283283
[[tool.mypy.overrides]]
284284
module = [
285-
"tests.v2.*",
286-
"tests.v3.package_with_entrypoint.*",
287-
"tests.v3.test_codecs.test_codecs",
288-
"tests.v3.test_codecs.test_transpose",
289-
"tests.v3.test_metadata.*",
290-
"tests.v3.test_store.*",
291-
"tests.v3.test_config",
292-
"tests.v3.test_group",
293-
"tests.v3.test_indexing",
294-
"tests.v3.test_properties",
295-
"tests.v3.test_sync",
296-
"tests.v3.test_v2",
285+
"tests.package_with_entrypoint.*",
286+
"tests.test_codecs.test_codecs",
287+
"tests.test_codecs.test_transpose",
288+
"tests.test_metadata.*",
289+
"tests.test_store.*",
290+
"tests.test_config",
291+
"tests.test_group",
292+
"tests.test_indexing",
293+
"tests.test_properties",
294+
"tests.test_sync",
295+
"tests.test_v2",
297296
]
298297
ignore_errors = true
299298

src/zarr/testing/utils.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import TYPE_CHECKING, Any, cast
3+
from collections.abc import Callable, Coroutine
4+
from typing import TYPE_CHECKING, Any, TypeVar, cast
45

56
import pytest
67

@@ -37,8 +38,16 @@ def has_cupy() -> bool:
3738
return False
3839

3940

41+
T_Callable = TypeVar("T_Callable", bound=Callable[[], Coroutine[Any, Any, None]])
42+
43+
4044
# Decorator for GPU tests
41-
def gpu_test(func: Any) -> Any:
42-
return pytest.mark.gpu(
43-
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(func)
45+
def gpu_test(func: T_Callable) -> T_Callable:
46+
return cast(
47+
T_Callable,
48+
pytest.mark.gpu(
49+
pytest.mark.skipif(not has_cupy(), reason="CuPy not installed or no GPU available")(
50+
func
51+
)
52+
),
4453
)
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.

0 commit comments

Comments
 (0)