Skip to content

Commit 2d4f65f

Browse files
committed
Fix merge conflict and refcount with surface c_api object
2 parents e33b87a + 885b64f commit 2d4f65f

File tree

319 files changed

+5109
-3785
lines changed

Some content is hidden

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

319 files changed

+5109
-3785
lines changed

.github/workflows/build-debian-multiarch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- uses: actions/checkout@v4.2.2
6969

7070
- name: Build sources and run tests
71-
uses: uraimo/run-on-arch-action@v3.0.0
71+
uses: uraimo/run-on-arch-action@v3.0.1
7272
id: build
7373
with:
7474
arch: ${{ matrix.base_image && 'none' || matrix.arch }}
@@ -134,7 +134,7 @@ jobs:
134134
done
135135
136136
- name: Test armv7 wheel on armv6
137-
uses: uraimo/run-on-arch-action@v3.0.0
137+
uses: uraimo/run-on-arch-action@v3.0.1
138138
with:
139139
arch: armv6
140140
distro: bookworm

.github/workflows/build-macos.yml

Lines changed: 5 additions & 5 deletions
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.2.2
54+
uses: actions/cache@v4.2.3
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,26 +118,26 @@ jobs:
118118
- uses: actions/checkout@v4.2.2
119119

120120
- name: pip cache
121-
uses: actions/cache@v4.2.2
121+
uses: actions/cache@v4.2.3
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.2.2
128+
uses: actions/cache@v4.2.3
129129
with:
130130
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
131131
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
132132
fail-on-cache-miss: true
133133

134134
- name: Install uv for speed
135-
uses: astral-sh/setup-uv@v5
135+
uses: astral-sh/setup-uv@v6
136136
with:
137137
version: "0.5.26"
138138

139139
- name: Build and test wheels
140-
uses: pypa/cibuildwheel@v2.23.0
140+
uses: pypa/cibuildwheel@v2.23.2
141141

142142
- uses: actions/upload-artifact@v4
143143
with:

.github/workflows/build-manylinux.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v4.2.2
5656

5757
- name: Log in to the Container registry
58-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
58+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772
5959
with:
6060
registry: ghcr.io
6161
username: ${{ github.actor }}
@@ -75,7 +75,7 @@ jobs:
7575

7676
- name: Build and push Docker image
7777
if: steps.inspect.outcome == 'failure'
78-
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4
78+
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0
7979
with:
8080
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
8181
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
@@ -93,7 +93,7 @@ jobs:
9393
CIBW_MANYLINUX_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }}
9494
CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: ghcr.io/${{ github.repository }}_aarch64:${{ steps.meta.outputs.version }}
9595

96-
uses: pypa/cibuildwheel@v2.23.0
96+
uses: pypa/cibuildwheel@v2.23.2
9797

9898
# We upload the generated files under github actions assets
9999
- name: Upload dist

.github/workflows/build-ubuntu-debug-python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ jobs:
8484
8585
- name: Cache debug python build
8686
id: cache-python
87-
uses: actions/cache@v4.2.2
87+
uses: actions/cache@v4.2.3
8888
with:
8989
key: ${{ matrix.python }}
9090
path: ~/.pyenv/versions/${{ matrix.python }}-debug/**

.github/workflows/build-windows.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ jobs:
5757
arch: ${{ matrix.msvc-dev-arch }}
5858

5959
- name: Install uv for speed
60-
uses: astral-sh/setup-uv@v5
60+
uses: astral-sh/setup-uv@v6
6161
with:
6262
version: "0.5.26"
6363

6464
- name: Build and test wheels
65-
uses: pypa/cibuildwheel@v2.23.0
65+
uses: pypa/cibuildwheel@v2.23.2
6666

6767
- uses: actions/upload-artifact@v4
6868
with:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
run: echo "VER=${GITHUB_REF_NAME#'release/'}" >> $GITHUB_OUTPUT
4242

4343
- name: Generate release attestation
44-
uses: actions/attest-build-provenance@v2.2.0
44+
uses: actions/attest-build-provenance@v2.3.0
4545
with:
4646
subject-path: "pygame-wheels/*"
4747

.github/workflows/release-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4.2.2
1616

1717
- name: Pull all release assets
18-
uses: robinraju/release-downloader@v1.11
18+
uses: robinraju/release-downloader@v1.12
1919
with:
2020
releaseId: ${{ github.event.release.id }}
2121
fileName: "*"

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
# mypy
3333
.mypy_cache/
3434

35+
# Ruff
36+
.ruff_cache
37+
3538
# Other
3639
envdev*
3740
.virtualenv*
@@ -49,4 +52,5 @@ buildconfig/win_dll_dirs.json
4952
# cython generated files
5053
src_c/_sdl2/*.c
5154
!/src_c/_sdl2/touch.c
55+
!/src_c/_sdl2/controller.c
5256
src_c/pypm.c

.pre-commit-config.yaml

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

77
repos:
88
- repo: https://github.com/pre-commit/pre-commit-hooks
9-
rev: v4.6.0
9+
rev: v5.0.0
1010
hooks:
1111
- id: end-of-file-fixer
1212
exclude: |
@@ -26,13 +26,16 @@ repos:
2626
)$
2727
2828
- repo: https://github.com/astral-sh/ruff-pre-commit
29-
rev: v0.4.2
29+
rev: v0.11.5
3030
hooks: # See pyproject.toml for configuration options.
31+
- id: ruff
32+
name: ruff-sort-imports
33+
args: [ --select, I, --fix ]
3134
- id: ruff-format # Run the formatter
3235
types_or: [ python, pyi, jupyter ]
3336

3437
- repo: https://github.com/pre-commit/mirrors-clang-format
35-
rev: v18.1.4
38+
rev: v20.1.0
3639
hooks:
3740
- id: clang-format
3841
exclude: |

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ See docs/licenses for licenses of dependencies.
190190
.. |Python3| image:: https://img.shields.io/badge/python-3-blue.svg?v=1
191191

192192
.. |GithubCommits| image:: https://img.shields.io/github/commits-since/pygame-community/pygame-ce/2.5.2.svg
193-
:target: https://github.com/pygame-community/pygame-ce/compare/2.5.2...main
193+
:target: https://github.com/pygame-community/pygame-ce/compare/2.5.3...main
194194

195195
.. |DocsStatus| image:: https://img.shields.io/website?down_message=offline&label=docs&up_message=online&url=https%3A%2F%2Fpyga.me%2Fdocs%2F
196196
:target: https://pyga.me/docs/

buildconfig/download_win_prebuilt.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,28 @@ 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.32.2/SDL2-devel-2.32.2-VC.zip',
82-
'08737e7e813443e47b663be4d91f8a4d8de6916b',
81+
'https://github.com/libsdl-org/SDL/releases/download/release-2.32.6/SDL2-devel-2.32.6-VC.zip',
82+
'beab1beb38b0c5a4cc6ebd2d059431e1de631b35',
8383
],
8484
[
85-
'https://github.com/libsdl-org/SDL/releases/download/release-3.2.6/SDL3-devel-3.2.6-VC.zip',
86-
'a36424427129f9ae133e59cfe070fc0b418d7fe0'
85+
'https://github.com/libsdl-org/SDL/releases/download/release-3.2.10/SDL3-devel-3.2.10-VC.zip',
86+
'7a17d6fc7aa509c0c020e16ca10f82d6b5c2fc57'
8787
],
8888
[
89-
'https://github.com/pygame-community/SDL_image/releases/download/2.8.4-pgce/SDL2_image-devel-2.8.4-VCpgce.zip',
90-
'b9b4a5d44cab57901003255a1c1f98a42282762b'
89+
'https://github.com/pygame-community/SDL_image/releases/download/2.8.8-pgce/SDL2_image-devel-2.8.8-VCpgce.zip',
90+
'8cd149cbaae2d362f2eaa69483d992e79f4836f5'
9191
],
9292
[
93-
'https://github.com/libsdl-org/SDL_image/releases/download/release-3.2.0/SDL3_image-devel-3.2.0-VC.zip',
94-
'2aebab1f803edfb708622fa4e1afc0afadcf5c8b'
93+
'https://github.com/libsdl-org/SDL_image/releases/download/release-3.2.4/SDL3_image-devel-3.2.4-VC.zip',
94+
'd0db06c5dd2c7c6399e55332ff1dccd984914cb7'
9595
],
9696
[
9797
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.24.0/SDL2_ttf-devel-2.24.0-VC.zip',
9898
'2d18b9a4fc2ec0eee80de2a946b088d4e6efd0ee'
9999
],
100100
[
101-
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-3.2.0/SDL3_ttf-devel-3.2.0-VC.zip',
102-
'2883df767c9b8c910c10108242542ef36054a267'
101+
'https://github.com/libsdl-org/SDL_ttf/releases/download/release-3.2.2/SDL3_ttf-devel-3.2.2-VC.zip',
102+
'3786bc016d89ca4cf9739e4d342ca29e3e29c137'
103103
],
104104
[
105105
'https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.1/SDL2_mixer-devel-2.8.1-VC.zip',
@@ -213,23 +213,23 @@ def copy(src, dst):
213213
copy(
214214
os.path.join(
215215
temp_dir,
216-
'SDL2_image-devel-2.8.4-VCpgce/SDL2_image-2.8.4'
216+
'SDL2_image-devel-2.8.8-VCpgce/SDL2_image-2.8.8'
217217
),
218218
os.path.join(
219219
move_to_dir,
220220
prebuilt_dir,
221-
'SDL2_image-2.8.4'
221+
'SDL2_image-2.8.8'
222222
)
223223
)
224224
copy(
225225
os.path.join(
226226
temp_dir,
227-
'SDL3_image-devel-3.2.0-VC/SDL3_image-3.2.0'
227+
'SDL3_image-devel-3.2.4-VC/SDL3_image-3.2.4'
228228
),
229229
os.path.join(
230230
move_to_dir,
231231
prebuilt_dir,
232-
'SDL3_image-3.2.0'
232+
'SDL3_image-3.2.4'
233233
)
234234
)
235235

@@ -258,34 +258,34 @@ def copy(src, dst):
258258
copy(
259259
os.path.join(
260260
temp_dir,
261-
'SDL3_ttf-devel-3.2.0-VC/SDL3_ttf-3.2.0'
261+
'SDL3_ttf-devel-3.2.2-VC/SDL3_ttf-3.2.2'
262262
),
263263
os.path.join(
264264
move_to_dir,
265265
prebuilt_dir,
266-
'SDL3_ttf-3.2.0'
266+
'SDL3_ttf-3.2.2'
267267
)
268268
)
269269
copy(
270270
os.path.join(
271271
temp_dir,
272-
'SDL2-devel-2.32.2-VC/SDL2-2.32.2'
272+
'SDL2-devel-2.32.6-VC/SDL2-2.32.6'
273273
),
274274
os.path.join(
275275
move_to_dir,
276276
prebuilt_dir,
277-
'SDL2-2.32.2'
277+
'SDL2-2.32.6'
278278
)
279279
)
280280
copy(
281281
os.path.join(
282282
temp_dir,
283-
'SDL3-devel-3.2.6-VC/SDL3-3.2.6'
283+
'SDL3-devel-3.2.10-VC/SDL3-3.2.10'
284284
),
285285
os.path.join(
286286
move_to_dir,
287287
prebuilt_dir,
288-
'SDL3-3.2.6'
288+
'SDL3-3.2.10'
289289
)
290290
)
291291

buildconfig/manylinux-build/docker_base/Dockerfile-aarch64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pin version on image for CI stability
2-
FROM quay.io/pypa/manylinux2014_aarch64:2025.02.23-1
2+
FROM quay.io/pypa/manylinux2014_aarch64:2025.03.09-1
33
ENV MAKEFLAGS="-j 4"
44
ENV PG_DEP_PREFIX="/usr/local"
55

buildconfig/manylinux-build/docker_base/Dockerfile-i686

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pin version on image for CI stability
2-
FROM quay.io/pypa/manylinux2014_i686:2025.02.23-1
2+
FROM quay.io/pypa/manylinux2014_i686:2025.03.09-1
33
ENV MAKEFLAGS="-j 4"
44
ENV PG_DEP_PREFIX="/usr/local"
55

buildconfig/manylinux-build/docker_base/Dockerfile-x86_64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pin version on image for CI stability
2-
FROM quay.io/pypa/manylinux2014_x86_64:2025.02.23-1
2+
FROM quay.io/pypa/manylinux2014_x86_64:2025.03.09-1
33
ENV MAKEFLAGS="-j 4"
44
ENV PG_DEP_PREFIX="/usr/local"
55

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

Lines changed: 2 additions & 2 deletions
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.32.2"
6+
SDL2_VER="2.32.6"
77
SDL2="SDL2-$SDL2_VER"
8-
IMG2_VER="2.8.4"
8+
IMG2_VER="2.8.8"
99
IMG2="SDL2_image-$IMG2_VER"
1010
TTF2_VER="2.24.0"
1111
TTF2="SDL2_ttf-$TTF2_VER"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
9a608974a69b97fd5589bf8feed4742498f8f07731bcd5b99dd518089acda8b9b4216197b6adf7ca79ef1a9fe47c542033eefe94763e66229b1d9ba5207da5c5 SDL2-2.32.2.tar.gz
2-
a4b7436442be43b96dc7b90c9badd011da1622e283ae068b82367fcb72b7dd7a0357aec5550fe44103a77da75b8c570d5204fff11a805373f2194f92b8f71343 SDL2_image-2.8.4.tar.gz
1+
2dae8ae9f10e160a50f625daddad891d25e782130e5a5e3f02079d94ab8858aca92ab8871ab19fdf5be6aca83ffeb9c1ea03949841c2506066f12d2bf2332d47 SDL2-2.32.6.tar.gz
2+
5c521ae6a053e1eb6b42dce3ccccdbdb353eb7e9d1bd89392b1913bfc9fbb6b8a9d5506c80e5b7924b51637bb95cd270657ca87dafe60edd5534e333524bc901 SDL2_image-2.8.8.tar.gz
33
6148591404b2113bcdb54391821658548acfe380a9cba660113e55e6f2fb7da2a5a59a99fefe51a0d7f8b91160648f11f72750353da88d285a962e3a410aecd7 SDL2_mixer-2.8.1.tar.gz
44
a0f94e26f0387385f13ec1eb08ddca677d4181969073a50af387a0dce9c7bdddf393c028c8084538e01f875e19790ef7ae9a00c5106bf7ca9d21f3fcf9eee885 SDL2_ttf-2.24.0.tar.gz

buildconfig/stubs/gen_stubs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def get_all(mod: Any):
128128
# write the module docstring of this file in the generated file, so that
129129
# people know this file exists
130130
f.write(info_header)
131+
f.write("# ruff: noqa: I001\n")
131132
f.write(misc_stubs)
132133

133134
for mod, items in pygame_all_imports.items():

buildconfig/stubs/pygame/__init__.pyi

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# buildconfig/stubs/gen_stubs.py
22
# A script to auto-generate locals.pyi, constants.pyi and __init__.pyi typestubs
33
# IMPORTANT NOTE: Do not edit this file by hand!
4+
# ruff: noqa: I001
45

56
from . import (
67
display as display,
@@ -108,11 +109,26 @@ from .constants import (
108109
AUDIO_U16SYS as AUDIO_U16SYS,
109110
AUDIO_U8 as AUDIO_U8,
110111
BIG_ENDIAN as BIG_ENDIAN,
112+
BLENDFACTOR_DST_ALPHA as BLENDFACTOR_DST_ALPHA,
113+
BLENDFACTOR_DST_COLOR as BLENDFACTOR_DST_COLOR,
114+
BLENDFACTOR_ONE as BLENDFACTOR_ONE,
115+
BLENDFACTOR_ONE_MINUS_DST_ALPHA as BLENDFACTOR_ONE_MINUS_DST_ALPHA,
116+
BLENDFACTOR_ONE_MINUS_DST_COLOR as BLENDFACTOR_ONE_MINUS_DST_COLOR,
117+
BLENDFACTOR_ONE_MINUS_SRC_ALPHA as BLENDFACTOR_ONE_MINUS_SRC_ALPHA,
118+
BLENDFACTOR_ONE_MINUS_SRC_COLOR as BLENDFACTOR_ONE_MINUS_SRC_COLOR,
119+
BLENDFACTOR_SRC_ALPHA as BLENDFACTOR_SRC_ALPHA,
120+
BLENDFACTOR_SRC_COLOR as BLENDFACTOR_SRC_COLOR,
121+
BLENDFACTOR_ZERO as BLENDFACTOR_ZERO,
111122
BLENDMODE_ADD as BLENDMODE_ADD,
112123
BLENDMODE_BLEND as BLENDMODE_BLEND,
113124
BLENDMODE_MOD as BLENDMODE_MOD,
114125
BLENDMODE_MUL as BLENDMODE_MUL,
115126
BLENDMODE_NONE as BLENDMODE_NONE,
127+
BLENDOPERATION_ADD as BLENDOPERATION_ADD,
128+
BLENDOPERATION_MAXIMUM as BLENDOPERATION_MAXIMUM,
129+
BLENDOPERATION_MINIMUM as BLENDOPERATION_MINIMUM,
130+
BLENDOPERATION_REV_SUBTRACT as BLENDOPERATION_REV_SUBTRACT,
131+
BLENDOPERATION_SUBTRACT as BLENDOPERATION_SUBTRACT,
116132
BLEND_ADD as BLEND_ADD,
117133
BLEND_ALPHA_SDL2 as BLEND_ALPHA_SDL2,
118134
BLEND_MAX as BLEND_MAX,

buildconfig/stubs/pygame/_debug.pyi

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

44
ImportResult = tuple[str, bool, Optional[Callable]]
55

66
def str_from_tuple(version_tuple: Union[tuple[int, int, int], None]) -> str: ...
7-
def attempt_import(module: str, function_name: str, output_str: str = "") -> ImportResult: ...
7+
def attempt_import(
8+
module: str, function_name: str, output_str: str = ""
9+
) -> ImportResult: ...
810
def print_debug_info(filename: Optional[str] = None) -> None: ...

0 commit comments

Comments
 (0)