Skip to content

Commit

Permalink
Merge branch 'events-in-python-2' into events-as-types-python
Browse files Browse the repository at this point in the history
  • Loading branch information
gresm committed Oct 22, 2024
2 parents 537c527 + 9e10e91 commit 4bed447
Show file tree
Hide file tree
Showing 191 changed files with 5,234 additions and 1,800 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- run:
name: Build the Linux wheels.
command: |
pip3 install --user cibuildwheel==2.21.1
pip3 install --user cibuildwheel==2.21.3
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
- store_artifacts:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-debian-multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ env:
jobs:
build-multiarch:
name: Debian (Bookworm - 12) [${{ matrix.arch }}]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
Expand All @@ -65,7 +65,7 @@ jobs:
- { arch: armv7, base_image: 'balenalib/raspberrypi3-debian:bookworm' }

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Build sources and run tests
uses: uraimo/[email protected]
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
test-armv7-on-armv6:
needs: build-multiarch
name: Debian (Bookworm - 12) [build - armv7, test - armv6]
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Download all multiarch artifacts
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-emsdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
SDKROOT: /opt/python-wasm-sdk

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Regen with latest cython (using system python3)
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
- { macarch: x86_64, os: macos-13 }

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Test for Mac Deps cache hit
id: macdep-cache
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.1
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
# The hash of all files in buildconfig manylinux-build and macdependencies is
Expand Down Expand Up @@ -116,17 +116,17 @@ jobs:
CIBW_BEFORE_TEST: rm -rf ${{ github.workspace }}/pygame_mac_deps

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: pip cache
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.1
with:
path: ~/Library/Caches/pip # This cache path is only right on mac
key: pip-cache-${{ matrix.macarch }}-${{ matrix.os }}

- name: Fetch Mac deps
id: macdep-cache
uses: actions/cache@v4.0.2
uses: actions/cache@v4.1.1
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
Expand All @@ -138,7 +138,7 @@ jobs:
uv-version: "0.4.10"

- name: Build and test wheels
uses: pypa/[email protected].1
uses: pypa/[email protected].3

- uses: actions/upload-artifact@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ concurrency:
jobs:
build:
name: ${{ matrix.arch }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand All @@ -52,7 +52,7 @@ jobs:
CIBW_ARCHS: ${{ matrix.arch }}

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
Expand All @@ -75,7 +75,7 @@ jobs:

- name: Build and push Docker image
if: steps.inspect.outcome == 'failure'
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75
with:
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
Expand All @@ -91,7 +91,7 @@ jobs:
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}

uses: pypa/[email protected].1
uses: pypa/[email protected].3

# We upload the generated files under github actions assets
- name: Upload dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-on-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
# - { sys: clangarm64, env: clang-aarch64 }

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.sys }}
Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/build-sdl3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# SDL3 porting is WIP
name: SDL3 build

# Run CI only when a release is created, on changes to main branch, or any PR
# to main. Do not run CI on any other branch. Also, skip any non-source changes
# from running on CI
on:
push:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-sdl3.yml'

pull_request:
branches: main
paths-ignore:
- 'docs/**'
- 'examples/**'
- '.gitignore'
- '*.rst'
- '*.md'
- '.github/workflows/*.yml'
# re-include current file to not be excluded
- '!.github/workflows/build-sdl3.yml'

# the github release drafter can call this workflow
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-sdist
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-24.04, windows-latest, macos-14]

env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1
# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1

steps:
- uses: actions/[email protected]

- name: Install deps (linux)
if: matrix.os == 'ubuntu-24.04'
run: sudo apt-get install libfreetype6-dev libportmidi-dev python3-dev

- name: Install deps (mac)
if: matrix.os == 'macos-14'
run: brew install freetype portmidi

# taken from https://wiki.libsdl.org/SDL3/Installation
- name: Install SDL3
if: matrix.os != 'windows-latest'
run: |
git clone https://github.com/libsdl-org/SDL
cd SDL
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --config Release --parallel
sudo cmake --install . --config Release
- name: Make sdist and install it
run: >
python3 -m pip install . -v -Csetup-args=-Dsdl_api=3
-Csetup-args=-Dimage=disabled
-Csetup-args=-Dmixer=disabled
-Csetup-args=-Dfont=disabled
# - name: Run tests
# env:
# SDL_VIDEODRIVER: "dummy"
# SDL_AUDIODRIVER: "disk"
# run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300
11 changes: 9 additions & 2 deletions .github/workflows/build-ubuntu-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ jobs:
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-22.04]
os: [ubuntu-24.04]

env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1
# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,17 @@ jobs:
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
os: [ubuntu-24.04, ubuntu-22.04]

env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1
# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
Expand All @@ -76,14 +83,13 @@ jobs:
run: python3 -m pygame.tests -v --exclude opengl,music,timing --time_out 300

- name: Test typestubs
if: matrix.os == 'ubuntu-22.04' # run stubtest only once
run: |
pip3 install mypy
python3 buildconfig/stubs/stubcheck.py
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-20.04' # upload sdist only once
if: matrix.os == 'ubuntu-24.04' # upload sdist only once
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-sdist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
CIBW_ARCHS: ${{ matrix.winarch }}

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- uses: TheMrMilchmann/setup-msvc-dev@v3 # this lets us use the developer command prompt on windows
with:
Expand All @@ -62,7 +62,7 @@ jobs:
uv-version: "0.4.10"

- name: Build and test wheels
uses: pypa/[email protected].1
uses: pypa/[email protected].3

- uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ concurrency:
# TODO: Any more static checkers can be added here
jobs:
run-cppcheck:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Install deps
# https://github.com/actions/runner-images/issues/7192
Expand All @@ -32,6 +32,10 @@ jobs:
sudo apt install cppcheck
- name: Run Static Checker
# skip cppcheck on SDL_gfx and scrap for now
run: cppcheck src_c --force --enable=performance,portability,warning \
--suppress=*:src_c/SDL_gfx/* --suppress=*:src_c/scrap*
# skip cppcheck on SDL_gfx, scrap, scale_mm* and ft_cache for now
# suppress missingReturn and syntaxError because it gives many false positives
run: cppcheck src_c --enable=performance,portability,warning \
--suppress=*:src_c/freetype/ft_cache.c --suppress=*:src_c/scrap* \
--suppress=*:src_c/scale_mmx*.c --suppress=*:src_c/SDL_gfx/* \
--suppress=missingReturn --suppress=syntaxError -DWITH_THREAD -j $(nproc) \
-DPG_MAJOR_VERSION -DPG_MINOR_VERSION -DPG_PATCH_VERSION -DPG_VERSION_TAG
11 changes: 8 additions & 3 deletions .github/workflows/format-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,22 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1
- uses: actions/setup-python@v5
with:
python-version: 3.x
- uses: pre-commit/[email protected]

format-lint-code-check:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

env:
# Pip now forces us to either make a venv or set this flag, so we will do
# this
PIP_BREAK_SYSTEM_PACKAGES: 1

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Install deps
run: python3 -m pip install pylint sphinx"<7.2.0"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-gh-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
contents: write

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Download all artifacts
uses: actions/download-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.1

- name: Pull all release assets
uses: robinraju/[email protected]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dist
*.so
__pycache__
_headers/*
buildconfig/win_dll_dirs.json

# cython generated files
src_c/_sdl2/*.c
Expand Down
Loading

0 comments on commit 4bed447

Please sign in to comment.