Skip to content

Commit 3306bf0

Browse files
committed
SDL3: skip tests of unported stuff, run on CI
1 parent ee899f3 commit 3306bf0

File tree

11 files changed

+97
-67
lines changed

11 files changed

+97
-67
lines changed

.github/workflows/build-sdl3.yml

Lines changed: 25 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,12 @@ jobs:
4242
strategy:
4343
fail-fast: false # if a particular matrix build fails, don't skip the rest
4444
matrix:
45-
os: [ubuntu-24.04, windows-latest, macos-14]
45+
os: [ubuntu-latest, windows-latest, macos-15]
46+
47+
# Use ubuntu 25.10 docker image instead of the ubuntu-latest which is older
48+
# at the time of writing of this comment, and therefore doesn't have SDL3
49+
# and friends.
50+
container: ${{ matrix.os == 'ubuntu-latest' && 'ubuntu:25.10' || '' }}
4651

4752
env:
4853
# Pip now forces us to either make a venv or set this flag, so we will do
@@ -53,76 +58,31 @@ jobs:
5358

5459
steps:
5560
- uses: actions/checkout@v6.0.1
56-
- uses: actions/setup-python@v6
61+
62+
# windows runner has python 3.9 as default (at the time of writing of this)
63+
# which we don't support, so we need to setup a newer version ourselves here
64+
- name: Install pygame deps (windows)
65+
if: matrix.os == 'windows-latest'
66+
uses: actions/setup-python@v6
5767
with:
5868
python-version: '3.14'
5969

60-
- name: Install pygame deps (linux)
61-
if: matrix.os == 'ubuntu-24.04'
62-
run: |
63-
sudo apt-get update --fix-missing
64-
sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev
65-
6670
- name: Install pygame deps (mac)
67-
if: matrix.os == 'macos-14'
68-
run: brew install freetype portmidi
69-
70-
# taken from https://wiki.libsdl.org/SDL3/README-linux#build-dependencies
71-
- name: Install SDL3 deps (linux)
72-
if: matrix.os == 'ubuntu-24.04'
73-
run: >
74-
sudo apt-get install build-essential git make
75-
pkg-config cmake ninja-build gnome-desktop-testing libasound2-dev libpulse-dev
76-
libaudio-dev libfribidi-dev libjack-dev libsndio-dev libx11-dev libxext-dev
77-
libxrandr-dev libxcursor-dev libxfixes-dev libxi-dev libxss-dev libxtst-dev
78-
libxkbcommon-dev libdrm-dev libgbm-dev libgl1-mesa-dev libgles2-mesa-dev
79-
libegl1-mesa-dev libdbus-1-dev libibus-1.0-dev libudev-dev
80-
libpipewire-0.3-dev libwayland-dev libdecor-0-dev liburing-dev
71+
if: matrix.os == 'macos-15'
72+
run: brew install sdl3 sdl3_image sdl3_ttf freetype portmidi
8173

82-
# taken from https://wiki.libsdl.org/SDL3/Installation
83-
- name: Install SDL3
84-
if: matrix.os != 'windows-latest'
85-
run: |
86-
git clone https://github.com/libsdl-org/SDL
87-
cd SDL
88-
mkdir build
89-
cd build
90-
cmake -DCMAKE_BUILD_TYPE=Release ..
91-
cmake --build . --config Release --parallel
92-
sudo cmake --install . --config Release
93-
94-
- name: Install SDL3_image
95-
if: matrix.os != 'windows-latest'
96-
run: |
97-
git clone https://github.com/libsdl-org/SDL_image
98-
cd SDL_image
99-
mkdir build
100-
cd build
101-
cmake -DCMAKE_BUILD_TYPE=Release ..
102-
cmake --build . --config Release --parallel
103-
sudo cmake --install . --config Release
104-
105-
- name: Install SDL3_ttf
106-
if: matrix.os != 'windows-latest'
74+
- name: Install pygame deps (linux)
75+
if: matrix.os == 'ubuntu-latest'
10776
run: |
108-
git clone https://github.com/libsdl-org/SDL_ttf
109-
cd SDL_ttf
110-
mkdir build
111-
cd build
112-
cmake -DCMAKE_BUILD_TYPE=Release ..
113-
cmake --build . --config Release --parallel
114-
sudo cmake --install . --config Release
77+
apt-get update
78+
apt-get install -y python3-dev python3-pip \
79+
libsdl3-dev libsdl3-image-dev libsdl3-ttf-dev libfreetype6-dev libportmidi-dev
11580
116-
- name: Build with SDL3
81+
- name: Build pygame-ce with SDL3
11782
run: python3 dev.py build --sdl3
11883

119-
# eventually we need to run all tests, but for now test that importing pygame
120-
# works
121-
- name: Test import works
122-
run: python3 -c 'import pygame'
123-
124-
# - name: Run tests
125-
# env:
126-
# SDL_VIDEODRIVER: "dummy"
127-
# SDL_AUDIODRIVER: "disk"
128-
# run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
84+
- name: Run tests
85+
env:
86+
SDL_VIDEODRIVER: "dummy"
87+
SDL_AUDIODRIVER: "disk"
88+
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300

test/controller_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/gfxdraw_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/joystick_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/mixer_music_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/mixer_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/render_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/sndarray_tags.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
__tags__ = ["array"]
1+
import pygame
22

3-
exclude = False
3+
__tags__ = ["array", "sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
46

57
try:
68
import numpy

test/touch_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

test/video_tags.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import pygame
2+
3+
__tags__ = ["sdl3_skip"]
4+
5+
exclude = pygame.get_sdl_version() >= (3, 0, 0)
6+
7+
if exclude:
8+
__tags__.extend(("ignore", "subprocess_ignore"))

0 commit comments

Comments
 (0)