Skip to content

Commit 492380e

Browse files
committed
Align tooling with dvd-dev/hilo: bump hooks, split dep groups, add coverage
1 parent dd13749 commit 492380e

7 files changed

Lines changed: 510 additions & 246 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"features": {
3+
"ghcr.io/devcontainers/features/github-cli:1": {
4+
"version": "1.1.0",
5+
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
6+
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
7+
},
8+
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {
9+
"version": "1.0.0",
10+
"resolved": "ghcr.io/jsburckhardt/devcontainer-features/uv@sha256:542a0bc2203205b3c696de650ba862f280b20af3543493cc232edd9ac35791f7",
11+
"integrity": "sha256:542a0bc2203205b3c696de650ba862f280b20af3543493cc232edd9ac35791f7"
12+
}
13+
}
14+
}

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@
4949
},
5050
"image": "mcr.microsoft.com/devcontainers/python:3.11-bookworm",
5151
"name": "A Python3, async interface to the Hilo API",
52-
"postCreateCommand": "uv sync && uv run pre-commit install"
52+
"postCreateCommand": "uv sync --group dev --group test && uv run pre-commit install"
5353
}

.github/workflows/tests.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
python-version: ${{ env.DEFAULT_PYTHON }}
2525

2626
- name: Install uv
27-
uses: astral-sh/setup-uv@v8.0.0
27+
uses: astral-sh/setup-uv@v8.1.0
2828

2929
- name: Install dependencies
30-
run: uv sync
30+
run: uv sync --group dev
3131

3232
- name: Run pre-commit on all files
3333
env:
@@ -47,10 +47,10 @@ jobs:
4747
python-version: ${{ env.DEFAULT_PYTHON }}
4848

4949
- name: Install uv
50-
uses: astral-sh/setup-uv@v8.0.0
50+
uses: astral-sh/setup-uv@v8.1.0
5151

5252
- name: Install dependencies
53-
run: uv sync
53+
run: uv sync --group test
5454

5555
- name: Run tests
5656
run: uv run pytest -v

.pre-commit-config.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
repos:
33
- repo: https://github.com/PyCQA/bandit
4-
rev: '1.7.9'
4+
rev: '1.9.2'
55
hooks:
66
- id: bandit
77
args:
@@ -12,14 +12,14 @@ repos:
1212
- repo: https://github.com/astral-sh/ruff-pre-commit
1313
rev: v0.15.9
1414
hooks:
15-
- id: ruff
16-
args: [--fix, --exit-non-zero-on-fix]
17-
files: ^pyhilo/.+\.py$
1815
- id: ruff-format
1916
args: [--quiet]
2017
files: ^pyhilo/.+\.py$
18+
- id: ruff
19+
args: [--fix, --exit-non-zero-on-fix]
20+
files: ^pyhilo/.+\.py$
2121
- repo: https://github.com/codespell-project/codespell
22-
rev: v2.2.6
22+
rev: v2.4.1
2323
hooks:
2424
- id: codespell
2525
args:
@@ -38,9 +38,13 @@ repos:
3838
- types-PyYAML
3939

4040
- repo: https://github.com/pre-commit/pre-commit-hooks
41-
rev: v5.0.0
41+
rev: v6.0.0
4242
hooks:
4343
- id: check-json
44+
# Exclude .devcontainer.json and .vscode since it uses JSONC
45+
exclude: (.vscode|.devcontainer)
46+
- id: check-yaml
47+
- id: trailing-whitespace
4448
- id: no-commit-to-branch
4549
args:
4650
- --branch=dev
@@ -51,7 +55,7 @@ repos:
5155
# - id: pydocstyle
5256
# files: ^((pyhilo|tests)/.+)?[^/]+\.py$
5357
- repo: https://github.com/gruntwork-io/pre-commit
54-
rev: v0.1.12
58+
rev: v0.1.30
5559
hooks:
5660
- id: shellcheck
5761
files: ^script/.+

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You need at least:
4141
To install all packages, including all development requirements:
4242

4343
```bash
44-
uv sync
44+
uv sync --group dev --group test
4545
```
4646

4747
As this repository uses the [pre-commit][pre-commit] framework, all changes
@@ -78,8 +78,6 @@ check [the contributor's page][contributors].
7878
[license-shield]: https://img.shields.io/github/license/dvd-dev/python-hilo.svg
7979
[devcontainer-shield]: https://img.shields.io/static/v1?label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode
8080
[devcontainer]: https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/dvd-dev/python-hilo
81-
[poetry-install]: https://python-poetry.org/docs/#installation
82-
[poetry]: https://python-poetry.org
8381
[pre-commit]: https://pre-commit.com/
8482
[uv]: https://docs.astral.sh/uv/
8583
[ruff]: https://docs.astral.sh/ruff/

pyproject.toml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,38 @@ build-backend = "hatchling.build"
4141

4242
[dependency-groups]
4343
dev = [
44-
"pre-commit>=4.0.0",
44+
"pre-commit>=4.6.0",
45+
]
46+
test = [
4547
"pytest>=8.0.0",
4648
"pytest-asyncio>=0.24.0",
49+
"pytest-cov>=5.0.0",
50+
"ruff>=0.15.12",
4751
]
4852

4953
[tool.pytest.ini_options]
5054
testpaths = ["tests"]
5155
asyncio_mode = "auto"
56+
addopts = [
57+
"--strict",
58+
"--cov=pyhilo",
59+
]
5260

5361
[tool.hatch.build.targets.wheel]
5462
packages = ["pyhilo"]
5563

64+
[tool.coverage.run]
65+
source = ["pyhilo"]
66+
67+
[tool.coverage.report]
68+
show_missing = true
69+
exclude_lines = [
70+
"pragma: no cover",
71+
"raise NotImplemented()",
72+
"if __name__ == .__main__.:",
73+
"main()",
74+
]
75+
5676
[tool.ruff]
5777
line-length = 88
5878
target-version = "py311"

0 commit comments

Comments
 (0)