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 .github/workflows/gpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
hatch env run -e gputest.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} list-env
- name: Run Tests
run: |
hatch env run --env gputest.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run-coverage
hatch env run --env gputest.py${{ matrix.python-version }}-${{ matrix.numpy-version }}-${{ matrix.dependency-set }} run-coverage-gpu

- name: Upload coverage
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
Expand Down
68 changes: 27 additions & 41 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ dependencies = [
]
features = ["test"]

[tool.hatch.envs.test.env-vars]
# Required to test with a pytest plugin; see https://pytest-cov.readthedocs.io/en/latest/plugins.html
COV_CORE_SOURCE = "src"
COV_CORE_CONFIG = ".coveragerc"
COV_CORE_DATAFILE = ".coverage.eager"

[[tool.hatch.envs.test.matrix]]
python = ["3.11", "3.12", "3.13"]
numpy = ["1.26", "2.2"]
Expand All @@ -161,25 +167,18 @@ matrix.deps.dependencies = [
]

[tool.hatch.envs.test.scripts]
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
run-coverage = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report xml --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=src --cov-append --cov-report html"
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=src --cov-append --cov-report xml --junitxml=junit.xml -o junit_family=legacy"
run = "run-coverage --no-cov"
run-pytest = "run"
run-verbose = "run-coverage --verbose"
run-mypy = "mypy src"
run-hypothesis = "run-coverage -nauto --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*"
list-env = "pip list"

[tool.hatch.envs.doctest]
features = ["test", "optional", "remote", "remote_tests"]
description = "Test environment for doctests"

[tool.hatch.envs.doctest.scripts]
run = "rm -r data/; pytest docs/user-guide --doctest-glob='*.rst'"
fix = "rm -r data/; pytest docs/user-guide --doctest-glob='*.rst' --accept"
list-env = "pip list"

[tool.hatch.envs.gputest]
template = "test"
dependencies = [
"numpy~={matrix:numpy}",
"universal_pathlib",
Expand All @@ -191,22 +190,8 @@ python = ["3.11", "3.12", "3.13"]
numpy = ["1.26", "2.2"]
version = ["minimal"]

[tool.hatch.envs.gputest.scripts]
run-coverage = "pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run = "run-coverage --no-cov"
run-verbose = "run-coverage --verbose"
run-mypy = "mypy src"
run-hypothesis = "run-coverage --hypothesis-profile ci --run-slow-hypothesis tests/test_properties.py tests/test_store/test_stateful*"
list-env = "pip list"

[tool.hatch.envs.docs]
features = ['docs']

[tool.hatch.envs.docs.scripts]
build = "cd docs && make html"
serve = "sphinx-autobuild docs docs/_build --host 0.0.0.0"

[tool.hatch.envs.upstream]
template = 'test'
python = "3.13"
dependencies = [
'packaging @ git+https://github.com/pypa/packaging',
Expand All @@ -226,20 +211,12 @@ PIP_INDEX_URL = "https://pypi.anaconda.org/scientific-python-nightly-wheels/simp
PIP_EXTRA_INDEX_URL = "https://pypi.org/simple/"
PIP_PRE = "1"

[tool.hatch.envs.upstream.scripts]
run = "pytest --verbose"
run-mypy = "mypy src"
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"
list-env = "pip list"

[tool.hatch.envs.min_deps]
description = """Test environment for minimum supported dependencies

See Spec 0000 for details and drop schedule: https://scientific-python.org/specs/spec-0000/
"""
template = "test"
python = "3.11"
dependencies = [
'zarr[remote]',
Expand All @@ -257,13 +234,22 @@ dependencies = [
'zarr[remote_tests]',
]

[tool.hatch.envs.min_deps.scripts]
run = "pytest --verbose"
run-hypothesis = "pytest --hypothesis-profile ci tests/test_properties.py tests/test_store/test_stateful*"

[tool.hatch.envs.doctest]
features = ["test", "optional", "remote", "remote_tests"]
description = "Test environment for doctests"

[tool.hatch.envs.doctest.scripts]
run = "rm -r data/; pytest docs/user-guide --doctest-glob='*.rst'"
fix = "rm -r data/; pytest docs/user-guide --doctest-glob='*.rst' --accept"
list-env = "pip list"
run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-gpu = "pip install cupy-cuda12x && pytest -m gpu --cov-config=pyproject.toml --cov=pkg --cov-report xml --cov=src --junitxml=junit.xml -o junit_family=legacy"
run-coverage-html = "pytest --cov-config=pyproject.toml --cov=pkg --cov-report html --cov=src"

[tool.hatch.envs.docs]
features = ['docs']

[tool.hatch.envs.docs.scripts]
build = "cd docs && make html"
serve = "sphinx-autobuild docs docs/_build --host 0.0.0.0"

[tool.ruff]
line-length = 100
Expand Down
Loading