Skip to content

Commit 63833ba

Browse files
authored
Integrate mypy (#8)
* added dependency groups for mypy and makefile with test-types command * hinted developer to run types tests before a PR
1 parent b2832a7 commit 63833ba

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
Thank you for your interest! Contributions of all kinds are welcome.
44

5+
6+
## PR TODO list - your first PR
7+
8+
Use this checklist to stay on track for your first code PR:
9+
10+
- **Clone this repository**: see [Set up developer environment](#set-up-developer-environment) section.
11+
- **Check out the coding style**: see [Code style](#code-style) section.
12+
- **Run tests**: run `make test-types` before you make a PR.
13+
- **Open a PR** on GitHub.
14+
515
## Using AI to contribute
616

717
I know, we all use Claude/Codex/OpenClaw and co. to help us write code faster. I am no exception. Just make sure that you review the generated code carefully before you make your PR.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.PHONY: test-types
2+
3+
# Strict mypy type-checking
4+
test-types:
5+
uv run --group types mypy pyvisim/

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,31 @@ include = ["pyvisim", "pyvisim.*"]
4848

4949
[tool.setuptools.package-data]
5050
pyvisim = ["res/model_files/*.pkl", "res/logging_config.yaml"]
51+
52+
# Dependencies groups to isolate test env from production env
53+
[dependency-groups]
54+
types = [
55+
"mypy",
56+
]
57+
dead-code = [
58+
"vulture",
59+
]
60+
fmt = [
61+
"ruff",
62+
]
63+
64+
[tool.mypy]
65+
python_version = "3.14"
66+
strict = true
67+
warn_return_any = true
68+
warn_unused_configs = true
69+
warn_unused_ignores = true
70+
show_error_codes = true
71+
pretty = true
72+
disallow_untyped_defs = true
73+
disallow_incomplete_defs = true
74+
disallow_any_generics = true
75+
disallow_untyped_calls = true
76+
no_implicit_optional = true
77+
check_untyped_defs = true
78+
exclude = ["^build/", "^dist/", "^\\.venv/", "^venv/"]

0 commit comments

Comments
 (0)