Skip to content

Commit aa3b89e

Browse files
committed
Merge branch 'main' of https://github.com/pygame-community/pygame-ce into andrew-c-unit-testing
2 parents 4587071 + 4f0b2b7 commit aa3b89e

File tree

17 files changed

+571
-270
lines changed

17 files changed

+571
-270
lines changed

.github/workflows/build-macos.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
11
name: macOS
22

33
# Run CI only when a release is created, on changes to main branch, or any PR
4-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
5-
# from running on CI
4+
# to main.
65
on:
76
push:
87
branches: main
9-
paths-ignore:
10-
- 'docs/**'
11-
- 'examples/**'
12-
- '.gitignore'
13-
- '*.rst'
14-
- '*.md'
15-
- '.github/workflows/*.yml'
16-
# re-include current file to not be excluded
17-
- '!.github/workflows/build-macos.yml'
188

199
pull_request:
2010
branches: main
21-
paths-ignore:
22-
- 'docs/**'
23-
- 'examples/**'
24-
- '.gitignore'
25-
- '*.rst'
26-
- '*.md'
27-
- '.github/workflows/*.yml'
28-
# re-include current file to not be excluded
29-
- '!.github/workflows/build-macos.yml'
3011

3112
# the github release drafter can call this workflow
3213
workflow_call:

.github/workflows/build-manylinux.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
11
name: ManyLinux
22

33
# Run CI only when a release is created, on changes to main branch, or any PR
4-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
5-
# from running on CI
4+
# to main.
65
on:
76
push:
87
branches: main
9-
paths-ignore:
10-
- 'docs/**'
11-
- 'examples/**'
12-
- '.gitignore'
13-
- '*.rst'
14-
- '*.md'
15-
- '.github/workflows/*.yml'
16-
# re-include current file to not be excluded
17-
- '!.github/workflows/build-manylinux.yml'
188

199
pull_request:
2010
branches: main
21-
paths-ignore:
22-
- 'docs/**'
23-
- 'examples/**'
24-
- '.gitignore'
25-
- '*.rst'
26-
- '*.md'
27-
- '.github/workflows/*.yml'
28-
# re-include current file to not be excluded
29-
- '!.github/workflows/build-manylinux.yml'
3011

3112
# the github release drafter can call this workflow
3213
workflow_call:

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,13 @@
88
name: Ubuntu sdist
99

1010
# Run CI only when a release is created, on changes to main branch, or any PR
11-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
12-
# from running on CI
11+
# to main.
1312
on:
1413
push:
1514
branches: main
16-
paths-ignore:
17-
- 'docs/**'
18-
- 'examples/**'
19-
- '.gitignore'
20-
- '*.rst'
21-
- '*.md'
22-
- '.github/workflows/*.yml'
23-
# re-include current file to not be excluded
24-
- '!.github/workflows/build-ubuntu-sdist.yml'
2515

2616
pull_request:
2717
branches: main
28-
paths-ignore:
29-
- 'docs/**'
30-
- 'examples/**'
31-
- '.gitignore'
32-
- '*.rst'
33-
- '*.md'
34-
- '.github/workflows/*.yml'
35-
# re-include current file to not be excluded
36-
- '!.github/workflows/build-ubuntu-sdist.yml'
3718

3819
# the github release drafter can call this workflow
3920
workflow_call:

.github/workflows/build-windows.yml

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
11
name: Windows
22

33
# Run CI only when a release is created, on changes to main branch, or any PR
4-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
5-
# from running on CI
4+
# to main.
65
on:
76
push:
87
branches: main
9-
paths-ignore:
10-
- 'docs/**'
11-
- 'examples/**'
12-
- '.gitignore'
13-
- '*.rst'
14-
- '*.md'
15-
- '.github/workflows/*.yml'
16-
# re-include current file to not be excluded
17-
- '!.github/workflows/build-windows.yml'
188

199
pull_request:
2010
branches: main
21-
paths-ignore:
22-
- 'docs/**'
23-
- 'examples/**'
24-
- '.gitignore'
25-
- '*.rst'
26-
- '*.md'
27-
- '.github/workflows/*.yml'
28-
# re-include current file to not be excluded
29-
- '!.github/workflows/build-windows.yml'
3011

3112
# the github release drafter can call this workflow
3213
workflow_call:

buildconfig/stubs/pygame/mask.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class Mask:
5353
setcolor: Optional[ColorLike] = (255, 255, 255, 255),
5454
unsetcolor: Optional[ColorLike] = (0, 0, 0, 255),
5555
dest: Union[RectLike, Point] = (0, 0),
56+
area: Optional[RectLike] = None,
5657
) -> Surface: ...
5758
if sys.version_info >= (3, 12):
5859
def __buffer__(self, flags: int, /) -> memoryview[int]: ...

docs/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
if fs.is_dir('generated')
22
# TODO: remove everything in exclude_directories except for 'doctrees'
3+
# These should probably go in a separate package that the main pygame-ce
4+
# package can depend on as optional extras
5+
# https://github.com/pygame-community/pygame-ce/issues/3468
36
install_subdir(
47
'generated',
58
exclude_directories: [
69
'doctrees',
10+
'tutorials/ko',
711
'_sources/tutorials',
812
'_sources/c_api',
913
],

docs/reST/ref/mask.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ to store which parts collide.
570570

571571
| :sl:`Returns a surface with the mask drawn on it`
572572
| :sg:`to_surface() -> Surface`
573-
| :sg:`to_surface(surface=None, setsurface=None, unsetsurface=None, setcolor=(255, 255, 255, 255), unsetcolor=(0, 0, 0, 255), dest=(0, 0)) -> Surface`
573+
| :sg:`to_surface(surface=None, setsurface=None, unsetsurface=None, setcolor=(255, 255, 255, 255), unsetcolor=(0, 0, 0, 255), dest=(0, 0), area=None) -> Surface`
574574
575575
Draws this mask on the given surface. Set bits (bits set to 1) and unset
576576
bits (bits set to 0) can be drawn onto a surface.
@@ -610,6 +610,14 @@ to store which parts collide.
610610
mask (i.e. position ``(0, 0)`` on the mask always corresponds to
611611
position ``(0, 0)`` on the ``setsurface`` and ``unsetsurface``)
612612
:type dest: Rect or tuple(int, int) or list(int, int) or Vector2(int, int)
613+
:param area: (optional) rectangular portion of the mask to draw. It can be a
614+
rect-like object (a Rect, a tuple or a list with 4 numbers or an object with a
615+
rect attribute, etc) or it can be None (the default) in which case it will use the
616+
entire mask. If the given rect pertrudes outside the bounds of the mask (as returned
617+
by :meth:`get_rect`), it will get clipped to fit those boundaries. If the final rect
618+
is smaller than the mask and no destination ``surface`` is given, the returned surface
619+
will have the same size as this final rect.
620+
:type area: Rect or rect-like object
613621

614622
:returns: the ``surface`` parameter (or a newly created surface if no
615623
``surface`` parameter was provided) with this mask drawn on it
@@ -633,6 +641,8 @@ to store which parts collide.
633641
634642
.. versionaddedold:: 2.0.0
635643

644+
.. versionchanged:: 2.5.6 Added the area keyword argument.
645+
636646
.. ## Mask.to_surface ##
637647
638648
.. ## pygame.mask.Mask ##

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "pygame-ce"
3-
version = "2.5.5.dev1"
3+
version = "2.5.6.dev1"
44
description = "Python Game Development"
55
readme = "README.rst" # for long description
66
requires-python = ">=3.9"
@@ -80,6 +80,11 @@ skip = "*-musllinux_*"
8080
# build[uv] is verbose by default, so below flag is not needed here
8181
# build-verbosity = 3
8282

83+
# In CIBW 2, defaults to pypy-enabled, but is throwing warnings about the
84+
# default changing in CIBW 3. So since we use pypy, lets explicitly enable it.
85+
# https://cibuildwheel.pypa.io/en/stable/options/#enable
86+
enable = ["pypy"]
87+
8388
environment = { SDL_VIDEODRIVER="dummy", SDL_AUDIODRIVER="disk" }
8489
test-command = "python -m pygame.tests -v --exclude opengl,music,timing --time_out 300"
8590
test-requires = ["numpy"]

src_c/doc/mask_doc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
#define DOC_MASK_MASK_CONNECTEDCOMPONENT "connected_component() -> Mask\nconnected_component(pos) -> Mask\nReturns a mask containing a connected component"
2626
#define DOC_MASK_MASK_CONNECTEDCOMPONENTS "connected_components() -> [Mask, ...]\nconnected_components(minimum=0) -> [Mask, ...]\nReturns a list of masks of connected components"
2727
#define DOC_MASK_MASK_GETBOUNDINGRECTS "get_bounding_rects() -> [Rect, ...]\nReturns a list of bounding rects of connected components"
28-
#define DOC_MASK_MASK_TOSURFACE "to_surface() -> Surface\nto_surface(surface=None, setsurface=None, unsetsurface=None, setcolor=(255, 255, 255, 255), unsetcolor=(0, 0, 0, 255), dest=(0, 0)) -> Surface\nReturns a surface with the mask drawn on it"
28+
#define DOC_MASK_MASK_TOSURFACE "to_surface() -> Surface\nto_surface(surface=None, setsurface=None, unsetsurface=None, setcolor=(255, 255, 255, 255), unsetcolor=(0, 0, 0, 255), dest=(0, 0), area=None) -> Surface\nReturns a surface with the mask drawn on it"

0 commit comments

Comments
 (0)