Skip to content

Commit 1d8983a

Browse files
authored
Use uv as package manager (#131)
* Switch to uv as package manager * Switch to ruff * Update dependabot to use uv * Update actions * Update lock file
1 parent 595fdd9 commit 1d8983a

File tree

9 files changed

+2443
-65
lines changed

9 files changed

+2443
-65
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: daily
7-
- package-ecosystem: pip
7+
- package-ecosystem: uv
88
directory: "/"
99
schedule:
1010
interval: daily

.github/workflows/pull.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,41 @@ jobs:
2424
name: Check style formatting
2525
steps:
2626
- uses: "actions/checkout@v4"
27-
- uses: "actions/setup-python@v5"
27+
- name: Install uv
28+
uses: astral-sh/setup-uv@v5
2829
with:
29-
python-version: "3.x"
30-
- run: python3 -m pip install black
31-
- run: black .
30+
version: "0.7"
31+
enable-cache: true
32+
- name: "Set up Python"
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version-file: ".python-version"
36+
- name: Install the project
37+
run: uv sync --locked --all-extras --dev
38+
- name: Run ruff
39+
run: uv run ruff check
3240

3341
tests:
3442
runs-on: "ubuntu-latest"
3543
name: Run tests
3644
steps:
3745
- name: Check out code from GitHub
3846
uses: "actions/checkout@v4"
39-
- name: Setup Python
40-
uses: "actions/setup-python@v5"
47+
- name: Install uv
48+
uses: astral-sh/setup-uv@v5
49+
with:
50+
version: "0.7"
51+
enable-cache: true
52+
cache-dependency-glob: "uv.lock"
53+
- name: "Set up Python"
54+
uses: actions/setup-python@v5
4155
with:
42-
python-version: "3.12"
43-
- name: Install requirements
44-
run: python3 -m pip install -r requirements_test.txt
56+
python-version-file: ".python-version"
57+
- name: Install the project
58+
run: uv sync --locked --all-extras --dev
4559
- name: Run tests
4660
run: |
47-
pytest \
61+
uv run pytest \
4862
-qq \
4963
--timeout=9 \
5064
--durations=10 \

.github/workflows/push.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,41 @@ jobs:
2727
name: Check style formatting
2828
steps:
2929
- uses: "actions/checkout@v4"
30-
- uses: "actions/setup-python@v5"
30+
- name: Install uv
31+
uses: astral-sh/setup-uv@v5
3132
with:
32-
python-version: "3.x"
33-
- run: python3 -m pip install black
34-
- run: black .
33+
version: "0.7"
34+
enable-cache: true
35+
- name: "Set up Python"
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version-file: ".python-version"
39+
- name: Install the project
40+
run: uv sync --locked --all-extras --dev
41+
- name: Run ruff
42+
run: uv run ruff check
3543

3644
tests:
3745
runs-on: "ubuntu-latest"
3846
name: Run tests
3947
steps:
4048
- name: Check out code from GitHub
4149
uses: "actions/checkout@v4"
42-
- name: Setup Python
43-
uses: "actions/setup-python@v5"
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v5
52+
with:
53+
version: "0.7"
54+
enable-cache: true
55+
cache-dependency-glob: "uv.lock"
56+
- name: "Set up Python"
57+
uses: actions/setup-python@v5
4458
with:
45-
python-version: "3.12"
46-
- name: Install requirements
47-
run: python3 -m pip install -r requirements_test.txt
59+
python-version-file: ".python-version"
60+
- name: Install the project
61+
run: uv sync --locked --all-extras --dev
4862
- name: Run tests
4963
run: |
50-
pytest \
64+
uv run pytest \
5165
-qq \
5266
--timeout=9 \
5367
--durations=10 \

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

pyproject.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[project]
2+
name = "tacmi"
3+
version = "1.9.12"
4+
description = "This integration monitors the inputs and outputs of the devices connected to a C.M.I."
5+
readme = "README.md"
6+
license = "MIT"
7+
license-files = ["LICENSE"]
8+
authors = [
9+
{ name = "DeerMaximum", email = "[email protected]" },
10+
]
11+
maintainers = [
12+
{ name = "DeerMaximum", email = "[email protected]" },
13+
]
14+
requires-python = ">=3.13.2"
15+
keywords = [
16+
"homeassistant",
17+
"c.m.i.",
18+
]
19+
classifiers = [
20+
"Development Status :: 5 - Production/Stable",
21+
"Operating System :: OS Independent",
22+
"Programming Language :: Python",
23+
"Programming Language :: Python :: 3.13",
24+
]
25+
dependencies = [
26+
"ta-cmi==3.3.1",
27+
]
28+
29+
[project.urls]
30+
homepage = "https://github.com/DeerMaximum/Technische-Alternative-CMI"
31+
repository = "https://github.com/DeerMaximum/Technische-Alternative-CMI"
32+
33+
[dependency-groups]
34+
dev = [
35+
"aiohttp_cors",
36+
"pytest-homeassistant-custom-component==0.13.232",
37+
"josepy<2.0.0"
38+
]
39+
lint = [
40+
"ruff>=0.12.0"
41+
]
42+
43+
[tool.ruff]
44+
preview = true
45+
46+
[tool.ruff.lint.isort]
47+
case-sensitive = true
48+
49+
[tool.uv]
50+
default-groups = "all"

requirements_dev.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

requirements_test.txt

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

setup.cfg

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

0 commit comments

Comments
 (0)