Skip to content

Commit d9c1c0e

Browse files
authored
Merge branch 'main' into docs-to-stubs
2 parents 2c36fc9 + 71d8b23 commit d9c1c0e

36 files changed

+429
-108
lines changed

.github/workflows/build-macos.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151

5252
- name: Test for Mac Deps cache hit
5353
id: macdep-cache
54-
uses: actions/cache@v4.1.2
54+
uses: actions/cache@v4.2.0
5555
with:
5656
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
5757
# The hash of all files in buildconfig manylinux-build and macdependencies is
@@ -118,14 +118,14 @@ jobs:
118118
- uses: actions/[email protected]
119119

120120
- name: pip cache
121-
uses: actions/cache@v4.1.2
121+
uses: actions/cache@v4.2.0
122122
with:
123123
path: ~/Library/Caches/pip # This cache path is only right on mac
124124
key: pip-cache-${{ matrix.macarch }}-${{ matrix.os }}
125125

126126
- name: Fetch Mac deps
127127
id: macdep-cache
128-
uses: actions/cache@v4.1.2
128+
uses: actions/cache@v4.2.0
129129
with:
130130
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
131131
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}

.github/workflows/build-sdl3.yml

+11
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ jobs:
8686
cmake --build . --config Release --parallel
8787
sudo cmake --install . --config Release
8888
89+
- name: Install SDL3_image
90+
if: matrix.os != 'windows-latest'
91+
run: |
92+
git clone https://github.com/libsdl-org/SDL_image
93+
cd SDL_image
94+
mkdir build
95+
cd build
96+
cmake -DCMAKE_BUILD_TYPE=Release ..
97+
cmake --build . --config Release --parallel
98+
sudo cmake --install . --config Release
99+
89100
- name: Build with SDL3
90101
run: python3 dev.py build --sdl3
91102

.github/workflows/build-ubuntu-sdist.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484

8585
- name: Test typestubs
8686
run: |
87-
pip3 install mypy
87+
pip3 install mypy==1.13.0
8888
python3 buildconfig/stubs/stubcheck.py
8989
9090
# We upload the generated files under github actions assets

.github/workflows/release-gh-draft.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: echo "VER=${GITHUB_REF_NAME#'release/'}" >> $GITHUB_OUTPUT
6262

6363
- name: Generate release attestation
64-
uses: actions/attest-build-provenance@v1.4.4
64+
uses: actions/attest-build-provenance@v2.1.0
6565
with:
6666
subject-path: "pygame-wheels/*"
6767

buildconfig/download_win_prebuilt.py

+24-8
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,20 @@ def get_urls(x86=True, x64=True):
7878
url_sha1 = []
7979
url_sha1.extend([
8080
[
81-
'https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-devel-2.30.9-VC.zip',
82-
'd89a2ad46b98ba08db5ec5877cb2fde46e127825',
81+
'https://github.com/libsdl-org/SDL/releases/download/release-2.30.10/SDL2-devel-2.30.10-VC.zip',
82+
'42378fd090d547d03dca8c9df584ba8f38555809',
8383
],
8484
[
8585
'https://github.com/libsdl-org/SDL/releases/download/preview-3.1.6/SDL3-devel-3.1.6-VC.zip',
8686
'7a3b9ed85cfe735c7e106d98c4b6395a113e5d7e'
8787
],
8888
[
89-
'https://github.com/pygame-community/SDL_image/releases/download/2.8.2-pgce/SDL2_image-devel-2.8.2-VCpgce.zip',
90-
'983484dd816abf25cdd5bce88ac69dbca1ea713a'
89+
'https://github.com/pygame-community/SDL_image/releases/download/2.8.3-pgce/SDL2_image-devel-2.8.3-VCpgce.zip',
90+
'71ad2b5aacbc934a39e390ad733421313dd5d059'
91+
],
92+
[
93+
'https://github.com/libsdl-org/SDL_image/releases/download/preview-3.1.0/SDL3_image-devel-3.1.0-VC.zip',
94+
'8538fea0cc4aabba2fc64db06196f1bb76a2785f'
9195
],
9296
[
9397
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-devel-2.22.0-VC.zip',
@@ -205,14 +209,26 @@ def copy(src, dst):
205209
copy(
206210
os.path.join(
207211
temp_dir,
208-
'SDL2_image-devel-2.8.2-VCpgce/SDL2_image-2.8.2'
212+
'SDL2_image-devel-2.8.3-VCpgce/SDL2_image-2.8.3'
213+
),
214+
os.path.join(
215+
move_to_dir,
216+
prebuilt_dir,
217+
'SDL2_image-2.8.3'
218+
)
219+
)
220+
copy(
221+
os.path.join(
222+
temp_dir,
223+
'SDL3_image-devel-3.1.0-VC/SDL3_image-3.1.0'
209224
),
210225
os.path.join(
211226
move_to_dir,
212227
prebuilt_dir,
213-
'SDL2_image-2.8.2'
228+
'SDL3_image-3.1.0'
214229
)
215230
)
231+
216232
copy(
217233
os.path.join(
218234
temp_dir,
@@ -238,12 +254,12 @@ def copy(src, dst):
238254
copy(
239255
os.path.join(
240256
temp_dir,
241-
'SDL2-devel-2.30.9-VC/SDL2-2.30.9'
257+
'SDL2-devel-2.30.10-VC/SDL2-2.30.10'
242258
),
243259
os.path.join(
244260
move_to_dir,
245261
prebuilt_dir,
246-
'SDL2-2.30.9'
262+
'SDL2-2.30.10'
247263
)
248264
)
249265
copy(

buildconfig/manylinux-build/docker_base/sdl_libs/build-sdl2-libs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ set -e -x
33

44
cd $(dirname `readlink -f "$0"`)
55

6-
SDL2_VER="2.30.9"
6+
SDL2_VER="2.30.10"
77
SDL2="SDL2-$SDL2_VER"
8-
IMG2_VER="2.8.2"
8+
IMG2_VER="2.8.3"
99
IMG2="SDL2_image-$IMG2_VER"
1010
TTF2_VER="2.22.0"
1111
TTF2="SDL2_ttf-$TTF2_VER"
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
30dfa86fcced174fef0ed78ffa53476a31765e19cdcdf8233ab92876445b4dedaa758fc42a3ec332324d13faa2daafcadcc44fc0f536a2969ef836162ec3cd36 SDL2-2.30.9.tar.gz
2-
0ff345824f95158dfa72f83f9d4a540601c178cd759334bf849c14a2920b5330d0763413b58c08b3deba8d3a4ccb6ea2a8159f87efe4cbb0e8ea850f63d09454 SDL2_image-2.8.2.tar.gz
1+
bcb220749cd3b0874288d617419e622701138bcb8fe55e9b665e8843c65afda031d01afe0d11e308a9608724ed151f342e5f5670c84204b36943cb323ced41da SDL2-2.30.10.tar.gz
2+
b49e466494a4bebcacc09e3fe2afbe5edbae636c007cd26e7e04301bf8fe54db6751258b750a79656e5aa261869900d39703f1311df4c63ef415ae443f62295f SDL2_image-2.8.3.tar.gz
33
5ddbc4b0b5fad2e0844a503daa79564b912654192599ef8fa7698531f08323ce01801f6bb17b2b3905020a3df362a967b7566ae725eb085da991578cc0807aad SDL2_mixer-2.8.0.tar.gz
44
34a1d210d8f1b1e802139d65ba47e36033bb7881e75a8862c1b1c515565bef85e3d81ee42e952aa664de043debef387ba60088a9cf3ba3297413db39a13af912 SDL2_ttf-2.22.0.tar.gz

buildconfig/stubs/pygame/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ from .constants import (
111111
BLENDMODE_ADD as BLENDMODE_ADD,
112112
BLENDMODE_BLEND as BLENDMODE_BLEND,
113113
BLENDMODE_MOD as BLENDMODE_MOD,
114+
BLENDMODE_MUL as BLENDMODE_MUL,
114115
BLENDMODE_NONE as BLENDMODE_NONE,
115116
BLEND_ADD as BLEND_ADD,
116117
BLEND_ALPHA_SDL2 as BLEND_ALPHA_SDL2,

buildconfig/stubs/pygame/constants.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ BIG_ENDIAN: int
3434
BLENDMODE_ADD: int
3535
BLENDMODE_BLEND: int
3636
BLENDMODE_MOD: int
37+
BLENDMODE_MUL: int
3738
BLENDMODE_NONE: int
3839
BLEND_ADD: int
3940
BLEND_ALPHA_SDL2: int

buildconfig/stubs/pygame/display.pyi

+5-3
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ def set_mode(
4444
display: int = 0,
4545
vsync: int = 0,
4646
) -> Surface: ...
47-
def get_surface() -> Surface: ...
47+
def get_surface() -> Optional[Surface]: ...
4848
def flip() -> None: ...
4949
@overload
50+
def update() -> None: ...
51+
@overload
5052
def update(
51-
rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]] = None, /
53+
rectangle: Optional[Union[RectLike, Iterable[Optional[RectLike]]]], /
5254
) -> None: ...
5355
@overload
54-
def update(x: int, y: int, w: int, h: int, /) -> None: ...
56+
def update(x: float, y: float, w: float, h: float, /) -> None: ...
5557
@overload
5658
def update(xy: Point, wh: Point, /) -> None: ...
5759
def get_driver() -> str: ...

buildconfig/stubs/pygame/locals.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ BIG_ENDIAN: int
3434
BLENDMODE_ADD: int
3535
BLENDMODE_BLEND: int
3636
BLENDMODE_MOD: int
37+
BLENDMODE_MUL: int
3738
BLENDMODE_NONE: int
3839
BLEND_ADD: int
3940
BLEND_ALPHA_SDL2: int

buildconfig/stubs/stubcheck.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def stubs_check():
4949
continue
5050

5151
cmd = " ".join(stubtest)
52-
print(f"Using stubtest invokation: `{cmd}` (version: {version})")
52+
print(f"Using stubtest invocation: `{cmd}` (version: {version})")
5353
prev_dir = os.getcwd()
5454
try:
5555
os.chdir(STUBS_BASE_DIR)

dev.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
SDL3_ARGS = [
2828
"-Csetup-args=-Dsdl_api=3",
29-
"-Csetup-args=-Dimage=disabled",
3029
"-Csetup-args=-Dmixer=disabled",
3130
"-Csetup-args=-Dfont=disabled",
3231
]

docs/reST/ref/display.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ required).
251251

252252
| :sl:`Get a reference to the currently set display surface`
253253
| :sg:`get_surface() -> Surface`
254+
| :sg:`get_surface() -> None`
254255
255256
Return a reference to the currently set display Surface. If no display mode
256257
has been set this will return None.
@@ -272,7 +273,10 @@ required).
272273
.. function:: update
273274

274275
| :sl:`Update all, or a portion, of the display. For non-OpenGL displays.`
275-
| :sg:`update(rectangle=None, /) -> None`
276+
| :sg:`update() -> None`
277+
| :sg:`update(rectangle, /) -> None`
278+
| :sg:`update(x, y, w, h, /) -> None`
279+
| :sg:`update((x, y), (w, h), /) -> None`
276280
| :sg:`update(rectangle_iterable, /) -> None`
277281
278282
For non OpenGL display Surfaces, this function is very similar to

docs/reST/ref/draw.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
492492

493493
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
494494
.. versionchanged:: 2.4.0 Removed deprecated 'blend' argument
495-
.. versionchanged:: 2.5.0 ``blend`` argument readded for backcompat, but will always raise a deprecation exception when used
495+
.. versionchanged:: 2.5.0 ``blend`` argument re-added for backcompat, but will always raise a deprecation exception when used
496496
.. versionchanged:: 2.5.3 Added line width
497497

498498
.. ## pygame.draw.aaline ##
@@ -533,7 +533,7 @@ object around the draw calls (see :func:`pygame.Surface.lock` and
533533

534534
.. versionchangedold:: 2.0.0 Added support for keyword arguments.
535535
.. versionchanged:: 2.4.0 Removed deprecated ``blend`` argument
536-
.. versionchanged:: 2.5.0 ``blend`` argument readded for backcompat, but will always raise a deprecation exception when used
536+
.. versionchanged:: 2.5.0 ``blend`` argument re-added for backcompat, but will always raise a deprecation exception when used
537537

538538
.. ## pygame.draw.aalines ##
539539

docs/reST/ref/image.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ following formats.
245245

246246
.. note:: The use of this function is recommended over :func:`tostring` as of pygame 2.1.3.
247247
This function was introduced so it matches nicely with other
248-
libraries (PIL, numpy, etc), and with people's expectations.
248+
libraries (PIL, NumPy, etc), and with people's expectations.
249249

250250
.. versionadded:: 2.1.3
251251
.. versionchanged:: 2.2.0 Now supports keyword arguments.
@@ -290,7 +290,7 @@ following formats.
290290

291291
.. note:: The use of this function is recommended over :func:`fromstring` as of pygame 2.1.3.
292292
This function was introduced so it matches nicely with other
293-
libraries (PIL, numpy, etc), and with people's expectations.
293+
libraries (PIL, NumPy, etc), and with people's expectations.
294294

295295
.. versionadded:: 2.1.3
296296
.. versionadded:: 2.1.4 Added a 'pitch' argument and support for keyword arguments.

docs/reST/ref/mixer.rst

+5-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
| :sl:`pygame module for loading and playing sounds`
1010
1111
This module contains classes for loading Sound objects and controlling
12-
playback. The mixer module is optional and depends on SDL_mixer. Your program
13-
should test that :mod:`pygame.mixer` is available and initialized before using
14-
it.
12+
playback.
1513

1614
The mixer module has a limited number of channels for playback of sounds.
1715
Usually programs tell pygame to start playing audio and it selects an available
@@ -30,9 +28,7 @@ streams the music from the files without loading music at once into memory.
3028

3129
The mixer module must be initialized like other pygame modules, but it has some
3230
extra conditions. The ``pygame.mixer.init()`` function takes several optional
33-
arguments to control the playback rate and sample size. Pygame will default to
34-
reasonable values, but pygame cannot perform Sound resampling, so the mixer
35-
should be initialized to match the values of your audio resources.
31+
arguments to control the playback rate and sample size.
3632

3733
``NOTE``: For less laggy sound use a smaller buffer size. The default
3834
is set to reduce the chance of scratchy sounds on some computers. You can
@@ -91,7 +87,7 @@ The following file formats are supported
9187
the next nearest power of 2).
9288

9389
The devicename parameter is the name of sound device to open for audio
94-
playback. Allowed device names will vary based on the host system.
90+
playback. Allowed device names will vary based on the host system.
9591
If left as ``None`` then a sensible default will be chosen for you.
9692

9793
Some platforms require the :mod:`pygame.mixer` module to be initialized
@@ -331,7 +327,7 @@ The following file formats are supported
331327
:rtype: tuple
332328

333329
.. note::
334-
The linked and compile version numbers should be the same.
330+
The linked and compiled version numbers should be the same.
335331

336332
.. versionaddedold:: 2.0.0
337333

@@ -368,7 +364,7 @@ The following file formats are supported
368364
it and the Sound object.
369365

370366
For now buffer and array support is consistent with ``sndarray.make_sound``
371-
for Numeric arrays, in that sample sign and byte order are ignored. This
367+
for NumPy arrays, in that sample sign and byte order are ignored. This
372368
will change, either by correctly handling sign and byte order, or by raising
373369
an exception when different. Also, source samples are truncated to fit the
374370
audio sample size. This will not change.

docs/reST/ref/sndarray.rst

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ one.
6262
DEPRECATED: Uses the requested array type for the module functions. The
6363
only supported arraytype is ``'numpy'``. Other values will raise ValueError.
6464
Using this function will raise a ``DeprecationWarning``.
65+
6566
.. ## pygame.sndarray.use_arraytype ##
6667
6768
.. function:: get_arraytype

docs/reST/ref/surface.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@
205205
object and dest is its destination position on this Surface. It draws each source Surface
206206
fully (meaning that unlike `blit()` you cannot pass an "area" parameter to represent
207207
a smaller portion of the source Surface to draw) on this Surface with the same blending
208-
mode specified by special_flags. The sequence must have at least one (source, dest) pair.
208+
mode specified by special_flags.
209209

210210
:param blit_sequence: a sequence of (source, dest)
211211
:param special_flags: the flag(s) representing the blend mode used for each surface.

docs/reST/ref/surfarray.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ specific pixel value of a color. Integer pixel values can only be used directly
3030
between surfaces with matching pixel layouts (see :class:`pygame.Surface`).
3131

3232
All functions that refer to "array" will copy the surface information to a new
33-
numpy array. All functions that refer to "pixels" will directly reference the
33+
NumPy array. All functions that refer to "pixels" will directly reference the
3434
pixels from the surface and any changes performed to the array will make changes
3535
in the surface. As this last functions share memory with the surface, this one
3636
will be locked during the lifetime of the array.

docs/reST/ref/window.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291

292292
.. attribute:: utility
293293

294-
| :sl:`Get if the windos is an utility window (**read-only**)`
294+
| :sl:`Get if the window is an utility window (**read-only**)`
295295
| :sg:`utility -> bool`
296296
297297
``True`` if the window doesn't appear in the task bar, ``False`` otherwise.

0 commit comments

Comments
 (0)