Skip to content

Commit 70169cf

Browse files
committed
Integrate type checking with mypy
Adds mypy into the pre-commit hooks and CI, and fixes some minor type errors
1 parent 9c43815 commit 70169cf

File tree

7 files changed

+72
-3
lines changed

7 files changed

+72
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- run: uv python install python3.13
1818
- run: uv run ruff check src/obelisk/
1919
- run: uv run ruff format --check src/obelisk/
20+
- run: uv run mypy src/obelisk/
2021
test:
2122
name: Run tests
2223
strategy:

hooks/pre-commit

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
# Redirect output to stderr.
1111
exec 1>&2
1212

13-
exec uv run ruff format --check src/obelisk/
13+
uv run ruff format --check src/obelisk/
14+
uv run mypy src/obelisk/

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies = [
99
"pydantic>=2.10.6",
1010
"pytest>=8.3.5",
1111
"pytest-asyncio>=0.25.3",
12+
"mypy>=1.18.2",
1213
]
1314
authors = [
1415
{ name="Stef Pletinck", email="[email protected]"},

src/__init__.py

Whitespace-only changes.

src/obelisk/asynchronous/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ def __init__(
225225
retry_strategy: RetryStrategy = NoRetryStrategy(),
226226
) -> None:
227227
BaseClient.__init__(
228+
self,
228229
client=client,
229230
secret=secret,
230231
retry_strategy=retry_strategy,

src/obelisk/sync/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def fetch_single_chunk(
4646
self,
4747
datasets: List[str],
4848
metrics: Optional[List[str]] = None,
49-
fields: Optional[dict] = None,
49+
fields: Optional[List[str]] = None,
5050
from_timestamp: Optional[int] = None,
5151
to_timestamp: Optional[int] = None,
5252
order_by: Optional[dict] = None,
@@ -116,7 +116,7 @@ def query(
116116
self,
117117
datasets: List[str],
118118
metrics: Optional[List[str]] = None,
119-
fields: Optional[dict] = None,
119+
fields: Optional[List[str]] = None,
120120
from_timestamp: Optional[int] = None,
121121
to_timestamp: Optional[int] = None,
122122
order_by: Optional[dict] = None,

uv.lock

Lines changed: 65 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)