Skip to content

Commit

Permalink
Merge pull request #14 from pygame-community/main
Browse files Browse the repository at this point in the history
[pull] main from pygame-community:main
  • Loading branch information
Matiiss authored Jan 21, 2024
2 parents 90490d3 + b0e20ee commit cdce447
Show file tree
Hide file tree
Showing 419 changed files with 93,166 additions and 102,932 deletions.
31 changes: 26 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,54 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
parameters:
GHA_Actor:
type: string
default: ""
GHA_Action:
type: string
default: ""
GHA_Event:
type: string
default: ""
GHA_Meta:
type: string
default: ""

# Define a job to be invoked later in a workflow.
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
jobs:
linux-arm-wheels:
working_directory: ~/linux-wheels
machine:
image: ubuntu-2004:current
image: ubuntu-2204:current
docker_layer_caching: true

resource_class: arm.medium

environment:
# these environment variables will be passed to the docker container
- CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
- CIBW_BUILD: "cp3{8,9,10,11,12}-* pp3{8,9,10}-*"
- CIBW_ARCHS: aarch64
- CIBW_SKIP: '*-musllinux_*'
- CIBW_MANYLINUX_AARCH64_IMAGE: pygame/manylinux2014_base_aarch64
- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: pygame/manylinux2014_base_aarch64
- CIBW_BEFORE_BUILD: pip install Sphinx && python setup.py docs
- CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014_base_aarch64
- CIBW_MANYLINUX_PYPY_AARCH64_IMAGE: manylinux2014_base_aarch64
- CIBW_BEFORE_BUILD: pip install Sphinx"<7.2.0" && python setup.py docs
- CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,music,timing --time_out 300
- CIBW_BUILD_VERBOSITY: 2

steps:
- checkout
- run:
name: Build the aarch64 base image (and cache it)
working_directory: buildconfig/manylinux-build/docker_base
command: docker build -t manylinux2014_base_aarch64 -f Dockerfile-aarch64 .

- run:
name: Build the Linux wheels.
command: |
pip3 install --user cibuildwheel==2.12.0
pip3 install --user cibuildwheel==2.16.2
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
- store_artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ assignees: ''
You can get some of this info from the text that pops up in the console when you run a pygame program.

- **Operating system** (e.g. Windows, Linux(Debian), Linux(Ubuntu), Mac):
- **Python version** (e.g. 3.7.9, 3.8.5) :
- **Python version** (e.g. 3.11.1, 3.8.5) :
- **SDL version** (e.g. SDL 2.0.12):
- **PyGame version** (e.g. 2.0.0.dev10, 1.9.6):
- **pygame-ce version** (e.g. 2.4.0.dev4, 2.1.3):
- **Relevant hardware** (e.g. if reporting a bug about a controller, tell us the brand & name of it):

**Current behavior:**
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-debian-multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ jobs:
arch: [s390x, ppc64le]

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: Build sources and run tests
uses: uraimo/run-on-arch-action@v2.5.0
uses: uraimo/run-on-arch-action@v2.6.0
id: build
with:
arch: ${{ matrix.arch }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-emsdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ jobs:

# use the most recent cython from github, but pin on a commit for CI
# stability. This is also needed to benefit from caching cython installs
LATEST_CYTHON_COMMIT: 9366abc7d6700da7c98b3b1f169e4f2bfac28c54
LATEST_CYTHON_COMMIT: 2f3a781dcca092ce95fbfef2736b12b0d1ab50dd # cython 3.0.0

WHEELHOUSE_CYTHON: /tmp/wheelhouse/cython

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: Cache Cython
id: cache-cython
uses: actions/[email protected].1
uses: actions/[email protected].3
with:
path: ${{ env.WHEELHOUSE_CYTHON }}
key: wasm-ubuntu-cython-${{ env.LATEST_CYTHON_COMMIT }}-path-${{ env.WHEELHOUSE_CYTHON }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
# Upload the generated files under github actions assets section
- name: Upload dist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pygame-wasm-dist
path: ./dist/*
66 changes: 34 additions & 32 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: MacOS
name: macOS

# 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
Expand Down Expand Up @@ -45,11 +45,11 @@ jobs:
macarch: [arm64, x86_64]

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: Test for Mac Deps cache hit
id: macdep-cache
uses: actions/[email protected].1
uses: actions/[email protected].3
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
# The hash of all files in buildconfig manylinux-build and macdependencies is
Expand All @@ -68,7 +68,7 @@ jobs:
# Uncomment when you want to manually verify the deps by downloading them
# - name: Upload Mac deps
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: pygame-mac-deps-${{ matrix.macarch }}
# path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
Expand All @@ -85,40 +85,34 @@ jobs:
# of these builds take roughly the same time
include:
- {
name: "x86_64 (CPython 3.10 and above)",
name: "x86_64 (CPython 3.9 - 3.12)",
macarch: x86_64,
# pattern matches any 2 digit number
pyversions: "cp3[1-9][0-9]-*",
cibw_platform: "macosx-10.11-x86_64"
pyversions: "cp3{9,10,11,12}-*",
}

- {
name: "x86_64 (Python 3.7)",
name: "x86_64 (Python 3.8)",
macarch: x86_64,
pyversions: "?p37-*",
cibw_platform: "macosx-10.11-x86_64"
# CPython/PyPy 3.8
pyversions: "?p38-*",
}

- {
name: "x86_64 (Python 3.8)",
name: "x86_64 (PyPy 3.9 and 3.10)",
macarch: x86_64,
pyversions: "?p38-*",
cibw_platform: "macosx-10.11-x86_64"
pyversions: "pp39-* pp310-*",
}

- {
name: "x86_64 (Python 3.9)",
macarch: x86_64,
pyversions: "?p39-*",
cibw_platform: "macosx-10.11-x86_64"
name: "arm64 (CPython 3.8 - 3.10)",
macarch: arm64,
pyversions: "cp3{8,9,10}-*",
}

- {
name: "arm64 (CPython 3.8 and above)",
name: "arm64 (CPython 3.11 - 3.12)",
macarch: arm64,
# pattern matches any number from 8 to 99
pyversions: "cp3{8,9,[1-9][0-9]}-*",
cibw_platform: "macosx-11.0-arm64"
pyversions: "cp3{11,12}-*",
}

env:
Expand All @@ -128,25 +122,32 @@ jobs:
# also define environment variables needed for testing
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk

# Tell CIBW that the wheel should be for 10.11
# Explicitly tell CIBW what the wheel arch deployment target should be
# There seems to be no better way to set this than this env
# We need this because our minimum is 10.11, different from default
# of 10.9 on x86s
# Related issue: https://github.com/pypa/cibuildwheel/issues/952
_PYTHON_HOST_PLATFORM: ${{ matrix.cibw_platform }}
_PYTHON_HOST_PLATFORM: ${{ matrix.macarch == 'x86_64' && 'macosx-10.11-x86_64' || 'macosx-11.0-arm64'}}

# Similarly, we need to tell CIBW that the wheel's linking steps
# should be for 10.11 on x86
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macarch == 'x86_64' && '10.11' || '11.0' }}

CIBW_BUILD: ${{ matrix.pyversions }}

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

# Setup MacOS dependencies
# Setup macOS dependencies
CIBW_BEFORE_ALL: |
brew install pkg-config
cd buildconfig/macdependencies
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
bash ./install_mac_deps.sh
CIBW_BEFORE_BUILD: |
pip install requests numpy Sphinx
pip install requests numpy Sphinx"<7.2.0"
python setup.py docs
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
Expand All @@ -159,27 +160,28 @@ jobs:
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: pip cache
uses: actions/[email protected].1
uses: actions/[email protected].3
with:
path: ~/Library/Caches/pip # This cache path is only right on mac
key: pip-cache-${{ matrix.name }}

- name: Fetch Mac deps
id: macdep-cache
uses: actions/[email protected].1
uses: actions/[email protected].3
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
fail-on-cache-miss: true

- name: Build and test wheels
uses: pypa/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.16.2

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

19 changes: 10 additions & 9 deletions .github/workflows/build-manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ jobs:
# also define environment variables needed for testing
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk

CIBW_BUILD: "cp3{[7-9],10,11}-* pp3[7-9]-*"
CIBW_BUILD: "cp3{8,9,10,11,12}-* pp3{8,9,10}-*"
CIBW_ARCHS: ${{ matrix.arch }}

# skip musllinux for now
CIBW_SKIP: '*-musllinux_*'

# command that runs before every build
CIBW_BEFORE_BUILD: |
pip install Sphinx
pip install Sphinx"<7.2.0"
python setup.py docs
CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,music,timing --time_out 300
Expand All @@ -79,10 +79,10 @@ jobs:
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: Log in to the Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ghcr.io
username: ${{ github.actor }}
Expand All @@ -95,14 +95,14 @@ jobs:

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c
with:
images: ghcr.io/${{ github.repository }}_${{ matrix.arch }}
tags: type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }}

- name: Build and push Docker image
if: steps.inspect.outcome == 'failure'
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56
with:
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
Expand All @@ -118,12 +118,13 @@ 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/cibuildwheel@v2.13.1
uses: pypa/cibuildwheel@v2.16.2

# We upload the generated files under github actions assets
- name: Upload dist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-manylinux
name: pygame-wheels-manylinux-${{ matrix.arch }}
path: ./wheelhouse/*.whl
compression-level: 0 # wheels are already zip files, no need for more compression

12 changes: 8 additions & 4 deletions .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,19 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/checkout@v3.5.3
- uses: actions/checkout@v4.1.1

- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
# and has typestubs
# https://github.com/actions/runner-images/issues/7192
# https://github.com/orgs/community/discussions/47863
run: |
sudo apt-mark hold grub-efi-amd64-signed
sudo apt-get update --fix-missing
sudo apt-get upgrade
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
pip3 install sphinx numpy>=1.21.0
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-setuptools python3-dev
pip3 install sphinx"<7.2.0" numpy>=1.21.0
- name: Make sdist and install it
env:
Expand All @@ -85,8 +88,9 @@ jobs:
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-20.04' # upload sdist only once
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-sdist
path: dist/*.tar.gz
compression-level: 0 # already compressed, no need for more compression

Loading

0 comments on commit cdce447

Please sign in to comment.