Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,9 @@ jobs:
if: ${{ !inputs.branch }}

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Setup Python
run: uv python install 3.12
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"

- name: Install package
run: uv sync
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
requirements-version: ["min", "max"]
steps:
- name: Checkout Push/Workflow Dispatch
Expand All @@ -29,12 +29,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install uv
uses: astral-sh/setup-uv@v3
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Setup Python
run: uv python install ${{ matrix.python-version }}
python-version: ${{ matrix.python-version }}
enable-cache: trues

- name: Install viam-server
run: |
Expand Down
51 changes: 37 additions & 14 deletions .github/workflows/update_protos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: "29.2"
version: "33.5"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
Expand All @@ -49,6 +49,12 @@ jobs:
- name: prune origin
run: git remote prune origin

- name: Create branch
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b workflow/update-proto

- name: Setup Python
run: uv python install

Expand All @@ -62,6 +68,11 @@ jobs:
env:
BUF_TOKEN: ${{ secrets.BUF_TOKEN }}

- name: Commit generated buf files
run: |
git add -A
git diff --cached --quiet || git commit -m "[WORKFLOW] Generate buf from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}"

- name: Install OpenCode CLI
run: |
curl -fsSL https://opencode.ai/install | bash
Expand Down Expand Up @@ -338,22 +349,34 @@ jobs:

opencode run --model anthropic/claude-sonnet-4-5-20250929 --agent build "$(cat /tmp/opencode_prompt.txt)"

- name: Commit Python wrapper updates
run: |
git add -A
git diff --cached --quiet || git commit -m "[WORKFLOW] Update Python wrappers from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}"

- name: Format
run: uv run make format

- name: Add + Commit + Open PR
id: cpr
uses: peter-evans/create-pull-request@v7
with:
commit-message: "[WORKFLOW] Updating protos from ${{ github.event.client_payload.repo_name }}, commit: ${{ github.event.client_payload.sha }}"
branch: "workflow/update-proto"
delete-branch: true
base: main
title: Automated Protos Update
body: This is an auto-generated PR to update proto definitions. Check the commits to see which repos and commits are responsible for the changes
assignees: njooma
reviewers: njooma
token: ${{ secrets.GIT_ACCESS_TOKEN }}
- name: Commit formatting changes
run: |
git add -A
git diff --cached --quiet || git commit -m "[WORKFLOW] Apply formatting"

- name: Push branch and open PR
env:
GH_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
run: |
git push --force origin workflow/update-proto
gh pr create \
--base main \
--head workflow/update-proto \
--title "Automated Protos Update" \
--body "This is an auto-generated PR to update proto definitions. Check the commits to see which repos and commits are responsible for the changes" \
--assignee njooma \
--reviewer njooma \
|| gh pr edit workflow/update-proto \
--title "Automated Protos Update" \
--body "This is an auto-generated PR to update proto definitions. Check the commits to see which repos and commits are responsible for the changes"

- name: Notify slack of failure
uses: slackapi/slack-github-action@v1.24.0
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ buf: clean
rm -rf src/viam/gen
chmod +x plugin/main.py
uv pip install protoletariat
uv pip install protobuf==5.29.6
uv pip install protobuf==6.33.5
$(eval API_VERSION := $(shell grep 'API_VERSION' src/viam/version_metadata.py | awk -F '"' '{print $$2}'))
buf generate buf.build/viamrobotics/api:${API_VERSION}
buf generate buf.build/viamrobotics/goutils
Expand Down
286 changes: 210 additions & 76 deletions docs/examples/example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion etc/generate_proto_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def check_class(obj) -> bool:
f.write("Do not edit manually!\n")
f.write("'''\n")
for imp, cls in classes.items():
f.write(f'from {"."*(len(package.split("."))+IMPORT_LEVEL)}{PROTO_GEN_PACKAGE}.{package}.{imp} import (\n')
f.write(f"from {'.' * (len(package.split('.')) + IMPORT_LEVEL)}{PROTO_GEN_PACKAGE}.{package}.{imp} import (\n")
f.write(" %s\n" % (",\n ".join(cls)))
f.write(")\n")
f.write("\n__all__ = [\n")
Expand Down
39 changes: 18 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,32 @@ authors = [
]
license = "Apache-2.0"
readme = "README.md"
requires-python = ">=3.8.1"
requires-python = ">=3.10"
dynamic = [
'version',
]
dependencies = [
"googleapis-common-protos>=1.65.0",
"grpclib>=0.4.7",
"protobuf==5.29.6",
"typing-extensions>=4.12.2",
"grpclib>=0.4.9",
"protobuf==6.33.5",
"typing-extensions>=4.15.0",
"pymongo>=4.10.1",
"googleapis-common-protos>=1.73.0",
]
[dependency-groups]
dev = [
"coverage>=7.6.1",
"mypy-protobuf>=3.6.0",
"myst-nb<1.0.0; python_version<'3.9'",
"myst-nb>=1.0.0; python_version>='3.9'",
"nbmake>=1.5.4",
"numpy<1.25.0; python_version<'3.9'",
"numpy>=1.26.2; python_version>='3.9'",
"pillow>=10.4.0",
"pyright>=1.1.382.post1",
"pytest-asyncio>=0.24.0",
"pytest>=8.3.3",
"ruff>=0.6.8",
"sphinx-autoapi<3.0.0; python_version<'3.9'",
"sphinx-autoapi>=3.0.0; python_version>='3.9'",
"sphinx-rtd-theme>=2.0.0",
"types-pillow>=10.2.0.20240822",
"coverage>=7.13.4",
"mypy-protobuf>=5.0.0",
"myst-nb>=1.4.0",
"nbmake>=1.5.5",
"numpy<2.3.0; python_version<'3.11'",
"numpy>=1.3.0; python_version>='3.11'",
"pillow>=12.1.1",
"pyright>=1.1.401",
"pytest-asyncio>=1.3.0",
"pytest>=9.0.2",
"ruff>=0.15.5",
"sphinx-autoapi>=3.7.0",
"sphinx-rtd-theme>=3.1.0",
]

[project.urls]
Expand Down
9 changes: 4 additions & 5 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
grpclib~=0.4.6
googleapis-common-protos~=1.63.2
typing-extensions~=4.8.0
grpclib~=0.4.9
typing-extensions~=4.15.0
Pillow~=10.4.0
protobuf==5.29.6
numpy~=1.21
protobuf==6.33.5
numpy~=1.26.2
8 changes: 1 addition & 7 deletions src/viam/app/_logs.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import sys

if sys.version_info >= (3, 9):
from collections.abc import AsyncIterator
else:
from typing import AsyncIterator

from collections.abc import AsyncIterator
from typing import Protocol, TypeVar

LogsType = TypeVar("LogsType", covariant=True)
Expand Down
4 changes: 1 addition & 3 deletions src/viam/app/data_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,9 +881,7 @@ async def delete_tabular_data(

For more information, see `Data Client API <https://docs.viam.com/dev/reference/apis/data-client/#deletetabulardata>`_.
"""
request = DeleteTabularDataRequest(
organization_id=organization_id, delete_older_than_days=delete_older_than_days, filter=filter
)
request = DeleteTabularDataRequest(organization_id=organization_id, delete_older_than_days=delete_older_than_days, filter=filter)
response: DeleteTabularDataResponse = await self._data_client.DeleteTabularData(request, metadata=self._metadata)
return response.deleted_count

Expand Down
8 changes: 1 addition & 7 deletions src/viam/components/audio_in/audio_in.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import abc
import sys
from typing import Final, Optional
from typing import Final, Optional, TypeAlias

from viam.proto.common import GetPropertiesResponse
from viam.proto.component.audioin import GetAudioResponse
Expand All @@ -9,11 +8,6 @@

from ..component_base import ComponentBase

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias


class AudioIn(ComponentBase):
"""AudioIn represents a component that can capture audio.
Expand Down
8 changes: 1 addition & 7 deletions src/viam/components/audio_out/audio_out.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import abc
import sys
from typing import Any, Dict, Final, Optional
from typing import Any, Dict, Final, Optional, TypeAlias

from viam.proto.common import GetPropertiesResponse
from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT

from ..component_base import ComponentBase
from . import AudioInfo

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias


class AudioOut(ComponentBase):
"""AudioOut represents a component that can play audio.
Expand Down
8 changes: 1 addition & 7 deletions src/viam/components/board/board.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import abc
import sys
from datetime import timedelta
from typing import Any, Dict, Final, List, Optional
from typing import Any, Dict, Final, List, Optional, TypeAlias

from viam.proto.component.board import PowerMode, ReadAnalogReaderResponse, StreamTicksResponse
from viam.resource.types import API, RESOURCE_NAMESPACE_RDK, RESOURCE_TYPE_COMPONENT
from viam.streams import Stream

from ..component_base import ComponentBase

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

Tick = StreamTicksResponse
TickStream = Stream[Tick]

Expand Down
8 changes: 1 addition & 7 deletions src/viam/components/camera/camera.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import abc
import sys
from typing import Any, Dict, Final, Optional, Sequence, Tuple
from typing import Any, Dict, Final, Optional, Sequence, Tuple, TypeAlias

from viam.media.video import NamedImage
from viam.proto.common import ResponseMetadata
Expand All @@ -9,11 +8,6 @@

from ..component_base import ComponentBase

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias


class Camera(ComponentBase):
"""
Expand Down
8 changes: 1 addition & 7 deletions src/viam/components/movement_sensor/movement_sensor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import abc
import sys
from dataclasses import dataclass
from typing import Any, Dict, Final, Mapping, Optional, Tuple
from typing import Any, Dict, Final, Mapping, Optional, Tuple, TypeAlias

from typing_extensions import Self

Expand All @@ -12,11 +11,6 @@

from . import GeoPoint, Orientation, Vector3

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias


class MovementSensor(ComponentBase):
"""MovementSensor reports information about the robot's direction, position and speed.
Expand Down
2 changes: 1 addition & 1 deletion src/viam/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InsecureConnectionError(ViamError):
def __init__(self, address: str, authenticated: bool = False) -> None:
self.address = address
self.authenticated = authenticated
self.message = f"Requested address {self.address} is insecure" + f'{" and will not send credentials" if self.authenticated else ""}'
self.message = f"Requested address {self.address} is insecure" + f"{' and will not send credentials' if self.authenticated else ''}"
super().__init__(self.message)


Expand Down
2 changes: 1 addition & 1 deletion src/viam/gen/app/agent/v1/agent_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from google.protobuf import runtime_version as _runtime_version
from google.protobuf import symbol_database as _symbol_database
from google.protobuf.internal import builder as _builder
_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 5, 29, 2, '', 'app/agent/v1/agent.proto')
_runtime_version.ValidateProtobufRuntimeVersion(_runtime_version.Domain.PUBLIC, 6, 33, 5, '', 'app/agent/v1/agent.proto')
_sym_db = _symbol_database.Default()
from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
Expand Down
Loading
Loading