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
15 changes: 4 additions & 11 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ description: Install uv, configure the system python, and the package dependenci
inputs:
uv-install-options:
default: ""
uv-version:
default: 0.9.16
python-version:
required: true
cache-pre-commit:
Expand All @@ -17,16 +15,11 @@ runs:
steps:
- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
with:
enable-cache: true

- name: Setup Python
id: setup-python
uses: actions/setup-python@v6
with:
version-file: uv.lock
python-version: ${{ inputs.python-version }}
allow-prereleases: true

- name: Install Project Dependencies
id: install-project-dependencies
Expand All @@ -44,7 +37,7 @@ runs:
- name: pre-commit Cache
id: pre-commit-cache
if: inputs.cache-pre-commit == 'true'
uses: actions/cache@v4
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5
with:
path: ~/.cache/pre-commit/
key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
key: cache-${{ inputs.cache-version }}-${{ runner.os }}-${{ runner.arch }}-pre-commit-${{ steps.pre-commit-version.outputs.pre-commit-version }}-python-${{ inputs.python-version }}-${{ steps.setup-uv.outputs.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
17 changes: 8 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
UV_VERSION: 0.9.16

jobs:
lint:
name: Perform Lint Checks
Expand All @@ -32,15 +29,14 @@ jobs:
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
cache-pre-commit: true
uv-version: ${{ env.UV_VERSION }}
uv-install-options: --all-extras

- name: Run pre-commit Checks
Expand All @@ -66,24 +62,27 @@ jobs:
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup Environment
id: setup-environment
uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
uv-version: ${{ env.UV_VERSION }}
uv-install-options: ${{ matrix.extras == true && '--all-extras' || '' }}

- name: Run PyTests with Code Coverage
id: run-pytests-with-code-coverage
shell: bash
run: |
uv run pytest -n auto --cov kasa --cov-report xml
if [[ "${{ runner.os }}" == "Windows" ]]; then
uv run pytest -n0 --cov kasa --cov-report xml
else
uv run pytest -n auto --cov kasa --cov-report xml
fi

- name: Upload Code Coverage to Codecov
id: upload-code-coverage-to-codecov
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
token: ${{ secrets.CODECOV_TOKEN }}
8 changes: 5 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
env:
CODEQL_ACTION_FILE_COVERAGE_ON_PRS: true
permissions:
actions: read
contents: read
Expand All @@ -37,14 +39,14 @@ jobs:
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Initialize CodeQL
id: init-codeql
uses: github/codeql-action/init@v4
uses: github/codeql-action/init@c10b8064de6f491fea524254123dbe5e09572f13 # v4
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
id: perform-codeql-analysis
uses: github/codeql-action/analyze@v4
uses: github/codeql-action/analyze@c10b8064de6f491fea524254123dbe5e09572f13 # v4
12 changes: 4 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
types: [published]

env:
UV_VERSION: 0.9.16
PYTHON_VERSION: 3.13

jobs:
Expand All @@ -18,16 +17,13 @@ jobs:
steps:
- name: Checkout Source Files
id: checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup uv
id: setup-uv
uses: astral-sh/setup-uv@v7

- name: Setup Python
id: setup-python
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
with:
version-file: uv.lock
python-version: ${{ env.PYTHON_VERSION }}

- name: Build Packages
Expand All @@ -37,4 +33,4 @@ jobs:

- name: Publish Release on PyPI
id: publish-release-on-pypi
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- name: Stale Issues and PRs Policy
id: stale-issues-and-prs-policy
uses: actions/stale@v10
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
with:
repo-token: ${{ github.token }}
days-before-stale: 90
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:

- name: needs-more-information and waiting-for-reporter Stale Issues Policy
id: specific-stale-issues-policy
uses: actions/stale@v10
uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10
with:
repo-token: ${{ github.token }}
only-labels: "needs-more-information,waiting-for-reporter"
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ dev-dependencies = [
"pytest-xdist>=3.6.1",
"pytest-socket>=0.7.0",
"ruff>=0.9.0",
"uv>=0.11.26",
]


Expand Down
28 changes: 28 additions & 0 deletions uv.lock

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

Loading