Skip to content

Commit 3436538

Browse files
authored
add cov; fix ci; add type checking (#39)
* add cov; fix ci; add type checking * readd py versions * resolve type checks * add ty
1 parent f4b1a6b commit 3436538

7 files changed

Lines changed: 406 additions & 6 deletions

File tree

.github/workflows/run-tests.yml.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run_tests:
3030
strategy:
3131
matrix:
32-
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
32+
python_version: ["3.11", "3.12", "3.13", "3.14"]
3333
os: [ubuntu-24.04, macos-14]
3434
runs-on: ${{ matrix.os }}
3535
env:

.github/workflows/test-template.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
run_tests:
3030
strategy:
3131
matrix:
32-
python_version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
32+
python_version: ["3.11", "3.12", "3.13", "3.14"]
3333
os: [ubuntu-24.04, macos-14]
3434
runs-on: ${{ matrix.os }}
3535
env:

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ repos:
5151
rev: 'v2.16'
5252
hooks:
5353
- id: vulture
54+
- repo: local
55+
hooks:
56+
- id: ty
57+
name: ty
58+
entry: uv run --frozen --with ty ty check
59+
language: system
60+
files: ^(src|tests)/.*\.py$
61+
exclude: ^src/\{\{\ python_package_name\ \}\}/__init__\.py$
5462
- repo: https://github.com/aristanetworks/j2lint
5563
rev: "v1.2.0"
5664
hooks:

.pre-commit-config.yaml.jinja

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,10 @@ repos:
5151
rev: 'v2.14'
5252
hooks:
5353
- id: vulture
54+
- repo: local
55+
hooks:
56+
- id: ty
57+
name: ty
58+
entry: uv run --frozen --with ty ty check
59+
language: system
60+
files: ^(src|tests)/.*\.py$

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ dependencies = [
2424

2525
[dependency-groups]
2626
dev = [
27+
"coverage[toml]>=7.10.6",
28+
"pandas>=2.2.3",
2729
"pytest>=9.0.3",
30+
"pytest-cov>=6.2.1",
2831
]
2932

3033
[tool.ruff]
@@ -59,6 +62,17 @@ lint.per-file-ignores."__init__.py" = [ "F401" ]
5962

6063
[tool.pytest]
6164
ini_options.pythonpath = [ "." ]
65+
ini_options.addopts = [
66+
"--cov=tests",
67+
"--cov-report=term-missing",
68+
"--cov-report=xml",
69+
]
70+
71+
[tool.coverage]
72+
run.branch = true
73+
run.source = [ "tests" ]
74+
report.show_missing = true
75+
report.skip_covered = true
6276

6377
[tool.vulture]
6478
min_confidence = 90

pyproject.toml.jinja

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ scripts.{{ project_name }} = "{{ python_package_name }}.cli:trigger"
2929
dev = [
3030
"poethepoet>=0.34",
3131
"pytest>=8.3.5",
32+
"pytest-cov>=6.2.1",
33+
"coverage[toml]>=7.10.6",
3234
]
3335
docs = [
3436
"myst-nb>=1.2",
@@ -81,6 +83,19 @@ lint.per-file-ignores."__init__.py" = [ "F401" ]
8183

8284
[tool.pytest.ini_options]
8385
pythonpath = [ "." ]
86+
addopts = [
87+
"--cov={{ python_package_name }}",
88+
"--cov-report=term-missing",
89+
"--cov-report=xml",
90+
]
91+
92+
[tool.coverage.run]
93+
branch = true
94+
source = [ "src/{{ python_package_name }}" ]
95+
96+
[tool.coverage.report]
97+
show_missing = true
98+
skip_covered = true
8499

85100
[tool.poe.tasks]
86101
# tasks for development environments

uv.lock

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

0 commit comments

Comments
 (0)