diff --git a/devtools/parse_pcap.py b/devtools/parse_pcap.py index 7a55bf54..02d3911c 100644 --- a/devtools/parse_pcap.py +++ b/devtools/parse_pcap.py @@ -8,7 +8,7 @@ import click import dpkt from dpkt.ethernet import ETH_TYPE_IP, Ethernet -from kasa.cli import echo +from kasa.cli.main import echo from kasa.xortransport import XorEncryption diff --git a/kasa/cli/__init__.py b/kasa/cli/__init__.py new file mode 100644 index 00000000..1d499165 --- /dev/null +++ b/kasa/cli/__init__.py @@ -0,0 +1 @@ +"""Package for the cli.""" diff --git a/kasa/cli/__main__.py b/kasa/cli/__main__.py new file mode 100644 index 00000000..5d4ca6a0 --- /dev/null +++ b/kasa/cli/__main__.py @@ -0,0 +1,5 @@ +"""Main module.""" + +from kasa.cli.main import cli + +cli() diff --git a/kasa/cli.py b/kasa/cli/main.py similarity index 100% rename from kasa/cli.py rename to kasa/cli/main.py diff --git a/kasa/tests/test_cli.py b/kasa/tests/test_cli.py index 06a7d37a..e6b96cd7 100644 --- a/kasa/tests/test_cli.py +++ b/kasa/tests/test_cli.py @@ -17,7 +17,7 @@ from kasa import ( Module, UnsupportedDeviceError, ) -from kasa.cli import ( +from kasa.cli.main import ( TYPE_TO_CLASS, alias, brightness, @@ -500,7 +500,7 @@ async def test_credentials(discovery_mock, mocker, runner): f"Username:{dev.credentials.username} Password:{dev.credentials.password}" ) - mocker.patch("kasa.cli.state", new=_state) + mocker.patch("kasa.cli.main.state", new=_state) dr = DiscoveryResult(**discovery_mock.discovery_data["result"]) res = await runner.invoke( @@ -746,7 +746,7 @@ async def test_type_param(device_type, mocker, runner): nonlocal result_device result_device = dev - mocker.patch("kasa.cli.state", new=_state) + mocker.patch("kasa.cli.main.state", new=_state) expected_type = TYPE_TO_CLASS[device_type] mocker.patch.object(expected_type, "update") res = await runner.invoke( diff --git a/pyproject.toml b/pyproject.toml index 45350aef..bfa04477 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ include = [ "Documentation" = "https://python-kasa.readthedocs.io" [tool.poetry.scripts] -kasa = "kasa.cli:cli" +kasa = "kasa.cli:__main__" [tool.poetry.dependencies] python = "^3.9"