Skip to content

Commit 116447a

Browse files
committed
Merge branch 'main' of https://github.com/pygame-community/pygame-ce into window-create-context
2 parents a0c3f14 + 0209311 commit 116447a

File tree

201 files changed

+7088
-5402
lines changed

Some content is hidden

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

201 files changed

+7088
-5402
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828

2929
environment:
3030
# these environment variables will be passed to the docker container
31-
- CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
31+
- CIBW_ENVIRONMENT: SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
3232
- CIBW_BUILD: "cp3{8,9,10,11,12}-* pp3{8,9,10}-*"
3333
- CIBW_ARCHS: aarch64
3434
- CIBW_SKIP: '*-musllinux_*'
@@ -48,7 +48,7 @@ jobs:
4848
- run:
4949
name: Build the Linux wheels.
5050
command: |
51-
pip3 install --user cibuildwheel==2.16.2
51+
pip3 install --user cibuildwheel==2.16.4
5252
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
5353
5454
- store_artifacts:

src_py/.editorconfig renamed to .editorconfig

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ root=true
44
end_of_line = lf
55
insert_final_newline = true
66

7-
# The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
8-
# Keep them in sync.
9-
[*.{c,h}]
7+
[*.{c,h,py,pyx,pyi}]
108
indent_style = space
119
indent_size = 4
1210
tab_width = 4
11+
charset = utf-8
1312
trim_trailing_whitespace = true
13+
14+
# The settings for C (*.c and *.h) files are mirrored in src_c/.clang-format.
15+
# Keep them in sync.
16+
[*.{c,h}]
1417
max_line_length = 79
1518

16-
[*.{py,pyx}]
17-
indent_style = space
18-
indent_size = 4
19-
charset = utf-8
19+
[*.{py,pyx,pyi}]
2020
file_type_emacs = python
21-
trim_trailing_whitespace = true
22-
max_line_length = 79
21+
max_line_length = 88

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

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,45 @@ concurrency:
3535
group: ${{ github.workflow }}-${{ github.ref }}-debian-multiarch
3636
cancel-in-progress: true
3737

38+
# this command is called in two places, so save it in an env first
39+
env:
40+
INSTALL_CMD: |
41+
apt-get update --fix-missing
42+
apt-get upgrade -y
43+
apt-get install build-essential meson -y
44+
apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev -y
45+
apt-get install libfreetype6-dev libportmidi-dev fontconfig -y
46+
apt-get install python3-dev python3-pip python3-wheel python3-sphinx -y
47+
pip3 install meson-python --break-system-packages
48+
3849
jobs:
3950
build-multiarch:
40-
name: Debian (Bullseye - 11) [${{ matrix.arch }}]
51+
name: Debian (Bookworm - 12) [${{ matrix.arch }}]
4152
runs-on: ubuntu-22.04
4253

4354
strategy:
4455
fail-fast: false # if a particular matrix build fails, don't skip the rest
4556
matrix:
4657
# maybe more things could be added in here in the future (if needed)
47-
arch: [s390x, ppc64le]
58+
include:
59+
- { arch: s390x, base_image: '' }
60+
- { arch: ppc64le, base_image: '' }
61+
- { arch: armv6, base_image: '' }
62+
# a custom base_image is specified in the armv7 case. This is done because
63+
# the armv6 image is just raspbian in disguise. And the wheel built on armv7
64+
# is going to be tested on armv6
65+
- { arch: armv7, base_image: 'balenalib/raspberrypi3-debian:bookworm' }
4866

4967
steps:
50-
- uses: actions/[email protected].1
68+
- uses: actions/[email protected].2
5169

5270
- name: Build sources and run tests
53-
uses: uraimo/run-on-arch-action@v2.6.0
71+
uses: uraimo/run-on-arch-action@v2.7.2
5472
id: build
5573
with:
56-
arch: ${{ matrix.arch }}
57-
distro: bullseye
74+
arch: ${{ matrix.base_image && 'none' || matrix.arch }}
75+
distro: ${{ matrix.base_image && 'none' || 'bookworm' }}
76+
base_image: ${{ matrix.base_image }}
5877

5978
# Not required, but speeds up builds
6079
githubToken: ${{ github.token }}
@@ -74,20 +93,61 @@ jobs:
7493
# builds don't have to re-install them. The image layer is cached
7594
# publicly in your project's package repository, so it is vital that
7695
# no secrets are present in the container state or logs.
77-
install: |
78-
apt-get update --fix-missing
79-
apt-get upgrade -y
80-
apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev fontconfig -y
81-
apt-get install python3-setuptools python3-dev python3-pip python3-wheel python3-sphinx -y
96+
install: ${{ env.INSTALL_CMD }}
8297

83-
# Build a wheel, install it for running unit tests
98+
# Build a wheel, install it for running unit tests.
99+
# --no-build-isolation is passed so that preinstalled meson-python can be used
100+
# (done for optimization reasons)
84101
run: |
85-
export PIP_CONFIG_FILE=buildconfig/pip_config.ini
86102
echo "\nBuilding pygame wheel\n"
87103
python3 setup.py docs
88-
pip3 wheel . --wheel-dir /artifacts -vvv
104+
pip3 wheel . --no-build-isolation --wheel-dir /artifacts -vvv
105+
echo "\nInstalling wheel\n"
106+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts pygame-ce
107+
echo "\nRunning tests\n"
108+
export SDL_VIDEODRIVER=dummy
109+
export SDL_AUDIODRIVER=disk
110+
python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
111+
112+
# Upload the generated files under github actions assets section
113+
- name: Upload dist
114+
uses: actions/upload-artifact@v4
115+
with:
116+
name: pygame-multiarch-${{ matrix.arch }}-dist
117+
path: ~/artifacts/*.whl
118+
119+
# test wheels built on armv7 on armv6. Why?
120+
# because piwheels expects the same armv7 wheel to work on both armv7 and armv6
121+
test-armv7-on-armv6:
122+
needs: build-multiarch
123+
name: Debian (Bookworm - 12) [build - armv7, test - armv6]
124+
runs-on: ubuntu-22.04
125+
steps:
126+
- name: Download all multiarch artifacts
127+
uses: actions/download-artifact@v4
128+
with:
129+
name: pygame-multiarch-armv7-dist
130+
path: ~/artifacts
131+
132+
- name: Rename arm wheel in artifacts
133+
run: |
134+
cd ~/artifacts
135+
for f in *; do
136+
mv "$f" "${f//armv7l/armv6l}"
137+
done
138+
139+
- name: Test armv7 wheel on armv6
140+
uses: uraimo/[email protected]
141+
with:
142+
arch: armv6
143+
distro: bookworm
144+
githubToken: ${{ github.token }}
145+
dockerRunArgs: --volume ~/artifacts:/artifacts_new
146+
shell: /bin/sh
147+
install: ${{ env.INSTALL_CMD }}
148+
run: |
89149
echo "\nInstalling wheel\n"
90-
pip3 install --no-index --pre --find-links /artifacts pygame-ce
150+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts_new pygame-ce
91151
echo "\nRunning tests\n"
92152
export SDL_VIDEODRIVER=dummy
93153
export SDL_AUDIODRIVER=disk

.github/workflows/build-emsdk.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
WHEELHOUSE_CYTHON: /tmp/wheelhouse/cython
4848

4949
steps:
50-
- uses: actions/[email protected].1
50+
- uses: actions/[email protected].2
5151

5252
- name: Cache Cython
5353
id: cache-cython
54-
uses: actions/cache@v3.3.3
54+
uses: actions/cache@v4.0.2
5555
with:
5656
path: ${{ env.WHEELHOUSE_CYTHON }}
5757
key: wasm-ubuntu-cython-${{ env.LATEST_CYTHON_COMMIT }}-path-${{ env.WHEELHOUSE_CYTHON }}

.github/workflows/build-macos.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ jobs:
4545
macarch: [arm64, x86_64]
4646

4747
steps:
48-
- uses: actions/[email protected].1
48+
- uses: actions/[email protected].2
4949

5050
- name: Test for Mac Deps cache hit
5151
id: macdep-cache
52-
uses: actions/cache@v3.3.3
52+
uses: actions/cache@v4.0.2
5353
with:
5454
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
5555
# The hash of all files in buildconfig manylinux-build and macdependencies is
@@ -120,7 +120,7 @@ jobs:
120120
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
121121
# because this should not affect cibuildwheel machinery
122122
# also define environment variables needed for testing
123-
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
123+
CIBW_ENVIRONMENT: SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
124124

125125
# Explicitly tell CIBW what the wheel arch deployment target should be
126126
# There seems to be no better way to set this than this env
@@ -147,7 +147,7 @@ jobs:
147147
bash ./install_mac_deps.sh
148148
149149
CIBW_BEFORE_BUILD: |
150-
pip install requests numpy Sphinx"<7.2.0"
150+
pip install numpy Sphinx"<7.2.0"
151151
python setup.py docs
152152
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
153153
@@ -160,24 +160,24 @@ jobs:
160160
CIBW_BUILD_VERBOSITY: 2
161161

162162
steps:
163-
- uses: actions/[email protected].1
163+
- uses: actions/[email protected].2
164164

165165
- name: pip cache
166-
uses: actions/cache@v3.3.3
166+
uses: actions/cache@v4.0.2
167167
with:
168168
path: ~/Library/Caches/pip # This cache path is only right on mac
169169
key: pip-cache-${{ matrix.name }}
170170

171171
- name: Fetch Mac deps
172172
id: macdep-cache
173-
uses: actions/cache@v3.3.3
173+
uses: actions/cache@v4.0.2
174174
with:
175175
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
176176
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
177177
fail-on-cache-miss: true
178178

179179
- name: Build and test wheels
180-
uses: pypa/[email protected].2
180+
uses: pypa/[email protected].4
181181

182182
- uses: actions/upload-artifact@v4
183183
with:

.github/workflows/build-manylinux.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
5353
# because this should not affect cibuildwheel machinery
5454
# also define environment variables needed for testing
55-
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
55+
CIBW_ENVIRONMENT: SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
5656

5757
CIBW_BUILD: "cp3{8,9,10,11,12}-* pp3{8,9,10}-*"
5858
CIBW_ARCHS: ${{ matrix.arch }}
@@ -79,10 +79,10 @@ jobs:
7979
CIBW_BUILD_VERBOSITY: 2
8080

8181
steps:
82-
- uses: actions/[email protected].1
82+
- uses: actions/[email protected].2
8383

8484
- name: Log in to the Container registry
85-
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
85+
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20
8686
with:
8787
registry: ghcr.io
8888
username: ${{ github.actor }}
@@ -95,14 +95,14 @@ jobs:
9595

9696
- name: Extract metadata (tags, labels) for Docker
9797
id: meta
98-
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
98+
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
9999
with:
100100
images: ghcr.io/${{ github.repository }}_${{ matrix.arch }}
101101
tags: type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }}
102102

103103
- name: Build and push Docker image
104104
if: steps.inspect.outcome == 'failure'
105-
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
105+
uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0
106106
with:
107107
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
108108
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
@@ -118,7 +118,7 @@ jobs:
118118
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
119119
CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
120120

121-
uses: pypa/[email protected].2
121+
uses: pypa/[email protected].4
122122

123123
# We upload the generated files under github actions assets
124124
- name: Upload dist
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Tests that pygame can compile on MSYS2
2+
name: MSYS2
3+
4+
# Run CI only on changes to main branch, or any PR to main. Do not run CI on
5+
# any other branch. Also, skip any non-source changes from running on CI
6+
on:
7+
push:
8+
branches: main
9+
paths-ignore:
10+
- 'docs/**'
11+
- 'examples/**'
12+
- '.gitignore'
13+
- '*.rst'
14+
- '*.md'
15+
- '.github/workflows/*.yml'
16+
# re-include current file to not be excluded
17+
- '!.github/workflows/build-on-msys2.yml'
18+
19+
pull_request:
20+
branches: main
21+
paths-ignore:
22+
- 'docs/**'
23+
- 'examples/**'
24+
- '.gitignore'
25+
- '*.rst'
26+
- '*.md'
27+
- '.github/workflows/*.yml'
28+
# re-include current file to not be excluded
29+
- '!.github/workflows/build-on-msys2.yml'
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.ref }}-msys2
33+
cancel-in-progress: true
34+
35+
jobs:
36+
msys2:
37+
runs-on: windows-latest
38+
defaults:
39+
run:
40+
shell: msys2 {0}
41+
strategy:
42+
matrix:
43+
include:
44+
- { sys: mingw64, env: x86_64 }
45+
- { sys: mingw32, env: i686 }
46+
- { sys: ucrt64, env: ucrt-x86_64 }
47+
- { sys: clang32, env: clang-i686 }
48+
- { sys: clang64, env: clang-x86_64 }
49+
# - { sys: clangarm64, env: clang-aarch64 }
50+
51+
steps:
52+
- uses: actions/[email protected]
53+
- uses: msys2/setup-msys2@v2
54+
with:
55+
msystem: ${{ matrix.sys }}
56+
update: true
57+
install: >-
58+
mingw-w64-${{ matrix.env }}-gcc
59+
mingw-w64-${{ matrix.env }}-pkg-config
60+
mingw-w64-${{ matrix.env }}-python
61+
mingw-w64-${{ matrix.env }}-python-pip
62+
mingw-w64-${{ matrix.env }}-python-sphinx
63+
mingw-w64-${{ matrix.env }}-meson-python
64+
65+
# mingw-w64-${{ matrix.env }}-SDL2
66+
# mingw-w64-${{ matrix.env }}-SDL2_image
67+
# mingw-w64-${{ matrix.env }}-SDL2_mixer
68+
# mingw-w64-${{ matrix.env }}-SDL2_ttf
69+
# mingw-w64-${{ matrix.env }}-freetype
70+
# mingw-w64-${{ matrix.env }}-portmidi
71+
72+
- name: Building pygame wheel
73+
run: |
74+
python3 setup.py docs
75+
pip3 wheel . --wheel-dir /artifacts -vvv --no-build-isolation
76+
77+
- name: Installing wheel
78+
run: pip3 install --no-index --pre --find-links /artifacts pygame-ce
79+
80+
- name: Run tests
81+
env:
82+
SDL_VIDEODRIVER: "dummy"
83+
SDL_AUDIODRIVER: "disk"
84+
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300

0 commit comments

Comments
 (0)