Skip to content

Commit 276ef37

Browse files
tyvsmithclaude
andcommitted
Migrate to uv and pyproject.toml
Consolidates ruff.toml, pyrightconfig.json, and requirements-dev.txt into a single pyproject.toml. Adds uv.lock for reproducible installs. Updates CI to use astral-sh/setup-uv and .envrc to use uv sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e629ee9 commit 276ef37

7 files changed

Lines changed: 186 additions & 25 deletions

File tree

.envrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
source_env_if_exists .venv/bin/activate
1+
uv sync
2+
source .venv/bin/activate

.github/workflows/ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919

20-
- uses: actions/setup-python@v5
20+
- uses: astral-sh/setup-uv@v5
2121
with:
2222
python-version: ${{ matrix.python-version }}
23-
cache: pip
24-
cache-dependency-path: requirements-dev.txt
2523

2624
- name: Install dev dependencies
27-
run: pip install -r requirements-dev.txt
25+
run: uv sync
2826

2927
- name: Lint (ruff)
30-
run: ruff check lan_mouse.py tests/
28+
run: uv run ruff check lan_mouse.py tests/
3129

3230
- name: Type check (pyright)
33-
run: pyright
31+
run: uv run pyright
3432

3533
- name: Run tests
36-
run: pytest tests/ -v
34+
run: uv run pytest tests/ -v

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "streamcontroller-lan-mouse"
3+
version = "0.0.0"
4+
requires-python = ">=3.11"
5+
6+
[dependency-groups]
7+
dev = [
8+
"pygobject-stubs>=2.12",
9+
"pyright>=1.1",
10+
"pytest>=8",
11+
"ruff>=0.8",
12+
]
13+
14+
[tool.ruff]
15+
target-version = "py311"
16+
17+
[tool.ruff.lint]
18+
# E402: gi.require_version() must be called before gi.repository imports — unavoidable in GTK plugins
19+
ignore = ["E402"]
20+
21+
[tool.pyright]
22+
include = ["lan_mouse.py"]
23+
exclude = ["main.py", "actions/", "tests/", ".venv/"]
24+
pythonVersion = "3.11"
25+
typeCheckingMode = "strict"
26+
reportMissingImports = true
27+
reportMissingTypeStubs = false

pyrightconfig.json

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

requirements-dev.txt

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

ruff.toml

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

uv.lock

Lines changed: 152 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)