Skip to content

Commit 471703a

Browse files
authored
Merge branch 'main' into matiiss-allow-sprite-group-subscripts
2 parents 0387037 + 2b195a7 commit 471703a

Some content is hidden

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

62 files changed

+309
-339
lines changed

.github/workflows/build-sdl3.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ jobs:
5656

5757
- name: Install pygame deps (linux)
5858
if: matrix.os == 'ubuntu-24.04'
59-
run: sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev
59+
run: |
60+
sudo apt-get update --fix-missing
61+
sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev
6062
6163
- name: Install pygame deps (mac)
6264
if: matrix.os == 'macos-14'

README.rst

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

140140

141141
+----------+------------------------+
142-
| CPython | >= 3.8 (Or use PyPy3) |
142+
| CPython | >= 3.9 (Or use PyPy3) |
143143
+----------+------------------------+
144144
| SDL | >= 2.0.14 |
145145
+----------+------------------------+
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
from typing import Tuple, Union, Optional, Callable
1+
from collections.abc import Callable
2+
from typing import Union, Optional
23

3-
ImportResult = Tuple[str, bool, Optional[Callable]]
4+
ImportResult = tuple[str, bool, Optional[Callable]]
45

5-
def str_from_tuple(version_tuple: Union[Tuple[int, int, int], None]) -> str: ...
6+
def str_from_tuple(version_tuple: Union[tuple[int, int, int], None]) -> str: ...
67
def attempt_import(module: str, function_name: str, output_str: str = "") -> ImportResult: ...
78
def print_debug_info(filename: Optional[str] = None) -> None: ...

buildconfig/stubs/pygame/_sdl2/audio.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Callable, List
1+
from collections.abc import Callable
22

33
AUDIO_U8: int
44
AUDIO_S8: int
@@ -20,7 +20,7 @@ AUDIO_ALLOW_FORMAT_CHANGE: int
2020
AUDIO_ALLOW_CHANNELS_CHANGE: int
2121
AUDIO_ALLOW_ANY_CHANGE: int
2222

23-
def get_audio_device_names(iscapture: bool = False) -> List[str]: ...
23+
def get_audio_device_names(iscapture: bool = False) -> list[str]: ...
2424

2525
class AudioDevice:
2626
def __init__(

buildconfig/stubs/pygame/_sdl2/controller_old.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Dict, Mapping, Optional
1+
from collections.abc import Mapping
2+
from typing import Optional
23

34
from pygame.joystick import JoystickType
45

@@ -27,7 +28,7 @@ class Controller:
2728
def as_joystick(self) -> JoystickType: ...
2829
def get_axis(self, axis: int) -> int: ...
2930
def get_button(self, button: int) -> bool: ...
30-
def get_mapping(self) -> Dict[str, str]: ...
31+
def get_mapping(self) -> dict[str, str]: ...
3132
def set_mapping(self, mapping: Mapping[str, str]) -> int: ...
3233
def rumble(
3334
self, low_frequency: float, high_frequency: float, duration: int
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from typing import Dict, Union
1+
from typing import Union
22

33
def get_num_devices() -> int: ...
44
def get_device(index: int) -> int: ...
55
def get_num_fingers(device_id: int) -> int: ...
6-
def get_finger(touchid: int, index: int) -> Dict[str, Union[int, float]]: ...
6+
def get_finger(touchid: int, index: int) -> dict[str, Union[int, float]]: ...

buildconfig/stubs/pygame/_sdl2/video.pyi

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

34
from pygame.color import Color
45
from pygame.rect import Rect
@@ -34,7 +35,7 @@ def messagebox(
3435
info: bool = False,
3536
warn: bool = False,
3637
error: bool = False,
37-
buttons: Tuple[str, ...] = ("OK",),
38+
buttons: tuple[str, ...] = ("OK",),
3839
return_button: int = 0,
3940
escape_button: int = 0,
4041
) -> int: ...
@@ -47,7 +48,7 @@ class Texture:
4748
static: bool = False,
4849
streaming: bool = False,
4950
target: bool = False,
50-
scale_quality: Optional[int] =None
51+
scale_quality: Optional[int] = None,
5152
) -> None: ...
5253
@staticmethod
5354
def from_surface(renderer: Renderer, surface: Surface) -> Texture: ...
@@ -61,7 +62,6 @@ class Texture:
6162
def color(self) -> Color: ...
6263
@color.setter
6364
def color(self, value: ColorLike) -> None: ...
64-
6565
def get_rect(self, **kwargs: Any) -> Rect: ...
6666
def draw(
6767
self,
@@ -176,5 +176,5 @@ class Renderer:
176176
) -> Surface: ...
177177
@staticmethod
178178
def compose_custom_blend_mode(
179-
color_mode: Tuple[int, int, int], alpha_mode: Tuple[int, int, int]
179+
color_mode: tuple[int, int, int], alpha_mode: tuple[int, int, int]
180180
) -> int: ...

buildconfig/stubs/pygame/base.pyi

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import Any, Tuple, Callable
1+
from collections.abc import Callable
2+
from typing import Any
23

34
__version__: str
45

@@ -8,12 +9,12 @@ class BufferError(Exception): ...
89
# Always defined
910
HAVE_NEWBUF: int = 1
1011

11-
def init() -> Tuple[int, int]: ...
12+
def init() -> tuple[int, int]: ...
1213
def quit() -> None: ...
1314
def get_init() -> bool: ...
1415
def get_error() -> str: ...
1516
def set_error(error_msg: str, /) -> None: ...
16-
def get_sdl_version(linked: bool = True) -> Tuple[int, int, int]: ...
17+
def get_sdl_version(linked: bool = True) -> tuple[int, int, int]: ...
1718
def get_sdl_byteorder() -> int: ...
1819
def register_quit(callable: Callable[[], Any], /) -> None: ...
1920

buildconfig/stubs/pygame/bufferproxy.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from typing import Any, Dict, overload
1+
from typing import Any, overload
22

33
class BufferProxy:
44
parent: Any
55
length: int
66
raw: bytes
77
# possibly going to be deprecated/removed soon, in which case these
88
# typestubs must be removed too
9-
__array_interface__: Dict[str, Any]
9+
__array_interface__: dict[str, Any]
1010
__array_struct__: Any
1111
@overload
1212
def __init__(self) -> None: ...

buildconfig/stubs/pygame/camera.pyi

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

44
from pygame.typing import IntPoint
55

66
from pygame.surface import Surface
77

8-
def get_backends() -> List[str]: ...
8+
def get_backends() -> list[str]: ...
99
def init(backend: Optional[str] = None) -> None: ...
1010
def quit() -> None: ...
11-
def list_cameras() -> List[str]: ...
11+
def list_cameras() -> list[str]: ...
1212
def colorspace(
1313
surface: Surface, color: Literal["YUV", "HSV"], dest_surface: Surface = ..., /
1414
) -> Surface: ...
@@ -21,7 +21,7 @@ class AbstractCamera(ABC):
2121
@abstractmethod
2222
def stop(self) -> None: ...
2323
@abstractmethod
24-
def get_size(self) -> Tuple[int, int]: ...
24+
def get_size(self) -> tuple[int, int]: ...
2525
@abstractmethod
2626
def query_image(self) -> bool: ...
2727
@abstractmethod
@@ -41,14 +41,14 @@ class Camera(AbstractCamera):
4141
) -> None: ...
4242
def start(self) -> None: ...
4343
def stop(self) -> None: ...
44-
def get_controls(self) -> Tuple[bool, bool, int]: ...
44+
def get_controls(self) -> tuple[bool, bool, int]: ...
4545
def set_controls(
4646
self,
4747
hflip: bool = ...,
4848
vflip: bool = ...,
4949
brightness: int = ...,
50-
) -> Tuple[bool, bool, int]: ...
51-
def get_size(self) -> Tuple[int, int]: ...
50+
) -> tuple[bool, bool, int]: ...
51+
def get_size(self) -> tuple[int, int]: ...
5252
def query_image(self) -> bool: ...
5353
def get_image(self, surface: Optional[Surface] = None) -> Surface: ...
5454
def get_raw(self) -> bytes: ...

0 commit comments

Comments
 (0)