Skip to content

Commit e4dc31d

Browse files
committed
Merge branch 'dev' into xml_set_fanspeed
2 parents 315307a + 94ecd72 commit e4dc31d

File tree

194 files changed

+5978
-561
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

194 files changed

+5978
-561
lines changed

.devcontainer.json

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@
2727
"files.eol": "\n",
2828
"files.trimTrailingWhitespace": true,
2929
"python.analysis.autoImportCompletions": true,
30-
"python.analysis.autoSearchPaths": false,
31-
"python.analysis.extraPaths": ["/home/vscode/.local/lib/python3.12/"],
3230
"python.analysis.typeCheckingMode": "basic",
33-
"python.defaultInterpreterPath": "/usr/local/bin/python",
31+
"python.defaultInterpreterPath": "/workspaces/client.py/.venv/bin/python",
3432
"python.languageServer": "Pylance",
35-
"python.pythonPath": "/usr/local/python/bin/python",
33+
"python.pythonPath": "/workspaces/client.py/.venv/bin/python",
3634
"python.testing.pytestEnabled": true,
3735
"python.testing.unittestEnabled": false,
3836
"terminal.integrated.defaultProfile.linux": "zsh",
@@ -46,14 +44,19 @@
4644
},
4745
// Add the IDs of extensions you want installed when the container is created.
4846
"features": {
49-
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
47+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
48+
"ghcr.io/devcontainers/features/rust:1": {}
5049
},
51-
"image": "mcr.microsoft.com/devcontainers/python:3",
50+
"image": "mcr.microsoft.com/devcontainers/base:debian",
5251
"name": "Deebot client",
5352
// Use 'forwardPorts' to make a list of ports inside the container available locally.
5453
// "forwardPorts": [],
5554
// Use 'postCreateCommand' to run commands after the container is created.
56-
"postStartCommand": "pip install -r requirements-dev.txt && pre-commit install && pip install -e .",
55+
"postCreateCommand": "scripts/setup.sh",
56+
"postStartCommand": "uv sync --group dev",
57+
"remoteEnv": {
58+
"PATH": "/home/vscode/.local/bin:/home/vscode/.cargo/bin:/workspaces/client.py/.venv/bin:${containerEnv:PATH}"
59+
},
5760
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
5861
"remoteUser": "vscode",
5962
"runArgs": ["-e", "GIT_EDITOR=code --wait"]

.github/dependabot.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/renovate.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"commitMessagePrefix": "⬆️",
4+
"configMigration": true,
5+
"dependencyDashboard": true,
6+
"labels": ["dependencies", "no-stale"],
7+
"lockFileMaintenance": {
8+
"enabled": true
9+
},
10+
"packageRules": [
11+
{
12+
"addLabels": ["python"],
13+
"matchManagers": ["pep621"]
14+
},
15+
{
16+
"matchDepTypes": ["dev"],
17+
"matchManagers": ["pep621"],
18+
"rangeStrategy": "pin"
19+
},
20+
{
21+
"addLabels": ["github_actions"],
22+
"matchManagers": ["github-actions"],
23+
"rangeStrategy": "pin"
24+
},
25+
{
26+
"addLabels": ["rust"],
27+
"matchManagers": ["cargo"]
28+
}
29+
],
30+
"rebaseWhen": "behind-base-branch"
31+
}

.github/workflows/ci.yml

Lines changed: 86 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,44 @@ name: CI
33
on:
44
push:
55
branches:
6-
- main
76
- dev
87
pull_request:
98

109
env:
11-
DEFAULT_PYTHON: "3.12"
10+
UV_CACHE_DIR: /tmp/.uv-cache
1211

1312
jobs:
1413
code-quality:
1514
runs-on: "ubuntu-latest"
1615
name: Check code quality
1716
steps:
18-
- uses: "actions/checkout@v4"
19-
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
20-
id: python
21-
uses: actions/[email protected]
17+
- name: ⤵️ Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: 🏗 Install uv and Python
21+
uses: astral-sh/setup-uv@v5
2222
with:
23-
python-version: ${{ env.DEFAULT_PYTHON }}
24-
cache: "pip"
25-
cache-dependency-path: "requirements*"
26-
- name: Install dependencies
23+
enable-cache: true
24+
cache-dependency-glob: "uv.lock"
25+
cache-local-path: ${{ env.UV_CACHE_DIR }}
26+
27+
- name: Install additional OS dependencies
2728
run: |
28-
pip install -r requirements.txt
29-
pip install -r requirements-test.txt
29+
sudo apt-get update
30+
sudo apt-get -y install \
31+
pkg-config \
32+
liblzma-dev
33+
34+
- name: 🏗 Install the project
35+
run: uv sync --locked --group lint
36+
3037
# Following steps cannot run by pre-commit.ci as repo = local
3138
- name: Run mypy
32-
run: mypy deebot_client/
39+
run: uv run --frozen mypy deebot_client/
40+
3341
- name: Pylint review
34-
run: pylint deebot_client/
42+
run: uv run --frozen pylint deebot_client/**/*.py
43+
3544
- name: Verify no getLogger usages
3645
run: scripts/check_getLogger.sh
3746

@@ -40,24 +49,74 @@ jobs:
4049
name: Run tests
4150
strategy:
4251
matrix:
43-
python-version: ["3.12"]
52+
python-version:
53+
- "3.12"
54+
- "3.13"
4455
steps:
45-
- uses: "actions/checkout@v4"
46-
- name: Set up Python ${{ matrix.python-version }}
47-
id: python
48-
uses: actions/[email protected]
56+
- name: ⤵️ Checkout repository
57+
uses: actions/checkout@v4
58+
59+
- name: 🏗 Install uv and Python ${{ matrix.python-version }}
60+
uses: astral-sh/setup-uv@v5
4961
with:
62+
enable-cache: true
63+
cache-dependency-glob: "uv.lock"
64+
cache-local-path: ${{ env.UV_CACHE_DIR }}
5065
python-version: ${{ matrix.python-version }}
51-
cache: "pip"
52-
cache-dependency-path: "requirements*"
53-
- name: Install dependencies
66+
67+
- name: Install additional OS dependencies
5468
run: |
55-
pip install -r requirements.txt
56-
pip install -r requirements-test.txt
69+
sudo apt-get update
70+
sudo apt-get -y install \
71+
pkg-config \
72+
liblzma-dev
73+
74+
- name: 🏗 Install the project
75+
run: uv sync --locked --group test
76+
5777
- name: Run pytest
58-
run: pytest --cov=./ --cov-report=xml
78+
run: uv run --frozen pytest tests --cov=./ --cov-report=xml --junitxml=junit.xml -o junit_family=legacy
79+
5980
- name: Upload coverage to Codecov
60-
uses: codecov/codecov-action@v4
81+
uses: codecov/codecov-action@v5
82+
with:
83+
fail_ci_if_error: true
84+
85+
- name: Upload test results to Codecov
86+
if: ${{ !cancelled() }}
87+
uses: codecov/test-results-action@v1
6188
with:
62-
token: ${{ secrets.CODECOV_TOKEN }}
6389
fail_ci_if_error: true
90+
91+
benchmarks:
92+
runs-on: "ubuntu-latest"
93+
name: Run benchmarks
94+
steps:
95+
- name: ⤵️ Checkout repository
96+
uses: actions/checkout@v4
97+
98+
- name: 🏗 Install uv
99+
uses: astral-sh/setup-uv@v5
100+
101+
- name: 🏗 Setup Python
102+
uses: actions/setup-python@v5
103+
with:
104+
python-version-file: ".python-version"
105+
106+
- name: Install additional OS dependencies
107+
run: |
108+
sudo apt-get update
109+
sudo apt-get -y install \
110+
pkg-config \
111+
liblzma-dev
112+
113+
- name: 🏗 Install the project
114+
run: |
115+
uv export --group benchmark > requirements.txt
116+
uv pip install -e . --system -r requirements.txt
117+
118+
- name: Run benchmarks
119+
uses: CodSpeedHQ/action@main
120+
with:
121+
run: pytest tests/ --codspeed
122+
token: ${{ secrets.CODSPEED_TOKEN }}

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ name: "CodeQL"
1414
on:
1515
push:
1616
branches:
17-
- main
1817
- dev
1918
pull_request:
2019
schedule:

.github/workflows/python-publish.yml

Lines changed: 64 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,73 @@ on:
1313
types: [published]
1414

1515
jobs:
16-
deploy:
16+
wheels:
17+
name: Build wheels
1718
runs-on: ubuntu-latest
18-
environment: release
19-
permissions:
20-
id-token: write
19+
strategy:
20+
matrix:
21+
python-version:
22+
- "3.12"
23+
- "3.13"
24+
linux-compatibility:
25+
- "manylinux_2_34"
2126
steps:
22-
- name: 📥 Checkout the repository
23-
uses: actions/checkout@v4
24-
25-
- name: Set up Python
26-
uses: actions/[email protected]
27+
- name: ⤵️ Check out code from GitHub
28+
uses: actions/[email protected]
29+
- name: 🏗 Set up uv and Python ${{ matrix.python-version }}
30+
uses: astral-sh/setup-uv@v5
2731
with:
28-
python-version: "3.12"
29-
30-
- name: Install dependencies
32+
enable-cache: true
33+
python-version: ${{ matrix.python-version }}
34+
- name: Install additional OS dependencies
3135
run: |
32-
python -m pip install --upgrade pip
33-
pip install -q build
34-
36+
sudo apt-get update
37+
sudo apt-get -y install \
38+
pkg-config \
39+
liblzma-dev
40+
- name: 🏗 Set package version
41+
run: |
42+
sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
3543
- name: 📦 Build package
36-
run: python -m build
44+
run: uv build --wheel --config-settings build-args='--compatibility ${{ matrix.linux-compatibility }}'
45+
- name: ⬆️ Upload wheels
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: wheels-${{ matrix.python-version }}-${{ matrix.linux-compatibility }}
49+
path: dist
3750

38-
- name: 📤 Publish package
39-
uses: pypa/gh-action-pypi-publish@release/v1
51+
release:
52+
name: Releasing to PyPi
53+
runs-on: ubuntu-latest
54+
needs: ["wheels"]
55+
environment:
56+
name: release
57+
url: https://pypi.org/manage/project/deebot-client/
58+
permissions:
59+
contents: write
60+
id-token: write
61+
steps:
62+
- name: ⤵️ Check out code from GitHub
63+
uses: actions/[email protected]
64+
- name: 🏗 Set up uv
65+
uses: astral-sh/setup-uv@v5
66+
with:
67+
enable-cache: true
68+
- name: 🏗 Set package version
69+
run: |
70+
sed -i "s/^version = \".*\"/version = \"${{ github.event.release.tag_name }}\"/" pyproject.toml
71+
- name: 📦 Build source package
72+
run: uv build --sdist
73+
- name: ⬇️ Download wheels
74+
uses: actions/download-artifact@v4
75+
with:
76+
pattern: wheels-*
77+
path: dist
78+
merge-multiple: true
79+
- name: 🚀 Publish to PyPi
80+
run: uv publish
81+
- name: ✍️ Sign published artifacts
82+
uses: sigstore/[email protected]
83+
with:
84+
inputs: ./dist/*.tar.gz ./dist/*.whl
85+
release-signing-artifacts: true

.github/workflows/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release Drafter
33
on:
44
push:
55
branches:
6-
- main
6+
- dev
77

88
jobs:
99
update_release_draft:

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,11 @@ nosetests.xml
2121
.*_cache
2222

2323
test.py
24+
.env
25+
26+
/target
27+
28+
# rust so
29+
*.cpython*.so
30+
31+
.codspeed

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ ci:
77
- verifyNoGetLogger
88

99
default_language_version:
10-
python: python3.12
10+
python: python3.13
1111

1212
repos:
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.6.3
14+
rev: v0.9.2
1515
hooks:
1616
- id: ruff
1717
args:
1818
- --fix
1919
- --unsafe-fixes
2020
- id: ruff-format
2121
- repo: https://github.com/asottile/pyupgrade
22-
rev: v3.17.0
22+
rev: v3.19.1
2323
hooks:
2424
- id: pyupgrade
2525
args:
@@ -36,8 +36,9 @@ repos:
3636
exclude_types:
3737
- csv
3838
- json
39+
exclude: ^uv.lock$
3940
- repo: https://github.com/pre-commit/pre-commit-hooks
40-
rev: v4.6.0
41+
rev: v5.0.0
4142
hooks:
4243
- id: check-executables-have-shebangs
4344
- id: check-merge-conflict
@@ -54,6 +55,7 @@ repos:
5455
5556
exclude_types:
5657
- python
58+
exclude: ^uv.lock$
5759
- repo: https://github.com/adrienverge/yamllint.git
5860
rev: v1.35.1
5961
hooks:

0 commit comments

Comments
 (0)