Skip to content

Commit 2a7e4c4

Browse files
committed
fix: update version pinning, ruff and pyright default checks, test runner and clean up Makefile logic
1 parent 1ed67dd commit 2a7e4c4

File tree

5 files changed

+135
-88
lines changed

5 files changed

+135
-88
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ jobs:
88
steps:
99
- uses: actions/checkout@v4
1010

11-
# - uses: webfactory/ssh-agent@v0.9.0
12-
# with:
13-
# ssh-private-key: ${{ secrets.DEPS_SSH_KEY }}
14-
15-
- uses: astral-sh/setup-uv@v6
16-
- uses: actions/setup-python@v5
11+
- uses: astral-sh/setup-uv@v7
1712
with:
18-
python-version-file: .python-version
13+
version: "0.5.11"
14+
enable-cache: true
15+
version-file: .python-version
1916

2017
- run: uv sync --locked --all-groups
2118

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
.PHONY: help install format lint lint-fix typecheck docstring style fix \
2-
check sync clean test stats watch live-stream run-client reclaim \
3-
monitor monitor-charts
2+
check sync clean test stats watch
43
.DEFAULT_GOAL := help
54

6-
TEST_FLAGS := -xvv -s -p no:anchorpy
5+
TEST_FLAGS := -xvv -s
76

87
install: ## Create / update virtual‑env with all dependency groups
98
uv sync --all-groups
@@ -31,8 +30,8 @@ fix: format lint-fix ## Run all formatters and fixers
3130
check: fix typecheck ## Run all checks (format, lint‑fix, typecheck)
3231

3332
sync: ## Re‑lock and install latest versions
34-
uv lock --upgrade # rebuild uv.lock with newer pins
35-
uv sync --all-groups # install everything into .venv
33+
uv lock --upgrade
34+
uv sync --all-groups --reinstall
3635

3736
clean: ## Remove build artefacts and caches
3837
rm -rf .ruff_cache/ .mypy_cache/ .pytest_cache/ dist/ build/
@@ -55,10 +54,10 @@ stats: ## Show code quality statistics
5554
# make watch path/to/file → watch single test file
5655
watch:
5756
@if [ -z "$(filter-out $@,$(MAKECMDGOALS))" ]; then \
58-
uv run pytest-watcher . --runner "pytest tests $(TEST_FLAGS) -W ignore::DeprecationWarning"; \
57+
uv run pytest-watcher . -- tests $(TEST_FLAGS) -W ignore::DeprecationWarning; \
5958
else \
6059
path_arg="$(filter-out $@,$(MAKECMDGOALS))"; \
61-
uv run pytest-watcher . --runner "pytest src/tests/$$path_arg $(TEST_FLAGS) -W ignore::DeprecationWarning"; \
60+
uv run pytest-watcher . -- tests/$$path_arg $(TEST_FLAGS) -W ignore::DeprecationWarning; \
6261
fi
6362

6463
# Pattern rule so additional args do not trigger "No rule to make target"

pyproject.toml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ authors = [
77
{ name = "idatsy", email = "stefan@ranvier.co.uk" }
88
]
99
requires-python = ">=3.13"
10-
dependencies = []
10+
dependencies = [
11+
"loguru",
12+
]
1113

1214
[project.scripts]
1315
python-base-uv = "python_base_uv:main"
@@ -16,32 +18,52 @@ python-base-uv = "python_base_uv:main"
1618
requires = ["hatchling"]
1719
build-backend = "hatchling.build"
1820

21+
[tool.uv]
22+
default-groups = ["dev"]
23+
24+
[tool.pytest.ini_options]
25+
asyncio_mode = "auto"
26+
asyncio_default_fixture_loop_scope = "function"
27+
1928
[dependency-groups]
2029
dev = [
21-
"pyrefly>=0.25.1",
22-
"pyright>=1.1.403",
23-
"pytest>=8.4.1",
24-
"pytest-asyncio>=1.1.0",
25-
"pytest-watcher>=0.4.3",
26-
"ruff>=0.12.5",
30+
"pyrefly",
31+
"pyright",
32+
"pytest",
33+
"pytest-asyncio",
34+
"pytest-watcher",
35+
"ruff",
2736
]
2837

2938
[tool.ruff]
3039
line-length = 125
3140
target-version = "py313"
3241

3342
[tool.ruff.lint]
34-
extend-select = ["E","W","F","I","B","C4","N","D","UP","S","ANN","ARG","ERA","ICN","PD","NPY","PT","RET","SIM","TCH"]
35-
ignore = ["ANN204", "C901","S608","D401","E501","D107","W291","RET503","D100","D101","D102","D103","D104","D105","S104","PD901"]
43+
select = ["ALL"]
44+
ignore = [
45+
"ANN204", # Missing return type for __init__
46+
"C901", # Too complex
47+
"COM812", # Missing trailing comma (conflicts with formatter)
48+
"D100", "D101", "D102", "D103", "D104", "D105", "D107", # Missing docstrings
49+
"D401", # First line imperative mood
50+
"E501", # Line too long (handled by formatter)
51+
"ISC001", # Single line implicit string concatenation (conflicts with formatter)
52+
"RET503", # Missing explicit return
53+
"S104", # Possible binding to all interfaces
54+
"S608", # SQL injection (too many false positives)
55+
"W291", # Trailing whitespace
56+
]
3657
fixable = ["ALL"]
3758
pydocstyle = { convention = "google" }
3859

3960
[tool.ruff.lint.per-file-ignores]
4061
"**/wip*.py" = ["ALL"]
41-
"**/tests/*" = ["D","ANN","S","ERA"]
42-
"*_" = ["D","ANN","S"]
43-
"wip*" = ["D","ANN","S"]
62+
"**/tests/*" = ["D", "ANN", "S", "ERA", "INP001"]
63+
"*_" = ["D", "ANN", "S"]
64+
"wip*" = ["D", "ANN", "S"]
4465
"__init__.py" = ["D"]
66+
"__main__.py" = ["T201"] # Allow print in main entry point
4567
"**/gen/*" = ["ALL"]
4668
"**/*.ipynb" = ["ALL"]
4769

@@ -69,7 +91,6 @@ defineConstant = { DEBUG = true }
6991
typeCheckingMode = "standard"
7092
pythonVersion = "3.13"
7193
pythonPlatform = "All"
72-
stubPath = "typings"
7394
reportMissingImports = "error"
7495
reportMissingTypeStubs = false
7596
reportMissingModuleSource = false
@@ -83,10 +104,3 @@ reportImportCycles = "warning"
83104
reportUnusedImport = "warning"
84105
reportUnusedVariable = "warning"
85106
reportDuplicateImport = "warning"
86-
87-
[[tool.pyright.overrides]]
88-
pattern = ".venv/**"
89-
reportUnknownParameterType = "none"
90-
reportUnknownArgumentType = "none"
91-
reportUnknownMemberType = "none"
92-
reportMissingParameterType = "none"

tests/test_something.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,12 @@
1-
def test_something() -> None:
2-
return True
1+
import pytest
2+
3+
4+
def test_sync_example() -> None:
5+
"""Example synchronous test."""
6+
assert True
7+
8+
9+
@pytest.mark.asyncio
10+
async def test_async_example() -> None:
11+
"""Example asynchronous test."""
12+
assert True

0 commit comments

Comments
 (0)