Skip to content

Commit cd88289

Browse files
committed
Merge branch 'main' into DrawArcTest
2 parents 409c679 + 582b639 commit cd88289

File tree

401 files changed

+7630
-129346
lines changed

Some content is hidden

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

401 files changed

+7630
-129346
lines changed

.circleci/config.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,12 @@ 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_*'
3535
- CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014_base_aarch64
3636
- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: manylinux2014_base_aarch64
37-
- CIBW_BEFORE_BUILD: pip install Sphinx"<7.2.0" && python setup.py docs
3837
- CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,music,timing --time_out 300
3938
- CIBW_BUILD_VERBOSITY: 2
4039

@@ -48,7 +47,7 @@ jobs:
4847
- run:
4948
name: Build the Linux wheels.
5049
command: |
51-
pip3 install --user cibuildwheel==2.16.2
50+
pip3 install --user cibuildwheel==2.18.1
5251
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
5352
5453
- 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/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# example. The documentation can be seen here:
77
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
88

9-
* @pygame-community/pygame-contributing-admins
9+
* @pygame-community/pygame-senior-reviewers

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ You can get some of this info from the text that pops up in the console when you
1616
- **Operating system** (e.g. Windows, Linux(Debian), Linux(Ubuntu), Mac):
1717
- **Python version** (e.g. 3.11.1, 3.8.5) :
1818
- **SDL version** (e.g. SDL 2.0.12):
19-
- **PyGame version** (e.g. 2.0.0.dev10, 1.9.6):
19+
- **pygame-ce version** (e.g. 2.4.0.dev4, 2.1.3):
2020
- **Relevant hardware** (e.g. if reporting a bug about a controller, tell us the brand & name of it):
2121

2222
**Current behavior:**

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

Lines changed: 75 additions & 16 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 cython3 -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/checkout@v4.1.1
68+
- uses: actions/checkout@v4.1.6
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,60 @@ 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"
87-
python3 setup.py docs
88-
pip3 wheel . --wheel-dir /artifacts -vvv
103+
pip3 wheel . --no-build-isolation --wheel-dir /artifacts -vvv
104+
echo "\nInstalling wheel\n"
105+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts pygame-ce
106+
echo "\nRunning tests\n"
107+
export SDL_VIDEODRIVER=dummy
108+
export SDL_AUDIODRIVER=disk
109+
python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
110+
111+
# Upload the generated files under github actions assets section
112+
- name: Upload dist
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: pygame-multiarch-${{ matrix.arch }}-dist
116+
path: ~/artifacts/*.whl
117+
118+
# test wheels built on armv7 on armv6. Why?
119+
# because piwheels expects the same armv7 wheel to work on both armv7 and armv6
120+
test-armv7-on-armv6:
121+
needs: build-multiarch
122+
name: Debian (Bookworm - 12) [build - armv7, test - armv6]
123+
runs-on: ubuntu-22.04
124+
steps:
125+
- name: Download all multiarch artifacts
126+
uses: actions/download-artifact@v4
127+
with:
128+
name: pygame-multiarch-armv7-dist
129+
path: ~/artifacts
130+
131+
- name: Rename arm wheel in artifacts
132+
run: |
133+
cd ~/artifacts
134+
for f in *; do
135+
mv "$f" "${f//armv7l/armv6l}"
136+
done
137+
138+
- name: Test armv7 wheel on armv6
139+
uses: uraimo/run-on-arch-action@v2.7.2
140+
with:
141+
arch: armv6
142+
distro: bookworm
143+
githubToken: ${{ github.token }}
144+
dockerRunArgs: --volume ~/artifacts:/artifacts_new
145+
shell: /bin/sh
146+
install: ${{ env.INSTALL_CMD }}
147+
run: |
89148
echo "\nInstalling wheel\n"
90-
pip3 install --no-index --pre --find-links /artifacts pygame-ce
149+
pip3 install --no-index --pre --break-system-packages --find-links /artifacts_new pygame-ce
91150
echo "\nRunning tests\n"
92151
export SDL_VIDEODRIVER=dummy
93152
export SDL_AUDIODRIVER=disk

.github/workflows/build-emsdk.yml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,33 +40,12 @@ jobs:
4040
SDK_ARCHIVE: python3.11-wasm-sdk-Ubuntu-22.04.tar.lz4
4141
SDKROOT: /opt/python-wasm-sdk
4242

43-
# use the most recent cython from github, but pin on a commit for CI
44-
# stability. This is also needed to benefit from caching cython installs
45-
LATEST_CYTHON_COMMIT: 2f3a781dcca092ce95fbfef2736b12b0d1ab50dd # cython 3.0.0
46-
47-
WHEELHOUSE_CYTHON: /tmp/wheelhouse/cython
48-
4943
steps:
50-
- uses: actions/checkout@v4.1.1
51-
52-
- name: Cache Cython
53-
id: cache-cython
54-
uses: actions/cache@v3.3.2
55-
with:
56-
path: ${{ env.WHEELHOUSE_CYTHON }}
57-
key: wasm-ubuntu-cython-${{ env.LATEST_CYTHON_COMMIT }}-path-${{ env.WHEELHOUSE_CYTHON }}
58-
59-
# This builds the cython wheel and stores it in cache too
60-
- name: Download and build cython on cache miss
61-
if: steps.cache-cython.outputs.cache-hit != 'true'
62-
run: |
63-
mkdir -p $WHEELHOUSE_CYTHON
64-
pip wheel --wheel-dir $WHEELHOUSE_CYTHON git+https://github.com/cython/cython.git@$LATEST_CYTHON_COMMIT
44+
- uses: actions/checkout@v4.1.6
6545

66-
- name: Install latest cython and regen
46+
- name: Regen with latest cython (using system python3)
6747
run: |
68-
pip install --no-index --find-links $WHEELHOUSE_CYTHON --pre cython
69-
touch $(find | grep pxd$)
48+
pip3 install cython==3.0.10
7049
python3 setup.py cython_only
7150
7251
- name: Install python-wasm-sdk
@@ -89,7 +68,7 @@ jobs:
8968
9069
# Upload the generated files under github actions assets section
9170
- name: Upload dist
92-
uses: actions/upload-artifact@v3
71+
uses: actions/upload-artifact@v4
9372
with:
9473
name: pygame-wasm-dist
9574
path: ./dist/*

.github/workflows/build-macos.yml

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,25 @@ concurrency:
3838
jobs:
3939
deps:
4040
name: ${{ matrix.macarch }} deps
41-
runs-on: macos-12
41+
runs-on: ${{ matrix.os }}
4242
strategy:
4343
matrix:
4444
# make arm64 deps and x86_64 deps
45-
macarch: [arm64, x86_64]
45+
include:
46+
- { macarch: arm64, os: macos-14 }
47+
- { macarch: x86_64, os: macos-13 }
4648

4749
steps:
48-
- uses: actions/checkout@v4.1.1
50+
- uses: actions/checkout@v4.1.6
4951

5052
- name: Test for Mac Deps cache hit
5153
id: macdep-cache
52-
uses: actions/cache@v3.3.2
54+
uses: actions/cache@v4.0.2
5355
with:
5456
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
5557
# The hash of all files in buildconfig manylinux-build and macdependencies is
5658
# the key to the cache. If anything changes here, the deps are built again
57-
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
59+
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}-${{ matrix.os }}
5860
lookup-only: true
5961

6062
# build mac deps on cache miss
@@ -68,15 +70,15 @@ jobs:
6870
6971
# Uncomment when you want to manually verify the deps by downloading them
7072
# - name: Upload Mac deps
71-
# uses: actions/upload-artifact@v3
73+
# uses: actions/upload-artifact@v4
7274
# with:
7375
# name: pygame-mac-deps-${{ matrix.macarch }}
7476
# path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
7577

7678
build:
7779
name: ${{ matrix.name }}
7880
needs: deps
79-
runs-on: macos-12
81+
runs-on: ${{ matrix.os }}
8082
strategy:
8183
fail-fast: false # if a particular matrix build fails, don't skip the rest
8284
matrix:
@@ -87,31 +89,36 @@ jobs:
8789
- {
8890
name: "x86_64 (CPython 3.9 - 3.12)",
8991
macarch: x86_64,
92+
os: macos-13,
9093
pyversions: "cp3{9,10,11,12}-*",
9194
}
9295

9396
- {
9497
name: "x86_64 (Python 3.8)",
9598
macarch: x86_64,
99+
os: macos-13,
96100
# CPython/PyPy 3.8
97101
pyversions: "?p38-*",
98102
}
99103

100104
- {
101105
name: "x86_64 (PyPy 3.9 and 3.10)",
102106
macarch: x86_64,
107+
os: macos-13,
103108
pyversions: "pp39-* pp310-*",
104109
}
105110

106111
- {
107112
name: "arm64 (CPython 3.8 - 3.10)",
108113
macarch: arm64,
114+
os: macos-14,
109115
pyversions: "cp3{8,9,10}-*",
110116
}
111117

112118
- {
113119
name: "arm64 (CPython 3.11 - 3.12)",
114120
macarch: arm64,
121+
os: macos-14,
115122
pyversions: "cp3{11,12}-*",
116123
}
117124

@@ -120,7 +127,7 @@ jobs:
120127
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
121128
# because this should not affect cibuildwheel machinery
122129
# also define environment variables needed for testing
123-
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
130+
CIBW_ENVIRONMENT: SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
124131

125132
# Explicitly tell CIBW what the wheel arch deployment target should be
126133
# There seems to be no better way to set this than this env
@@ -135,8 +142,6 @@ jobs:
135142

136143
CIBW_BUILD: ${{ matrix.pyversions }}
137144

138-
# Build arm64 and x86_64 wheels too on an Intel runner.
139-
# Note that the arm64 wheels cannot be tested on CI in this configuration
140145
CIBW_ARCHS: ${{ matrix.macarch }}
141146

142147
# Setup macOS dependencies
@@ -147,8 +152,7 @@ jobs:
147152
bash ./install_mac_deps.sh
148153
149154
CIBW_BEFORE_BUILD: |
150-
pip install requests numpy Sphinx"<7.2.0"
151-
python setup.py docs
155+
pip install numpy
152156
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
153157
154158
# To remove any speculations about the wheel not being self-contained
@@ -160,27 +164,28 @@ jobs:
160164
CIBW_BUILD_VERBOSITY: 2
161165

162166
steps:
163-
- uses: actions/checkout@v4.1.1
167+
- uses: actions/checkout@v4.1.6
164168

165169
- name: pip cache
166-
uses: actions/cache@v3.3.2
170+
uses: actions/cache@v4.0.2
167171
with:
168172
path: ~/Library/Caches/pip # This cache path is only right on mac
169173
key: pip-cache-${{ matrix.name }}
170174

171175
- name: Fetch Mac deps
172176
id: macdep-cache
173-
uses: actions/cache@v3.3.2
177+
uses: actions/cache@v4.0.2
174178
with:
175179
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
176180
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
177181
fail-on-cache-miss: true
178182

179183
- name: Build and test wheels
180-
uses: pypa/cibuildwheel@v2.16.2
184+
uses: pypa/cibuildwheel@v2.18.1
181185

182-
- uses: actions/upload-artifact@v3
186+
- uses: actions/upload-artifact@v4
183187
with:
184-
name: pygame-wheels-macos
188+
name: pygame-wheels-macos-${{ matrix.name }}
185189
path: ./wheelhouse/*.whl
190+
compression-level: 0 # wheels are already zip files, no need for more compression
186191

0 commit comments

Comments
 (0)