From 6d8e88736b3ef11d316bfa5d86696580f55c6024 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Fri, 6 Dec 2024 16:36:59 +0100 Subject: [PATCH 1/6] update type annotations --- tests/test_internal/test_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_internal/test_types.py b/tests/test_internal/test_types.py index ef1307bb9..c25e77ca9 100644 --- a/tests/test_internal/test_types.py +++ b/tests/test_internal/test_types.py @@ -83,7 +83,7 @@ def test_type_is_usable(name: str): args = TYPE_ARGS[typ] if not isinstance(args, tuple): args = (args,) - _ = typ(*args) + _ = typ(*args) # pyright: ignore[reportCallIssue,reportArgumentType] elif isinstance(typ, str): pass # ignore string constants else: From 69db1ad3dfc5fb9215fea0a2a23069fa1fadb245 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Fri, 6 Dec 2024 16:38:00 +0100 Subject: [PATCH 2/6] bump pyright version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index b1b750af6..b4c087e93 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ "jupyter", "pdoc", "pre-commit", - "pyright==1.1.388", + "pyright==1.1.390", "ruff", ], }, From 408b0a88424047f53e0f7414897939e4766da1d6 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Mon, 9 Dec 2024 13:56:16 +0100 Subject: [PATCH 3/6] add pytorch 1.5.1 pins --- bioimageio/spec/_get_conda_env.py | 4 +++- tests/test_get_conda_env.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bioimageio/spec/_get_conda_env.py b/bioimageio/spec/_get_conda_env.py index d216271a5..eaf3b0e2e 100644 --- a/bioimageio/spec/_get_conda_env.py +++ b/bioimageio/spec/_get_conda_env.py @@ -87,7 +87,9 @@ def _get_default_pytorch_env( # https://pytorch.org/get-started/previous-versions/ v = str(pytorch_version) deps: List[Union[str, PipDeps]] = [f"pytorch=={v}"] - if v == "1.6.0": + if v == "1.5.1": + deps += ["torchvision==0.6.1"] + elif v == "1.6.0": deps += ["torchvision==0.7.0"] elif v == "1.7.0": deps += ["torchvision==0.8.0", "torchaudio==0.7.0"] diff --git a/tests/test_get_conda_env.py b/tests/test_get_conda_env.py index cded34531..acd53c7e3 100644 --- a/tests/test_get_conda_env.py +++ b/tests/test_get_conda_env.py @@ -85,6 +85,7 @@ def test_get_default_pytorch_env(): versions: Dict[str, List[Optional[str]]] = { "pytorch": [ + "1.5.1", "1.6.0", "1.7.0", "1.7.1", From 2aaf380c30c9397b6df1f2280b7c5daff3a8e328 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Tue, 10 Dec 2024 09:53:54 +0100 Subject: [PATCH 4/6] add tests.utils module docstring --- tests/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/utils.py b/tests/utils.py index 3fd9fc24e..aa4dce068 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,3 +1,5 @@ +"""utils to test bioimageio.spec""" + import os from contextlib import nullcontext from copy import deepcopy From ffb09184ca9756796240aae4eead6c5651710882 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Tue, 10 Dec 2024 10:12:23 +0100 Subject: [PATCH 5/6] fix test_get_default_pytorch_env --- tests/test_get_conda_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_get_conda_env.py b/tests/test_get_conda_env.py index acd53c7e3..afecf5b06 100644 --- a/tests/test_get_conda_env.py +++ b/tests/test_get_conda_env.py @@ -136,5 +136,5 @@ def assert_lt(p: str, i: int): for i in range(len(versions["pytorch"]) - 1): assert_lt("pytorch", i) assert_lt("torchvision", i) - if i > 0: + if i > 1: assert_lt("torchaudio", i) From 776db6083545bcd700b795f41d182854b06c41dc Mon Sep 17 00:00:00 2001 From: fynnbe Date: Tue, 10 Dec 2024 10:25:16 +0100 Subject: [PATCH 6/6] fix test_type_is_usable --- tests/test_internal/test_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_internal/test_types.py b/tests/test_internal/test_types.py index c25e77ca9..a41cb20f7 100644 --- a/tests/test_internal/test_types.py +++ b/tests/test_internal/test_types.py @@ -83,7 +83,7 @@ def test_type_is_usable(name: str): args = TYPE_ARGS[typ] if not isinstance(args, tuple): args = (args,) - _ = typ(*args) # pyright: ignore[reportCallIssue,reportArgumentType] + _ = typ(*args) # type: ignore elif isinstance(typ, str): pass # ignore string constants else: