-
-
Notifications
You must be signed in to change notification settings - Fork 327
Fix hatch matrix setup for minimal and optional dependencies #2872
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
Changes from all commits
7976bd8
11b2c78
b2442ba
5320edc
9dc1845
39fff00
ec880dd
f5c3990
1364fb9
0a266d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,18 +73,19 @@ gpu = [ | |
test = [ | ||
"coverage", | ||
"pytest", | ||
"pytest-asyncio", | ||
"pytest-cov", | ||
"pytest-accept", | ||
"rich", | ||
"mypy", | ||
"hypothesis", | ||
] | ||
remote_tests = [ | ||
'zarr[remote]', | ||
"botocore", | ||
"s3fs", | ||
"moto[s3,server]", | ||
"pytest-asyncio", | ||
"pytest-accept", | ||
"requests", | ||
"rich", | ||
"mypy", | ||
"hypothesis", | ||
"universal-pathlib", | ||
] | ||
optional = ["rich", "universal-pathlib"] | ||
docs = [ | ||
|
@@ -143,28 +144,21 @@ hooks.vcs.version-file = "src/zarr/_version.py" | |
[tool.hatch.envs.test] | ||
dependencies = [ | ||
"numpy~={matrix:numpy}", | ||
"universal_pathlib", | ||
] | ||
features = ["test"] | ||
|
||
[[tool.hatch.envs.test.matrix]] | ||
python = ["3.11", "3.12", "3.13"] | ||
numpy = ["1.25", "2.1"] | ||
version = ["minimal"] | ||
|
||
[[tool.hatch.envs.test.matrix]] | ||
python = ["3.11", "3.12", "3.13"] | ||
numpy = ["1.25", "2.1"] | ||
features = ["optional"] | ||
deps = ["minimal", "optional"] | ||
|
||
[[tool.hatch.envs.test.matrix]] | ||
python = ["3.11", "3.12", "3.13"] | ||
numpy = ["1.25", "2.1"] | ||
features = ["gpu"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We separately have the |
||
[tool.hatch.envs.test.overrides] | ||
matrix.deps.dependencies = [ | ||
{value = "zarr[remote, remote_tests, test, optional]", if = ["optional"]} | ||
] | ||
Comment on lines
150
to
+158
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I determined by looking at the old logs that there were no actual differences between the minimal and optional groups of the matrix. This override setup properly includes optional dependencies for the optional group and excludes them from the minimal group. |
||
|
||
[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-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" | ||
run = "run-coverage --no-cov" | ||
run-pytest = "run" | ||
|
@@ -174,7 +168,7 @@ run-hypothesis = "run-coverage --hypothesis-profile ci --run-slow-hypothesis tes | |
list-env = "pip list" | ||
|
||
[tool.hatch.envs.doctest] | ||
features = ["test", "optional", "remote"] | ||
features = ["test", "optional", "remote", "remote_tests"] | ||
description = "Test environment for doctests" | ||
|
||
[tool.hatch.envs.doctest.scripts] | ||
|
@@ -255,6 +249,7 @@ dependencies = [ | |
'universal_pathlib==0.0.22', | ||
'typing_extensions==4.9.*', | ||
'donfig==0.8.*', | ||
'obstore==0.5.*', | ||
# test deps | ||
'zarr[test]', | ||
] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The minimal environment will have less coverage than optional, so there's no value in uploading it to codecov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a downside to uploading it? I think it might be worth just keeping all the uploads to keep the complexity of this file down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed to me a tradeoff between complexity in the workflow and complexity in understanding the codecov logs - https://app.codecov.io/gh/zarr-developers/zarr-python/commit/ebadec01e74acdd5bc3273be771c20a0f6a67cce. But not many people will interact with those logs so I can remove this line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair - I tend not to look at the logs, but agree that it makes the logs a bit easier. Lets leave the line in and I'll merge 🚢