mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
test on 3.11 (#8196)
We don't have aiohttp support yet, due to which we have to install without cythonized extension. Similarly, there has been some changes in how dataclasses disallows some mutable arguments to be set as a class property, due to which `hydra.conf` fails to import in 3.11. See https://github.com/python/cpython/pull/29867. For now, I have patched the module and avoid importing as a pytest-plugin. dvc-hdfs/pyarrow is not there yet, we'll usually see a release 2-3 months after official reelase. dvc-hdfs is skipped in 3.11 in extras_requires. `--set-params` will return a nice error message if hydra cannot be imported in 3.11. I decided to only patch that in tests.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import pytest
|
||||
|
||||
from dvc.exceptions import InvalidArgumentError
|
||||
from dvc.utils.hydra import apply_overrides
|
||||
|
||||
|
||||
@pytest.mark.parametrize("suffix", ["yaml", "toml", "json"])
|
||||
@@ -90,6 +89,8 @@ from dvc.utils.hydra import apply_overrides
|
||||
],
|
||||
)
|
||||
def test_apply_overrides(tmp_dir, suffix, overrides, expected):
|
||||
from dvc.utils.hydra import apply_overrides
|
||||
|
||||
if suffix == "toml":
|
||||
if overrides in [
|
||||
["foo=baz"],
|
||||
@@ -114,6 +115,8 @@ def test_apply_overrides(tmp_dir, suffix, overrides, expected):
|
||||
[["foobar=2"], ["lorem=3,2"], ["+lorem=3"], ["foo[0]=bar"]],
|
||||
)
|
||||
def test_invalid_overrides(tmp_dir, overrides):
|
||||
from dvc.utils.hydra import apply_overrides
|
||||
|
||||
params_file = tmp_dir / "params.yaml"
|
||||
params_file.dump(
|
||||
{"foo": [{"bar": 1}, {"baz": 2}], "goo": {"bag": 3.0}, "lorem": False}
|
||||
|
||||
Reference in New Issue
Block a user