Skip to content

Commit

Permalink
Merge branch 'pygame-community:main' into sprite-collision
Browse files Browse the repository at this point in the history
  • Loading branch information
aatle authored Nov 20, 2024
2 parents 97f3bb9 + 816bd77 commit 1307e2e
Show file tree
Hide file tree
Showing 43 changed files with 1,137 additions and 333 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/build-sdl3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ jobs:
sudo cmake --install . --config Release
- name: Build with SDL3
run: >
python3 -m pip install . -v -Csetup-args=-Dsdl_api=3
-Csetup-args=-Dimage=disabled
-Csetup-args=-Dmixer=disabled
-Csetup-args=-Dfont=disabled
run: python3 dev.py build --sdl3

# eventually we need to run all tests, but for now test that importing pygame
# works
- name: Test import works
run: python3 -c 'import pygame'

# - name: Run tests
# env:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/build-ubuntu-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,17 @@ jobs:
- uses: actions/[email protected]

- 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-get update --fix-missing
sudo apt-get install lcov -y
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev -y
pip3 install --upgrade pip
pip3 install meson-python ninja cython "sphinx<=7.2.6" # because we are doing --no-build-isolation
pip3 install numpy>=1.21.0
- name: Build with coverage hooks and install
id: build
run: |
pip3 install -e . --no-build-isolation -Cbuild-dir=./.mesonpy-rel -Csetup-args=-Dcoverage=true
python3 dev.py build --coverage
- name: Run tests
env:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
strategy:
fail-fast: false # if a particular matrix build fails, don't skip the rest
matrix:
os: [ubuntu-24.04, ubuntu-22.04]
os: [ubuntu-22.04]

env:
# Pip now forces us to either make a venv or set this flag, so we will do
Expand Down Expand Up @@ -89,7 +89,6 @@ jobs:
# We upload the generated files under github actions assets
- name: Upload sdist
if: matrix.os == 'ubuntu-24.04' # upload sdist only once
uses: actions/upload-artifact@v4
with:
name: pygame-wheels-sdist
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/dev-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: python3 dev.py all

# Run CI on changes to main branch, or any PR to main. Do not run CI on
# any other branch.
# Run on changes to all files.
on:
push:
branches: main

pull_request:
branches: main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-dev-check
cancel-in-progress: true

jobs:
dev-check:
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

# We are using dependencies installed from apt
PG_DEPS_FROM_SYSTEM: 1

# environment variables to set while testing
SDL_VIDEODRIVER: "dummy"
SDL_AUDIODRIVER: "disk"

steps:
- uses: actions/[email protected]

- name: Install deps
run: |
sudo apt-get update --fix-missing
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev
- name: Check dev.py all
run: python3 dev.py all
65 changes: 0 additions & 65 deletions .github/workflows/format-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/release-gh-draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: echo "VER=${GITHUB_REF_NAME#'release/'}" >> $GITHUB_OUTPUT

- name: Generate release attestation
uses: actions/[email protected].3
uses: actions/[email protected].4
with:
subject-path: "pygame-wheels/*"

Expand Down
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
|PyPiVersion| |PyPiLicense|
|Python3| |GithubCommits| |BlackFormatBadge|

**English** `简体中文`_ `繁體中文`_ `Français`_ `فارسی`_ `Español`_ `日本語`_ `Italiano`_
**English** `简体中文`_ `繁體中文`_ `Français`_ `فارسی`_ `Español`_ `日本語`_ `Italiano`_ `Русский`_
---------------------------------------------------------------------------------------------------

Pygame_ is a free and open-source cross-platform library
Expand Down Expand Up @@ -141,7 +141,7 @@ Dependency versions:
+----------+------------------------+
| CPython | >= 3.8 (Or use PyPy3) |
+----------+------------------------+
| SDL | >= 2.0.10 |
| SDL | >= 2.0.14 |
+----------+------------------------+
| SDL_mixer| >= 2.0.4 |
+----------+------------------------+
Expand Down Expand Up @@ -221,3 +221,4 @@ See docs/licenses for licenses of dependencies.
.. _Español: ./docs/readmes/README.es.rst
.. _日本語: ./docs/readmes/README.ja.rst
.. _Italiano: ./docs/readmes/README.it.rst
.. _Русский: ./docs/readmes/README.ru.rst
5 changes: 2 additions & 3 deletions buildconfig/stubs/pygame/geometry.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ from typing import (
Callable,
Protocol,
Tuple,
Sequence,
List,
)

Expand Down Expand Up @@ -120,8 +119,8 @@ class Circle:
@overload
def colliderect(self, topleft: Point, size: Point, /) -> bool: ...
def collideswith(self, other: _CanBeCollided, /) -> bool: ...
def collidelist(self, colliders: Sequence[_CanBeCollided], /) -> int: ...
def collidelistall(self, colliders: Sequence[_CanBeCollided], /) -> List[int]: ...
def collidelist(self, colliders: SequenceLike[_CanBeCollided], /) -> int: ...
def collidelistall(self, colliders: SequenceLike[_CanBeCollided], /) -> List[int]: ...
def intersect(self, other: _CanBeIntersected, /) -> List[Tuple[float, float]]: ...
def contains(self, shape: _CanBeCollided, /) -> bool: ...
@overload
Expand Down
10 changes: 6 additions & 4 deletions buildconfig/stubs/pygame/pixelarray.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from typing import Any, Dict, Tuple, Union, overload

from pygame.surface import Surface
from pygame.color import Color
from pygame.typing import SequenceLike

from pygame.typing import ColorLike, SequenceLike
_ColorLike = int | Color | tuple[int, int, int] | tuple[int, int, int, int]

class PixelArray:
surface: Surface
Expand Down Expand Up @@ -34,14 +36,14 @@ class PixelArray:
def make_surface(self) -> Surface: ...
def replace(
self,
color: ColorLike,
repcolor: ColorLike,
color: _ColorLike,
repcolor: _ColorLike,
distance: float = 0,
weights: SequenceLike[float] = (0.299, 0.587, 0.114),
) -> None: ...
def extract(
self,
color: ColorLike,
color: _ColorLike,
distance: float = 0,
weights: SequenceLike[float] = (0.299, 0.587, 0.114),
) -> PixelArray: ...
Expand Down
Loading

0 comments on commit 1307e2e

Please sign in to comment.