Skip to content

Commit 1307e2e

Browse files
authored
Merge branch 'pygame-community:main' into sprite-collision
2 parents 97f3bb9 + 816bd77 commit 1307e2e

Some content is hidden

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

43 files changed

+1137
-333
lines changed

.github/workflows/build-sdl3.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,12 @@ jobs:
8585
sudo cmake --install . --config Release
8686
8787
- name: Build with SDL3
88-
run: >
89-
python3 -m pip install . -v -Csetup-args=-Dsdl_api=3
90-
-Csetup-args=-Dimage=disabled
91-
-Csetup-args=-Dmixer=disabled
92-
-Csetup-args=-Dfont=disabled
88+
run: python3 dev.py build --sdl3
89+
90+
# eventually we need to run all tests, but for now test that importing pygame
91+
# works
92+
- name: Test import works
93+
run: python3 -c 'import pygame'
9394

9495
# - name: Run tests
9596
# env:

.github/workflows/build-ubuntu-coverage.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,17 @@ jobs:
6161
- uses: actions/checkout@v4.2.2
6262

6363
- name: Install deps
64-
# install numpy from pip and not apt because the one from pip is newer,
65-
# and has typestubs
6664
# https://github.com/actions/runner-images/issues/7192
6765
# https://github.com/orgs/community/discussions/47863
6866
run: |
6967
sudo apt-get update --fix-missing
7068
sudo apt-get install lcov -y
7169
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev -y
72-
pip3 install --upgrade pip
73-
pip3 install meson-python ninja cython "sphinx<=7.2.6" # because we are doing --no-build-isolation
74-
pip3 install numpy>=1.21.0
7570
7671
- name: Build with coverage hooks and install
7772
id: build
7873
run: |
79-
pip3 install -e . --no-build-isolation -Cbuild-dir=./.mesonpy-rel -Csetup-args=-Dcoverage=true
74+
python3 dev.py build --coverage
8075
8176
- name: Run tests
8277
env:

.github/workflows/build-ubuntu-sdist.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
strategy:
4949
fail-fast: false # if a particular matrix build fails, don't skip the rest
5050
matrix:
51-
os: [ubuntu-24.04, ubuntu-22.04]
51+
os: [ubuntu-22.04]
5252

5353
env:
5454
# Pip now forces us to either make a venv or set this flag, so we will do
@@ -89,7 +89,6 @@ jobs:
8989
9090
# We upload the generated files under github actions assets
9191
- name: Upload sdist
92-
if: matrix.os == 'ubuntu-24.04' # upload sdist only once
9392
uses: actions/upload-artifact@v4
9493
with:
9594
name: pygame-wheels-sdist

.github/workflows/dev-check.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: python3 dev.py all
2+
3+
# Run CI on changes to main branch, or any PR to main. Do not run CI on
4+
# any other branch.
5+
# Run on changes to all files.
6+
on:
7+
push:
8+
branches: main
9+
10+
pull_request:
11+
branches: main
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}-dev-check
15+
cancel-in-progress: true
16+
17+
jobs:
18+
dev-check:
19+
runs-on: ubuntu-24.04
20+
21+
env:
22+
# Pip now forces us to either make a venv or set this flag, so we will do
23+
# this
24+
PIP_BREAK_SYSTEM_PACKAGES: 1
25+
26+
# We are using dependencies installed from apt
27+
PG_DEPS_FROM_SYSTEM: 1
28+
29+
# environment variables to set while testing
30+
SDL_VIDEODRIVER: "dummy"
31+
SDL_AUDIODRIVER: "disk"
32+
33+
steps:
34+
- uses: actions/checkout@v4.2.2
35+
36+
- name: Install deps
37+
run: |
38+
sudo apt-get update --fix-missing
39+
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev python3-dev
40+
41+
- name: Check dev.py all
42+
run: python3 dev.py all

.github/workflows/format-lint.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.github/workflows/release-gh-draft.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: echo "VER=${GITHUB_REF_NAME#'release/'}" >> $GITHUB_OUTPUT
6262

6363
- name: Generate release attestation
64-
uses: actions/attest-build-provenance@v1.4.3
64+
uses: actions/attest-build-provenance@v1.4.4
6565
with:
6666
subject-path: "pygame-wheels/*"
6767

README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
|PyPiVersion| |PyPiLicense|
99
|Python3| |GithubCommits| |BlackFormatBadge|
1010

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

1414
Pygame_ is a free and open-source cross-platform library
@@ -141,7 +141,7 @@ Dependency versions:
141141
+----------+------------------------+
142142
| CPython | >= 3.8 (Or use PyPy3) |
143143
+----------+------------------------+
144-
| SDL | >= 2.0.10 |
144+
| SDL | >= 2.0.14 |
145145
+----------+------------------------+
146146
| SDL_mixer| >= 2.0.4 |
147147
+----------+------------------------+
@@ -221,3 +221,4 @@ See docs/licenses for licenses of dependencies.
221221
.. _Español: ./docs/readmes/README.es.rst
222222
.. _日本語: ./docs/readmes/README.ja.rst
223223
.. _Italiano: ./docs/readmes/README.it.rst
224+
.. _Русский: ./docs/readmes/README.ru.rst

buildconfig/stubs/pygame/geometry.pyi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ from typing import (
44
Callable,
55
Protocol,
66
Tuple,
7-
Sequence,
87
List,
98
)
109

@@ -120,8 +119,8 @@ class Circle:
120119
@overload
121120
def colliderect(self, topleft: Point, size: Point, /) -> bool: ...
122121
def collideswith(self, other: _CanBeCollided, /) -> bool: ...
123-
def collidelist(self, colliders: Sequence[_CanBeCollided], /) -> int: ...
124-
def collidelistall(self, colliders: Sequence[_CanBeCollided], /) -> List[int]: ...
122+
def collidelist(self, colliders: SequenceLike[_CanBeCollided], /) -> int: ...
123+
def collidelistall(self, colliders: SequenceLike[_CanBeCollided], /) -> List[int]: ...
125124
def intersect(self, other: _CanBeIntersected, /) -> List[Tuple[float, float]]: ...
126125
def contains(self, shape: _CanBeCollided, /) -> bool: ...
127126
@overload

buildconfig/stubs/pygame/pixelarray.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from typing import Any, Dict, Tuple, Union, overload
22

33
from pygame.surface import Surface
4+
from pygame.color import Color
5+
from pygame.typing import SequenceLike
46

5-
from pygame.typing import ColorLike, SequenceLike
7+
_ColorLike = int | Color | tuple[int, int, int] | tuple[int, int, int, int]
68

79
class PixelArray:
810
surface: Surface
@@ -34,14 +36,14 @@ class PixelArray:
3436
def make_surface(self) -> Surface: ...
3537
def replace(
3638
self,
37-
color: ColorLike,
38-
repcolor: ColorLike,
39+
color: _ColorLike,
40+
repcolor: _ColorLike,
3941
distance: float = 0,
4042
weights: SequenceLike[float] = (0.299, 0.587, 0.114),
4143
) -> None: ...
4244
def extract(
4345
self,
44-
color: ColorLike,
46+
color: _ColorLike,
4547
distance: float = 0,
4648
weights: SequenceLike[float] = (0.299, 0.587, 0.114),
4749
) -> PixelArray: ...

0 commit comments

Comments
 (0)