Skip to content

Commit 63f1bf0

Browse files
committed
ci: type-check optional modules portably
1 parent 3c11491 commit 63f1bf0

7 files changed

Lines changed: 31 additions & 4 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ jobs:
133133
run: |
134134
if [[ "${{ matrix.python-version }}" == "3.15" ]]; then
135135
uv run --no-sync ty check --python-version 3.15 \
136-
--exclude '**/store/**' \
137-
--exclude '**/plot_correlation.py'
136+
--extra-search-path tests/type_stubs
138137
else
139138
uv run --no-sync ty check --python-version ${{ matrix.python-version }}
140139
fi

‎tests/test_release_policy.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def test_each_matrix_cell_runs_all_release_checks_without_masking_failures() ->
7979
assert "--python-version ${{ matrix.python-version }}" in commands["Run ty check"]
8080
assert "--no-sync" in commands["Run ty check"]
8181
assert 'matrix.python-version }}" == "3.15"' in commands["Run ty check"]
82-
assert "--exclude '**/store/**'" in commands["Run ty check"]
83-
assert "--exclude '**/plot_correlation.py'" in commands["Run ty check"]
82+
assert "--exclude" not in commands["Run ty check"]
83+
assert "--extra-search-path tests/type_stubs" in commands["Run ty check"]
8484
assert "--python python" in commands["Build package"]
8585

8686
test_command = commands["Run tests"]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
from typing import Any
2+
3+
class DuckDBPyConnection:
4+
def __getattr__(self, name: str) -> Any: ...
5+
6+
class DuckDBPyRelation:
7+
def __getattr__(self, name: str) -> Any: ...
8+
9+
def connect(database: str, *, read_only: bool = False) -> DuckDBPyConnection: ...
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Minimal Matplotlib surface used by the optional plotting module."""
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from typing import Any
2+
3+
class Axes:
4+
figure: Any
5+
def __getattr__(self, name: str) -> Any: ...
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from typing import Any
2+
3+
class Figure:
4+
def __getattr__(self, name: str) -> Any: ...
5+
6+
class SubFigure:
7+
def __getattr__(self, name: str) -> Any: ...
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from typing import Any
2+
3+
from matplotlib.axes import Axes
4+
from matplotlib.figure import Figure
5+
6+
def subplots(*args: Any, **kwargs: Any) -> tuple[Figure, Axes]: ...

0 commit comments

Comments
 (0)