Skip to content

Commit 3f5bd4d

Browse files
authored
Fix tox to include typechecking (#514)
1 parent 49c354f commit 3f5bd4d

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

src/viam/components/camera/camera.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import abc
2-
from typing import TYPE_CHECKING, Any, Dict, Final, List, Optional, Tuple
2+
import sys
3+
from typing import Any, Dict, Final, List, Optional, Tuple
34

45
from viam.media.video import NamedImage, ViamImage
56
from viam.proto.common import ResponseMetadata
@@ -8,8 +9,10 @@
89

910
from ..component_base import ComponentBase
1011

11-
if TYPE_CHECKING:
12+
if sys.version_info >= (3, 10):
1213
from typing import TypeAlias
14+
else:
15+
from typing_extensions import TypeAlias
1316

1417

1518
class Camera(ComponentBase):

src/viam/operations.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import asyncio
22
import functools
3+
import sys
34
import time
45
from typing import Any, Callable, Coroutine, Mapping, Optional, TypeVar, cast
56
from uuid import UUID, uuid4
67

78
from typing_extensions import Self
89

9-
try:
10+
if sys.version_info >= (3, 10):
1011
from typing import ParamSpec
11-
except ImportError:
12+
else:
1213
from typing_extensions import ParamSpec
1314

1415

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@ envlist =
1111
[testenv]
1212
allowlist_externals =
1313
make
14+
deps =
15+
coverage
16+
pyright
17+
pytest
18+
pytest-asyncio
19+
extras =
20+
mlmodel
1421
recreate = True
1522
commands =
16-
make test
23+
make _typecheck
24+
make _test
1725

1826
[testenv:docs]
1927
allowlist_externals =

0 commit comments

Comments
 (0)