Skip to content

Commit 439e33d

Browse files
committed
Reformat and use our own stubs for testing
1 parent c79748f commit 439e33d

File tree

5 files changed

+35
-134
lines changed

5 files changed

+35
-134
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ extra-standard-library = [
6868

6969
[tool.pyright]
7070
exclude = ["build", ".git"]
71+
stubPath = "./stubs"
7172
# Target oldest supported Python version
7273
pythonversion = "3.9"
7374
typeCheckingMode = "standard"

stubs/matplotlib/ft2font.pyi

Lines changed: 31 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -11,115 +11,45 @@ FIXED_SIZES: int
1111
FIXED_WIDTH: int
1212

1313
class FT2Font(_mod_builtins.object):
14-
15-
def __init__(self, *args, **kwargs) -> None:
16-
17-
...
18-
14+
def __init__(self, *args, **kwargs) -> None: ...
1915
@classmethod
20-
def __init_subclass__(cls) -> None:
21-
22-
...
23-
16+
def __init_subclass__(cls) -> None: ...
2417
@classmethod
25-
def __subclasshook__(cls, subclass: typing.Any) -> bool:
26-
27-
...
28-
18+
def __subclasshook__(cls, subclass: typing.Any) -> bool: ...
2919
@property
3020
def ascender(self) -> typing.Any: ...
3121
@property
3222
def bbox(self) -> typing.Any: ...
33-
def clear(self) -> typing.Any:
34-
35-
...
36-
23+
def clear(self) -> typing.Any: ...
3724
@property
3825
def descender(self) -> typing.Any: ...
39-
def draw_glyph_to_bitmap(self, bitmap, x, y, glyph) -> typing.Any:
40-
41-
...
42-
43-
def draw_glyphs_to_bitmap(self) -> typing.Any:
44-
45-
...
46-
26+
def draw_glyph_to_bitmap(self, bitmap, x, y, glyph) -> typing.Any: ...
27+
def draw_glyphs_to_bitmap(self) -> typing.Any: ...
4728
@property
4829
def face_flags(self) -> typing.Any: ...
4930
@property
5031
def family_name(self) -> typing.Any: ...
5132
@property
5233
def fname(self) -> typing.Any: ...
53-
def get_bitmap_offset(self) -> typing.Any:
54-
55-
...
56-
57-
def get_char_index(self, codepoint) -> typing.Any:
58-
59-
...
60-
61-
def get_charmap(self) -> typing.Any:
62-
63-
...
64-
65-
def get_descent(self) -> typing.Any:
66-
67-
...
68-
69-
def get_glyph_name(self, index) -> typing.Any:
70-
71-
...
72-
73-
def get_image(self) -> typing.Any:
74-
75-
...
76-
77-
def get_kerning(self, left, right, mode) -> typing.Any:
78-
79-
...
80-
81-
def get_name_index(self, name) -> typing.Any:
82-
83-
...
84-
85-
def get_num_glyphs(self) -> typing.Any:
86-
87-
...
88-
89-
def get_path(self) -> typing.Any:
90-
91-
...
92-
93-
def get_ps_font_info(self) -> typing.Any:
94-
95-
...
96-
97-
def get_sfnt(self) -> typing.Any:
98-
99-
...
100-
101-
def get_sfnt_table(self, name) -> typing.Any:
102-
103-
...
104-
105-
def get_width_height(self) -> typing.Any:
106-
107-
...
108-
109-
def get_xys(self) -> typing.Any:
110-
111-
...
112-
34+
def get_bitmap_offset(self) -> typing.Any: ...
35+
def get_char_index(self, codepoint) -> typing.Any: ...
36+
def get_charmap(self) -> typing.Any: ...
37+
def get_descent(self) -> typing.Any: ...
38+
def get_glyph_name(self, index) -> typing.Any: ...
39+
def get_image(self) -> typing.Any: ...
40+
def get_kerning(self, left, right, mode) -> typing.Any: ...
41+
def get_name_index(self, name) -> typing.Any: ...
42+
def get_num_glyphs(self) -> typing.Any: ...
43+
def get_path(self) -> typing.Any: ...
44+
def get_ps_font_info(self) -> typing.Any: ...
45+
def get_sfnt(self) -> typing.Any: ...
46+
def get_sfnt_table(self, name) -> typing.Any: ...
47+
def get_width_height(self) -> typing.Any: ...
48+
def get_xys(self) -> typing.Any: ...
11349
@property
11450
def height(self) -> typing.Any: ...
115-
def load_char(self, charcode, flags) -> typing.Any:
116-
117-
...
118-
119-
def load_glyph(self, glyphindex, flags) -> typing.Any:
120-
121-
...
122-
51+
def load_char(self, charcode, flags) -> typing.Any: ...
52+
def load_glyph(self, glyphindex, flags) -> typing.Any: ...
12353
@property
12454
def max_advance_height(self) -> typing.Any: ...
12555
@property
@@ -136,22 +66,10 @@ class FT2Font(_mod_builtins.object):
13666
def postscript_name(self) -> typing.Any: ...
13767
@property
13868
def scalable(self) -> typing.Any: ...
139-
def select_charmap(self, i) -> typing.Any:
140-
141-
...
142-
143-
def set_charmap(self, i) -> typing.Any:
144-
145-
...
146-
147-
def set_size(self, ptsize, dpi) -> typing.Any:
148-
149-
...
150-
151-
def set_text(self, string, angle, flags) -> typing.Any:
152-
153-
...
154-
69+
def select_charmap(self, i) -> typing.Any: ...
70+
def set_charmap(self, i) -> typing.Any: ...
71+
def set_size(self, ptsize, dpi) -> typing.Any: ...
72+
def set_text(self, string, angle, flags) -> typing.Any: ...
15573
@property
15674
def style_flags(self) -> typing.Any: ...
15775
@property
@@ -167,23 +85,11 @@ class FT2Font(_mod_builtins.object):
16785
class FT2Image(_mod_builtins.object):
16886
def __init__(self, *args, **kwargs) -> None: ...
16987
@classmethod
170-
def __init_subclass__(cls) -> None:
171-
172-
...
173-
88+
def __init_subclass__(cls) -> None: ...
17489
@classmethod
175-
def __subclasshook__(cls, subclass: typing.Any) -> bool:
176-
177-
...
178-
179-
def draw_rect(self, x0, y0, x1, y1) -> typing.Any:
180-
181-
...
182-
183-
def draw_rect_filled(self, x0, y0, x1, y1) -> typing.Any:
184-
185-
...
186-
90+
def __subclasshook__(cls, subclass: typing.Any) -> bool: ...
91+
def draw_rect(self, x0, y0, x1, y1) -> typing.Any: ...
92+
def draw_rect_filled(self, x0, y0, x1, y1) -> typing.Any: ...
18793
def __getattr__(self, name) -> typing.Any: ...
18894

18995
GLYPH_NAMES: int

stubs/sympy-stubs/matrices/sparse.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ class SparseRepMatrix(RepMatrix):
1111
def col_list(self) -> list[tuple[Any, ...]]: ...
1212
def nnz(self) -> int: ...
1313
def row_list(self) -> list[tuple[Any, ...]]: ...
14-
def scalar_multiply(self, scalar):
15-
16-
...
17-
14+
def scalar_multiply(self, scalar): ...
1815
def solve_least_squares(self, rhs, method=...): ...
1916
def solve(self, rhs, method=...) -> NotImplementedType | None: ...
2017

stubs/vispy/util/fonts/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66

77
__all__ = ["list_fonts"]
88

9-
from ._triage import list_fonts as list_fonts # noqa, analysis:ignore
10-
from ._vispy_fonts import _vispy_fonts as _vispy_fonts # noqa, analysis:ignore
9+
from ._triage import list_fonts as list_fonts # analysis:ignore
10+
from ._vispy_fonts import _vispy_fonts as _vispy_fonts # analysis:ignore

tests/sklearn/preprocessing_tests.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# pyright: reportUnknownVariableType=false
2-
# pyright: reportMissingTypeStubs=false
3-
41
from typing import Any
52
from typing_extensions import assert_type
63

0 commit comments

Comments
 (0)