From c57896305e041f402849155d74900f1c17032ac0 Mon Sep 17 00:00:00 2001 From: Max Jones <14077947+maxrjones@users.noreply.github.com> Date: Mon, 12 Feb 2024 14:12:11 -0500 Subject: [PATCH] Add test matrix for V3 (#1656) * Add a test matrix for Zarr V3 * Run mypy in test matrix * Simplify matrix * Update .github/workflows/test-v3.yml Co-authored-by: Joe Hamman --------- Co-authored-by: Joe Hamman --- .github/workflows/test-v3.yml | 6 +++++- pyproject.toml | 31 ++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-v3.yml b/.github/workflows/test-v3.yml index e0a4117290..bdc6e99299 100644 --- a/.github/workflows/test-v3.yml +++ b/.github/workflows/test-v3.yml @@ -29,4 +29,8 @@ jobs: hatch env create - name: Run Tests run: | - hatch run test:run \ No newline at end of file + hatch run test:run + - name: Run mypy + continue-on-error: true + run: | + hatch run test:run-mypy \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 0f0e4ae633..922b10346d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,6 +53,16 @@ docs = [ 'numpydoc', 'numcodecs[msgpack]', ] +extra = [ + 'attrs', + 'cattrs', + 'msgpack', + 'crc32c', + 'zstandard' +] +optional = [ + 'lmdb', +] [project.urls] "Bug Tracker" = "https://github.com/zarr-developers/zarr-python/issues" @@ -79,22 +89,29 @@ build.hooks.vcs.version-file = "src/zarr/_version.py" [tool.hatch.envs.test] extra-dependencies = [ - "attrs", - "cattrs", "coverage", "pytest", "pytest-cov", - "msgpack", - "lmdb", - "zstandard", - "crc32c", - "pytest-asyncio" + "pytest-asyncio", + "mypy", ] +features = ["extra"] + +[[tool.hatch.envs.test.matrix]] +python = ["3.10", "3.11"] +numpy = ["1.24", "1.26"] +version = ["minimal"] + +[[tool.hatch.envs.test.matrix]] +python = ["3.10", "3.11"] +numpy = ["1.24", "1.26"] +features = ["optional"] [tool.hatch.envs.test.scripts] run-coverage = "pytest --cov-config=pyproject.toml --cov=pkg --cov=tests" run = "run-coverage --no-cov" run-verbose = "run-coverage --verbose" +run-mypy = "mypy src" [tool.hatch.envs.docs] features = ['docs']