Skip to content

Commit e769b7c

Browse files
authored
Use uv build (#571)
1 parent c21fbd2 commit e769b7c

File tree

4 files changed

+47
-59
lines changed

4 files changed

+47
-59
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,29 @@ jobs:
1515
runs-on: "ubuntu-latest"
1616
name: Check code quality
1717
steps:
18-
- uses: actions/checkout@v4
19-
- name: Set up uv
20-
# Install latest uv version using the installer
21-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
22-
- name: "Set up Python"
18+
- name: ⤵️ Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: 🏗 Install uv
22+
uses: astral-sh/setup-uv@v2
23+
24+
- name: 🏗 Set up Python
2325
uses: actions/setup-python@v5
2426
with:
2527
python-version-file: ".python-version"
26-
- name: Restore uv cache
28+
29+
- name: 🏗 Restore uv cache
2730
uses: actions/cache@v4
2831
with:
2932
path: /tmp/.uv-cache
3033
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
3134
restore-keys: |
3235
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
3336
uv-${{ runner.os }}
34-
- name: Install the project
37+
38+
- name: 🏗 Install the project
3539
run: uv sync --locked --dev
40+
3641
# Following steps cannot run by pre-commit.ci as repo = local
3742
- name: Run mypy
3843
run: uv run mypy deebot_client/

.github/workflows/python-publish.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ jobs:
1919
permissions:
2020
id-token: write
2121
steps:
22-
- name: 📥 Checkout the repository
22+
- name: ⤵️ Checkout repository
2323
uses: actions/checkout@v4
2424

25-
- name: Set up uv
25+
- name: 🏗 Install uv
2626
# Install latest uv version using the installer
2727
run: curl -LsSf https://astral.sh/uv/install.sh | sh
2828

29-
- name: "Set up Python"
29+
- name: 🏗 Set up Python
3030
uses: actions/setup-python@v5
3131
with:
3232
python-version-file: ".python-version"
3333

34-
- name: Restore uv cache
34+
- name: 🏗 Restore uv cache
3535
uses: actions/cache@v4
3636
with:
3737
path: /tmp/.uv-cache
@@ -40,13 +40,20 @@ jobs:
4040
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }}
4141
uv-${{ runner.os }}
4242
43-
- name: Install the project
43+
- name: 🏗 Install the project
4444
run: uv sync --dev --locked
4545

4646
- name: 📦 Build package
47-
run: |
48-
. .venv/bin/activate
49-
python -m build
47+
run: uv build
5048

51-
- name: 📤 Publish package
49+
- name: 🚀 Publish package
5250
uses: pypa/gh-action-pypi-publish@release/v1
51+
with:
52+
verbose: true
53+
print-hash: true
54+
55+
- name: ✍️ Sign published artifacts
56+
uses: sigstore/[email protected]
57+
with:
58+
inputs: ./dist/*.tar.gz ./dist/*.whl
59+
release-signing-artifacts: true

pyproject.toml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ dynamic = ["version"]
3636
"Source Code" = "https://github.com/DeebotUniverse/client.py"
3737
"Bug Reports" = "https://github.com/DeebotUniverse/client.py/issues"
3838

39+
[tool.uv]
40+
dev-dependencies = [
41+
"mypy==1.11.2",
42+
"pre-commit==3.8.0",
43+
"pycountry==24.6.1",
44+
"pylint==3.2.7",
45+
"pytest-asyncio==0.24.0",
46+
"pytest-cov==5.0.0",
47+
"pytest-docker-fixtures==1.3.19",
48+
"pytest-timeout==2.3.1",
49+
"pytest==8.3.3",
50+
"testfixtures==8.3.0",
51+
"types-cachetools>=5.5.0.20240820",
52+
"types-mock>=5.1.0.20240425",
53+
"types-pillow>=10.2.0.20240822",
54+
]
55+
56+
3957
[tool.hatch.build.targets.sdist]
4058
include = [
4159
"/deebot_client",
@@ -176,20 +194,3 @@ overgeneral-exceptions = [
176194
"builtins.Exception",
177195
]
178196

179-
[tool.uv]
180-
dev-dependencies = [
181-
"build>=1.2.1",
182-
"mypy==1.11.2",
183-
"pre-commit==3.8.0",
184-
"pycountry==24.6.1",
185-
"pylint==3.2.7",
186-
"pytest-asyncio==0.24.0",
187-
"pytest-cov==5.0.0",
188-
"pytest-docker-fixtures==1.3.19",
189-
"pytest-timeout==2.3.1",
190-
"pytest==8.3.3",
191-
"testfixtures==8.3.0",
192-
"types-cachetools>=5.5.0.20240820",
193-
"types-mock>=5.1.0.20240425",
194-
"types-pillow>=10.2.0.20240822",
195-
]

uv.lock

Lines changed: 1 addition & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)