Add optional kasa-crypt dependency for speedups (#464)

If installed, use the optimized protocol encryption procedures implemented as a C extension by kasa-crypt (https://pypi.org/project/kasa-crypt/
This commit is contained in:
J. Nick Koston
2023-06-29 19:43:01 -05:00
committed by GitHub
parent 2d42ca301f
commit afd54d11d3
4 changed files with 53 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ jobs:
poetry run pre-commit run check-ast --all-files
tests:
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}"
name: Python ${{ matrix.python-version}} on ${{ matrix.os }}${{ fromJSON('[" (extras)", ""]')[matrix.extras == ''] }}
needs: linting
runs-on: ${{ matrix.os }}
@@ -66,6 +66,24 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
os: [ubuntu-latest, macos-latest, windows-latest]
extras: [false, true]
exclude:
- os: macos-latest
extras: true
- os: windows-latest
extras: true
- os: ubuntu-latest
python-version: "pypy-3.8"
extras: true
- os: ubuntu-latest
python-version: "3.8"
extras: true
- os: ubuntu-latest
python-version: "3.9"
extras: true
- os: ubuntu-latest
python-version: "3.10"
extras: true
# exclude pypy on windows, as the poetry install seems to be very flaky:
# PermissionError(13, 'The process cannot access the file because it is being used by another process'))
# at C:\hostedtoolcache\windows\PyPy\3.7.10\x86\site-packages\requests\models.py:761 in generate
@@ -78,10 +96,16 @@ jobs:
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
- name: "Install dependencies (no speedups)"
if: matrix.extras == false
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: "Install dependencies (with speedups)"
if: matrix.extras == true
run: |
python -m pip install --upgrade pip poetry
poetry install --extras speedups
- name: "Run tests"
run: |
poetry run pytest --cov kasa --cov-report xml