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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ Install this via pip (or your favourite package manager):

`pip install python-roborock`

To use the `roborock` command line tool, install the `cli` extra, which pulls in
its additional dependencies (click, pyyaml, pyshark):

`pip install python-roborock[cli]`

## Example Usage

See [examples/example.py](examples/example.py) for a more full featured example,
Expand Down
16 changes: 12 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ classifiers = [
"Topic :: Software Development :: Libraries",
]
dependencies = [
"click>=8",
"aiohttp>=3.8.2,<4",
"pycryptodome~=3.18",
"pycryptodomex~=3.18 ; sys_platform == 'darwin'",
Expand All @@ -29,7 +28,16 @@ dependencies = [
"vacuum-map-parser-roborock",
"pyrate-limiter>=4.0.0,<5",
"aiomqtt>=2.5.0,<3",
]

[project.optional-dependencies]
# Dependencies required by the `roborock` command line tool (roborock.cli).
# Install with: pip install python-roborock[cli]
cli = [
"click>=8",
"click-shell~=2.1",
"pyyaml>=6.0.3",
"pyshark>=0.6,<0.7",
]

[project.urls]
Expand All @@ -41,20 +49,20 @@ roborock = "roborock.cli:main"

[dependency-groups]
dev = [
# Pull in the CLI dependencies so maintainers can run the `roborock`
# command and pdoc can import roborock.cli for docs generation.
"python-roborock[cli]",
"pytest-asyncio>=1.1.0",
"pytest",
"pre-commit>=3.5,<5.0",
"mypy",
"ruff==0.14.11",
"codespell",
"pyshark>=0.6,<0.7",
"aioresponses>=0.7.7,<0.8",
"freezegun>=1.5.1,<2",
"pytest-timeout>=2.3.1,<3",
"syrupy>=4.9.1,<6",
"pdoc>=15.0.4,<17",
"pyyaml>=6.0.3",
"pyshark>=0.6",
"pytest-cov>=7.0.0",
]

Expand Down
18 changes: 12 additions & 6 deletions roborock/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,18 @@
from pathlib import Path
from typing import Any, cast

import click
import click_shell
import yaml
from pyshark import FileCapture # type: ignore
from pyshark.capture.live_capture import LiveCapture, UnknownInterfaceException # type: ignore
from pyshark.packet.packet import Packet # type: ignore
try:
import click
import click_shell
import yaml
from pyshark import FileCapture # type: ignore
from pyshark.capture.live_capture import LiveCapture, UnknownInterfaceException # type: ignore
from pyshark.packet.packet import Packet # type: ignore
except ImportError as err:
raise SystemExit(
f"The 'roborock' command line tool requires extra dependencies that are not installed ({err.name}).\n"
"Install them with:\n\n pip install python-roborock[cli]\n"
) from err

from roborock import RoborockCommand
from roborock.data import RoborockBase, UserData
Expand Down
24 changes: 15 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading