Skip to content

Add test matrix for V3 #1656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2024
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
6 changes: 5 additions & 1 deletion .github/workflows/test-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ jobs:
hatch env create
- name: Run Tests
run: |
hatch run test:run
hatch run test:run
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we could use github action's matrix feature here as well. Obviously, we're skipping lots of tests at the moment so running the whole matrix in one action is fine. But as the test suite comes back to life, I think we'll spread out. It seems like Hatch can support this with something like:

hatch run +py=${{ matrix.python-version }} test:run

Note: I wasn't able to figure out how to run individual matrix members with hatch variable selection but it seems like it should be possible: https://hatch.pypa.io/1.9/cli/reference/#hatch-env-run

- name: Run mypy
continue-on-error: true
run: |
hatch run test:run-mypy
31 changes: 24 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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']
Expand Down