Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 75c15d9

Browse files
Merge pull request #3616 from pygame-community/ankith26-drop-3.9
Drop python 3.9
2 parents 3c8f666 + 1f001e9 commit 75c15d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+369
-413
lines changed

‎.github/workflows/build-sdl3.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353

5454
steps:
5555
- uses: actions/checkout@v5.0.0
56+
- uses: actions/setup-python@v6
57+
with:
58+
python-version: '3.14'
5659

5760
- name: Install pygame deps (linux)
5861
if: matrix.os == 'ubuntu-24.04'

‎.github/workflows/run-ubuntu-checks.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,8 @@ jobs:
5353
os: [ ubuntu-24.04 ]
5454
# check our min python (minor) version and our max python (minor) version
5555
python: [
56-
3.9.23,
57-
3.13.5,
58-
3.14.0rc1
56+
3.10.17,
57+
3.14.0,
5958
]
6059

6160
env:

‎README.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ Dependency versions:
178178

179179

180180
+----------+------------------------+
181-
| CPython | >= 3.9 (Or use PyPy3) |
181+
| CPython | >= 3.10 (Or use PyPy3) |
182182
+----------+------------------------+
183183
| SDL | >= 2.0.14 |
184184
+----------+------------------------+

‎buildconfig/stubs/pygame/_debug.pyi‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
from collections.abc import Callable
2-
from typing import Optional, Union
32

4-
ImportResult = tuple[str, bool, Optional[Callable]]
5-
6-
def str_from_tuple(version_tuple: Union[tuple[int, int, int], None]) -> str: ...
3+
def str_from_tuple(version_tuple: tuple[int, int, int] | None) -> str: ...
74
def attempt_import(
85
module: str, function_name: str, output_str: str = ""
9-
) -> ImportResult: ...
10-
def print_debug_info(filename: Optional[str] = None) -> None: ...
6+
) -> tuple[str, bool, Callable|None]: ...
7+
def print_debug_info(filename: str|None = None) -> None: ...

‎buildconfig/stubs/pygame/_render.pyi‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Iterable
2-
from typing import Any, Optional, Protocol, Union, final
2+
from typing import Any, Protocol, final
33

44
from pygame.color import Color
55
from pygame.rect import Rect
@@ -9,9 +9,7 @@ from pygame.window import Window
99

1010
class _DrawableClass(Protocol):
1111
# Object that has the draw method that accepts area and dest arguments
12-
def draw(
13-
self, area: Optional[RectLike] = None, dest: Optional[RectLike] = None
14-
): ...
12+
def draw(self, area: RectLike | None = None, dest: RectLike | None = None): ...
1513

1614
@final
1715
class Renderer:
@@ -25,9 +23,9 @@ class Renderer:
2523
) -> None: ...
2624
def blit(
2725
self,
28-
source: Union["Texture", "Image", _DrawableClass],
29-
dest: Optional[RectLike] = None,
30-
area: Optional[RectLike] = None,
26+
source: "Texture"|"Image"|_DrawableClass,
27+
dest: RectLike|None = None,
28+
area: RectLike|None = None,
3129
special_flags: int = 0,
3230
) -> Rect: ...
3331
def clear(self) -> None: ...
@@ -43,9 +41,9 @@ class Renderer:
4341
def coordinates_to_window(self, point: Point) -> tuple[float, float]: ...
4442
def coordinates_from_window(self, point: Point) -> tuple[float, float]: ...
4543
def present(self) -> None: ...
46-
def set_viewport(self, area: Optional[RectLike]) -> None: ...
44+
def set_viewport(self, area: RectLike|None) -> None: ...
4745
def to_surface(
48-
self, surface: Optional[Surface] = None, area: Optional[RectLike] = None
46+
self, surface: Surface|None= None, area: RectLike|None = None
4947
) -> Surface: ...
5048
@property
5149
def draw_blend_mode(self) -> int: ...
@@ -84,7 +82,7 @@ class Texture:
8482
static: bool = False,
8583
streaming: bool = False,
8684
target: bool = False,
87-
scale_quality: Optional[int] = None,
85+
scale_quality: int|None = None,
8886
) -> None: ...
8987
@property
9088
def alpha(self) -> int: ...
@@ -108,10 +106,10 @@ class Texture:
108106
def from_surface(cls, renderer: Renderer, surface: Surface) -> Texture: ...
109107
def draw(
110108
self,
111-
srcrect: Optional[RectLike] = None,
112-
dstrect: Optional[RectLike] = None,
109+
srcrect: RectLike|None = None,
110+
dstrect: RectLike|None = None,
113111
angle: float = 0.0,
114-
origin: Optional[Iterable[int]] = None,
112+
origin: Iterable[int]|None = None,
115113
flip_x: bool = False,
116114
flip_y: bool = False,
117115
) -> None: ...
@@ -143,7 +141,7 @@ class Texture:
143141
p4_mod: ColorLike = (255, 255, 255, 255),
144142
) -> None: ...
145143
def get_rect(self, **kwargs: Any) -> Rect: ...
146-
def update(self, surface: Surface, area: Optional[RectLike] = None) -> None: ...
144+
def update(self, surface: Surface, area: RectLike|None = None) -> None: ...
147145

148146
@final
149147
class Image:

‎buildconfig/stubs/pygame/_sdl2/controller_old.pyi‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from collections.abc import Mapping
2-
from typing import Optional
32

43
from pygame.joystick import JoystickType
54

@@ -11,7 +10,7 @@ def get_eventstate() -> bool: ...
1110
def update() -> None: ...
1211
def get_count() -> int: ...
1312
def is_controller(index: int) -> bool: ...
14-
def name_forindex(index: int) -> Optional[str]: ...
13+
def name_forindex(index: int) -> str|None: ...
1514

1615
class Controller:
1716
def __init__(self, index: int) -> None: ...

‎buildconfig/stubs/pygame/_sdl2/sdl2.pyi‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from typing import Optional
2-
31
INIT_TIMER: int
42
INIT_AUDIO: int
53
INIT_VIDEO: int
@@ -11,6 +9,6 @@ INIT_NOPARACHUTE: int
119
INIT_EVERYTHING: int
1210

1311
class error(RuntimeError):
14-
def __init__(self, message: Optional[str] = None) -> None: ...
12+
def __init__(self, message: str|None = None) -> None: ...
1513

1614
def init_subsystem(flags: int) -> None: ...

‎buildconfig/stubs/pygame/_sdl2/touch.pyi‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Optional, TypedDict
1+
from typing import TypedDict
22

33
class _FingerDict(TypedDict):
44
id: int
@@ -9,4 +9,4 @@ class _FingerDict(TypedDict):
99
def get_num_devices() -> int: ...
1010
def get_device(index: int, /) -> int: ...
1111
def get_num_fingers(device_id: int, /) -> int: ...
12-
def get_finger(touchid: int, index: int) -> Optional[_FingerDict]: ...
12+
def get_finger(touchid: int, index: int) -> _FingerDict|None: ...

‎buildconfig/stubs/pygame/_sdl2/video.pyi‎

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Generator, Iterable
2-
from typing import Any, Optional, Union
2+
from typing import Any
33

44
from pygame.color import Color
55
from pygame.rect import Rect
@@ -26,11 +26,11 @@ class RendererDriverInfo:
2626
max_texture_height: int
2727

2828
def get_drivers() -> Generator[RendererDriverInfo, None, None]: ...
29-
def get_grabbed_window() -> Optional[Window]: ...
29+
def get_grabbed_window() -> Window|None: ...
3030
def messagebox(
3131
title: str,
3232
message: str,
33-
window: Optional[Window] = None,
33+
window: Window|None = None,
3434
info: bool = False,
3535
warn: bool = False,
3636
error: bool = False,
@@ -48,7 +48,7 @@ class Texture:
4848
static: bool = False,
4949
streaming: bool = False,
5050
target: bool = False,
51-
scale_quality: Optional[int] = None,
51+
scale_quality: int|None = None,
5252
) -> None: ...
5353
@staticmethod
5454
def from_surface(renderer: Renderer, surface: Surface) -> Texture: ...
@@ -65,10 +65,10 @@ class Texture:
6565
def get_rect(self, **kwargs: Any) -> Rect: ...
6666
def draw(
6767
self,
68-
srcrect: Optional[RectLike] = None,
69-
dstrect: Optional[RectLike] = None,
68+
srcrect: RectLike|None = None,
69+
dstrect: RectLike|None = None,
7070
angle: float = 0.0,
71-
origin: Optional[Iterable[int]] = None,
71+
origin: Iterable[int]|None = None,
7272
flip_x: bool = False,
7373
flip_y: bool = False,
7474
) -> None: ...
@@ -99,20 +99,20 @@ class Texture:
9999
p3_mod: Iterable[int] = (255, 255, 255, 255),
100100
p4_mod: Iterable[int] = (255, 255, 255, 255),
101101
) -> None: ...
102-
def update(self, surface: Surface, area: Optional[RectLike] = None) -> None: ...
102+
def update(self, surface: Surface, area: RectLike|None = None) -> None: ...
103103

104104
class Image:
105105
def __init__(
106106
self,
107-
texture_or_image: Union[Texture, Image],
108-
srcrect: Optional[RectLike] = None,
107+
texture_or_image: Texture|Image,
108+
srcrect: RectLike|None = None,
109109
) -> None: ...
110110
def get_rect(self) -> Rect: ...
111111
def draw(
112-
self, srcrect: Optional[RectLike] = None, dstrect: Optional[RectLike] = None
112+
self, srcrect: RectLike|None= None, dstrect: RectLike|None = None
113113
) -> None: ...
114114
angle: float
115-
origin: Optional[Iterable[float]]
115+
origin: Iterable[float]|None
116116
flip_x: bool
117117
flip_y: bool
118118
alpha: float
@@ -144,17 +144,17 @@ class Renderer:
144144
def clear(self) -> None: ...
145145
def present(self) -> None: ...
146146
def get_viewport(self) -> Rect: ...
147-
def set_viewport(self, area: Optional[RectLike]) -> None: ...
147+
def set_viewport(self, area: RectLike|None) -> None: ...
148148
logical_size: Iterable[int]
149149
def coordinates_to_window(self, point: Point) -> tuple[float, float]: ...
150150
def coordinates_from_window(self, point: Point) -> tuple[float, float]: ...
151151
scale: Iterable[float]
152-
target: Optional[Texture]
152+
target: Texture|None
153153
def blit(
154154
self,
155-
source: Union[Texture, Image],
156-
dest: Optional[RectLike] = None,
157-
area: Optional[RectLike] = None,
155+
source: Texture|Image,
156+
dest: RectLike|None = None,
157+
area: RectLike|None = None,
158158
special_flags: int = 0,
159159
) -> Rect: ...
160160
def draw_line(self, p1: Point, p2: Point) -> None: ...
@@ -166,7 +166,7 @@ class Renderer:
166166
def draw_quad(self, p1: Point, p2: Point, p3: Point, p4: Point) -> None: ...
167167
def fill_quad(self, p1: Point, p2: Point, p3: Point, p4: Point) -> None: ...
168168
def to_surface(
169-
self, surface: Optional[Surface] = None, area: Optional[RectLike] = None
169+
self, surface: Surface|None= None, area: RectLike|None = None
170170
) -> Surface: ...
171171
@staticmethod
172172
def compose_custom_blend_mode(

‎buildconfig/stubs/pygame/camera.pyi‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from abc import ABC, abstractmethod
2-
from typing import Literal, Optional, Union
2+
from typing import Literal
33

44
from pygame.surface import Surface
55
from pygame.typing import IntPoint
66

77
def get_backends() -> list[str]: ...
8-
def init(backend: Optional[str] = None) -> None: ...
8+
def init(backend: str|None = None) -> None: ...
99
def quit() -> None: ...
1010
def list_cameras() -> list[str]: ...
1111
def colorspace(
@@ -24,7 +24,7 @@ class AbstractCamera(ABC):
2424
@abstractmethod
2525
def query_image(self) -> bool: ...
2626
@abstractmethod
27-
def get_image(self, dest_surf: Optional[Surface] = None) -> Surface: ...
27+
def get_image(self, dest_surf: Surface|None = None) -> Surface: ...
2828
@abstractmethod
2929
def get_raw(self) -> bytes: ...
3030
# set_controls and get_controls are not a part of the AbstractCamera ABC,
@@ -34,7 +34,7 @@ class AbstractCamera(ABC):
3434
class Camera(AbstractCamera):
3535
def __init__(
3636
self,
37-
device: Union[str, int] = 0,
37+
device: str|int = 0,
3838
size: IntPoint = (640, 480),
3939
format: str = "RGB",
4040
) -> None: ...
@@ -49,5 +49,5 @@ class Camera(AbstractCamera):
4949
) -> tuple[bool, bool, int]: ...
5050
def get_size(self) -> tuple[int, int]: ...
5151
def query_image(self) -> bool: ...
52-
def get_image(self, surface: Optional[Surface] = None) -> Surface: ...
52+
def get_image(self, surface: Surface|None = None) -> Surface: ...
5353
def get_raw(self) -> bytes: ...

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /