Skip to content

Commit

Permalink
Merge pull request #674 from bioimage-io/update_pyright
Browse files Browse the repository at this point in the history
Update pyright
  • Loading branch information
FynnBe authored Dec 10, 2024
2 parents 3196742 + 776db60 commit 15ea0f7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion bioimageio/spec/_get_conda_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"jupyter",
"pdoc",
"pre-commit",
"pyright==1.1.388",
"pyright==1.1.390",
"ruff",
],
},
Expand Down
3 changes: 2 additions & 1 deletion tests/test_get_conda_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -135,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)
2 changes: 1 addition & 1 deletion tests/test_internal/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) # type: ignore
elif isinstance(typ, str):
pass # ignore string constants
else:
Expand Down
2 changes: 2 additions & 0 deletions tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""utils to test bioimageio.spec"""

import os
from contextlib import nullcontext
from copy import deepcopy
Expand Down

0 comments on commit 15ea0f7

Please sign in to comment.