FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable shell extra for installing ptpython and rich by sdb9696 · Pull Request #782 · python-kasa/python-kasa · GitHub

Repository navigation

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

Filter by extension

Filter by extension .lock  (1) .md  (1) .py  (1) .toml  (1) .yml  (1) All 5 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,16 @@ jobs:
- uses: "actions/setup-python@v4"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies (no speedups)"
- name: "Install dependencies (no extras)"
if: matrix.extras == false
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: "Install dependencies (with speedups)"
- name: "Install dependencies (with extras)"
if: matrix.extras == true
run: |
python -m pip install --upgrade pip poetry
poetry install --extras speedups
poetry install --all-extras
- name: "Run tests"
run: |
poetry run pytest --cov kasa --cov-report xml
Expand Down
10 changes: 9 additions & 1 deletion README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,19 @@ You can install the most recent release using pip:
pip install python-kasa
```

For enhanced cli tool support (coloring, embedded shell) install with `[shell]`:
```
pip install python-kasa[shell]
```

If you are using cpython, it is recommended to install with `[speedups]` to enable orjson (faster json support):
```
pip install python-kasa[speedups]
```

or for both:
```
pip install python-kasa[speedups, shell]
```
With `[speedups]`, the protocol overhead is roughly an order of magnitude lower (benchmarks available in devtools).

Alternatively, you can clone this repository and use poetry to install the development version:
Expand Down
2 changes: 1 addition & 1 deletion kasa/tests/test_cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ async def test_errors(mocker):
assert res.exit_code == 1
assert (
"Raised error: Managed to invoke callback without a context object of type 'Device' existing."
in res.output
in res.output.replace("\n", "") # Remove newlines from rich formatting
)
assert isinstance(res.exception, SystemExit)

Expand Down
115 changes: 113 additions & 2 deletions poetry.lock

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

7 changes: 4 additions & 3 deletions pyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ sphinxcontrib-programoutput = { version = "^0", optional = true }
myst-parser = { version = "*", optional = true }
docutils = { version = ">=0.17", optional = true }

# shell support
# ptpython = { version = "*", optional = true }
# enhanced cli support
ptpython = { version = "*", optional = true }
rich = { version = "*", optional = true }

[tool.poetry.group.dev.dependencies]
pytest = "*"
Expand All @@ -60,7 +61,7 @@ coverage = {version = "*", extras = ["toml"]}
[tool.poetry.extras]
docs = ["sphinx", "sphinx_rtd_theme", "sphinxcontrib-programoutput", "myst-parser", "docutils"]
speedups = ["orjson", "kasa-crypt"]
# shell = ["ptpython"]
shell = ["ptpython", "rich"]

[tool.coverage.run]
source = ["kasa"]
Expand Down

Back | FazBrowse Home | New Git URL