Skip to content

Commit

Permalink
Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0id committed Jun 21, 2023
2 parents 5f1a8db + 58eeb4c commit d1c5556
Show file tree
Hide file tree
Showing 109 changed files with 14,527 additions and 9,025 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-debian-multiarch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
arch: [s390x, ppc64le]

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Build sources and run tests
uses: uraimo/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-emsdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
WHEELHOUSE_CYTHON: /tmp/wheelhouse/cython

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Cache Cython
id: cache-cython
uses: actions/cache@v3
uses: actions/cache@v3.3.1
with:
path: ${{ env.WHEELHOUSE_CYTHON }}
key: wasm-ubuntu-cython-${{ env.LATEST_CYTHON_COMMIT }}-path-${{ env.WHEELHOUSE_CYTHON }}
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ jobs:
macarch: [arm64, x86_64]

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Test for Mac Deps cache hit
id: macdep-cache
uses: actions/cache@v3.0.2
uses: actions/cache@v3.3.1
with:
path: ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }}
# The hash of all files in buildconfig manylinux-build and macdependencies is
# the key to the cache. If anything changes here, the deps are built again
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
lookup-only: true

# build mac deps on cache miss
- name: Build Mac Deps
Expand Down Expand Up @@ -116,6 +117,7 @@ jobs:
}

env:
MAC_ARCH: ${{ matrix.macarch }}
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
# because this should not affect cibuildwheel machinery
# also define environment variables needed for testing
Expand All @@ -129,7 +131,6 @@ jobs:

# Setup MacOS dependencies
CIBW_BEFORE_ALL: |
export MAC_ARCH="${{ matrix.macarch }}"
brew install pkg-config
cd buildconfig/macdependencies
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
Expand All @@ -149,23 +150,24 @@ jobs:
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: pip cache
uses: actions/cache@v3.0.2
uses: actions/cache@v3.3.1
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/cache@v3.0.2
uses: actions/cache@v3.3.1
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.12.3
uses: pypa/cibuildwheel@v2.13.1

- uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build-manylinux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ jobs:
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
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@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
uses: docker/metadata-action@818d4b7b91585d195f67373fd9cb0332e31a7175
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@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
Expand All @@ -118,7 +118,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/cibuildwheel@v2.12.3
uses: pypa/cibuildwheel@v2.13.1

# We upload the generated files under github actions assets
- name: Upload dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-ubuntu-sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
os: [ubuntu-20.04, ubuntu-22.04]

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Install deps
# install numpy from pip and not apt because the one from pip is newer,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
CIBW_BUILD_VERBOSITY: 2

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- uses: TheMrMilchmann/setup-msvc-dev@v2 # this lets us use the developer command prompt on windows
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Install deps
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Install deps
run: python3 -m pip install pylint black clang-format sphinx
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 @@ -21,7 +21,7 @@ jobs:
needs: [manylinux, macos, windows, sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Download all artifacts
uses: actions/download-artifact@v3
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 @@ -8,7 +8,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].2
- uses: actions/[email protected].3

- name: Pull all release assets
uses: robinraju/[email protected]
Expand Down
9 changes: 5 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
|PyPiVersion| |PyPiLicense|
|Python3| |GithubCommits| |BlackFormatBadge|

**English** `简体中文`_ `Français`_
**English** `简体中文`_ `Français`_ `فارسی`_
---------------------------------------------------------------------------------------------------

Pygame_ is a free and open-source cross-platform library
Expand Down Expand Up @@ -182,8 +182,8 @@ See docs/licenses for licenses of dependencies.

.. |Python3| image:: https://img.shields.io/badge/python-3-blue.svg?v=1

.. |GithubCommits| image:: https://img.shields.io/github/commits-since/pygame-community/pygame-ce/2.2.1.svg
:target: https://github.com/pygame-community/pygame-ce/compare/2.2.1...main
.. |GithubCommits| image:: https://img.shields.io/github/commits-since/pygame-community/pygame-ce/2.3.0.svg
:target: https://github.com/pygame-community/pygame-ce/compare/2.3.0...main

.. |DocsStatus| image:: https://img.shields.io/website?down_message=offline&label=docs&up_message=online&url=https%3A%2F%2Fpyga.me%2Fdocs%2F
:target: https://pyga.me/docs/
Expand All @@ -199,4 +199,5 @@ See docs/licenses for licenses of dependencies.
.. _GNU LGPL version 2.1: https://www.gnu.org/copyleft/lesser.html

.. _简体中文: ./docs/readmes/README.zh-cn.rst
.. _Français: ./docs/readmes/README.fr.rst
.. _Français: ./docs/readmes/README.fr.rst
.. _فارسی: ./docs/readmes/README.fa.rst
5 changes: 3 additions & 2 deletions buildconfig/Setup.Android.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ _sdl2.audio src_c/_sdl2/audio.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.video src_c/_sdl2/video.c src_c/pgcompat.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.mixer src_c/_sdl2/mixer.c $(SDL) $(MIXER) $(DEBUG) -Isrc_c
_sdl2.touch src_c/_sdl2/touch.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.controller_old src_c/_sdl2/controller_old.c $(SDL) $(DEBUG) -Isrc_c

GFX = src_c/SDL_gfx/SDL_gfxPrimitives.c
#GFX = src_c/SDL_gfx/SDL_gfxBlitFunc.c src_c/SDL_gfx/SDL_gfxPrimitives.c
Expand All @@ -51,7 +51,7 @@ key src_c/key.c $(SDL) $(DEBUG)
mouse src_c/mouse.c $(SDL) $(DEBUG)
rect src_c/rect.c src_c/pgcompat_rect.c $(SDL) $(DEBUG)
rwobject src_c/rwobject.c $(SDL) $(DEBUG)
surface src_c/surface.c src_c/alphablit.c src_c/surface_fill.c $(SDL) $(DEBUG)
surface src_c/simd_blitters_sse2.c src_c/simd_blitters_avx2.c src_c/surface.c src_c/alphablit.c src_c/surface_fill.c $(SDL) $(DEBUG)
surflock src_c/surflock.c $(SDL) $(DEBUG)
time src_c/time.c $(SDL) $(DEBUG)
joystick src_c/joystick.c $(SDL) $(DEBUG)
Expand All @@ -64,3 +64,4 @@ pixelarray src_c/pixelarray.c $(SDL) $(DEBUG)
math src_c/math.c $(SDL) $(DEBUG)
pixelcopy src_c/pixelcopy.c $(SDL) $(DEBUG)
newbuffer src_c/newbuffer.c $(SDL) $(DEBUG)
_window src_c/window.c $(SDL) $(DEBUG)
1 change: 1 addition & 0 deletions buildconfig/Setup.Emscripten.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ surflock src_c/void.c
rect src_c/void.c
rwobject src_c/void.c
system src_c/void.c
_window src_c/void.c

#_sdl2.controller src_c/_sdl2/controller.c $(SDL) $(DEBUG) -Isrc_c
_sdl2.controller_old src_c/void.c
Expand Down
1 change: 1 addition & 0 deletions buildconfig/Setup.SDL2.in
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ math src_c/math.c $(SDL) $(DEBUG)
pixelcopy src_c/pixelcopy.c $(SDL) $(DEBUG)
newbuffer src_c/newbuffer.c $(SDL) $(DEBUG)
system src_c/system.c $(SDL) $(DEBUG)
_window src_c/window.c $(SDL) $(DEBUG)
2 changes: 1 addition & 1 deletion buildconfig/manylinux-build/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build on an old Linux distribution in a docker container.
manylinux is an older linux with a fairly compatible ABI, so you can make linux binary
wheels that run on many different linux distros.

* https://github.com/pygame/pygame/issues/295
* https://github.com/pygame-community/pygame-ce/issues/310
* https://github.com/pypa/auditwheel
* https://github.com/pypa/manylinux
* https://hub.docker.com/u/pygame/
Expand Down
2 changes: 1 addition & 1 deletion buildconfig/stubs/gen_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"font": ["Font"],
"mixer": ["Channel"],
"time": ["Clock"],
"joystick": ["Joystick"]
"joystick": ["Joystick"],
}

# pygame modules from which __init__.py does the equivalent of
Expand Down
2 changes: 2 additions & 0 deletions buildconfig/stubs/pygame/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,8 @@ from .constants import (
WINDOWMAXIMIZED as WINDOWMAXIMIZED,
WINDOWMINIMIZED as WINDOWMINIMIZED,
WINDOWMOVED as WINDOWMOVED,
WINDOWPOS_CENTERED as WINDOWPOS_CENTERED,
WINDOWPOS_UNDEFINED as WINDOWPOS_UNDEFINED,
WINDOWRESIZED as WINDOWRESIZED,
WINDOWRESTORED as WINDOWRESTORED,
WINDOWSHOWN as WINDOWSHOWN,
Expand Down
13 changes: 8 additions & 5 deletions buildconfig/stubs/pygame/_sdl2/video.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, Generator, Iterable, Optional, Tuple, Union
from typing import Any, Generator, Iterable, Optional, Tuple, Union, final

from pygame.color import Color
from pygame.rect import Rect
Expand Down Expand Up @@ -38,11 +38,12 @@ def messagebox(
escape_button: int = 0,
) -> int: ...

@final
class Window:
DEFAULT_SIZE: Tuple[Literal[640], Literal[480]]
def __init__(
self,
title: str = "pygame",
title: str = "pygame window",
size: Iterable[int] = (640, 480),
position: Optional[Iterable[int]] = None,
fullscreen: bool = False,
Expand Down Expand Up @@ -73,6 +74,8 @@ class Window:
display_index: int
def set_modal_for(self, Window) -> None: ...

_Window = Window

class Texture:
def __init__(
self,
Expand Down Expand Up @@ -133,7 +136,7 @@ class Texture:
class Image:
def __init__(
self,
textureOrImage: Union[Texture, Image],
texture_or_image: Union[Texture, Image],
srcrect: Optional[RectValue] = None,
) -> None: ...
def get_rect(self, **kwargs: Any) -> Rect: ...
Expand All @@ -153,14 +156,14 @@ class Image:
class Renderer:
def __init__(
self,
window: Window,
window: Union[Window,_Window],
index: int = -1,
accelerated: int = -1,
vsync: bool = False,
target_texture: bool = False,
) -> None: ...
@classmethod
def from_window(cls, window: Window) -> Renderer: ...
def from_window(cls, window: Union[Window,_Window]) -> Renderer: ...
draw_blend_mode: int
draw_color: Color
def clear(self) -> None: ...
Expand Down
1 change: 1 addition & 0 deletions buildconfig/stubs/pygame/_sdl2/window.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from pygame._sdl2.video import _Window as Window
38 changes: 38 additions & 0 deletions buildconfig/stubs/pygame/_window.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from typing import Iterable, Optional, Tuple, Union, final
from pygame.surface import Surface
from ._common import RectValue
from pygame.locals import WINDOWPOS_UNDEFINED

def get_grabbed_window() -> Optional[Window]: ...
@final
class Window:
def __init__(
self,
title: str = "pygame window",
size: Iterable[int] = (640, 480),
position: Union[int, Iterable[int]] = WINDOWPOS_UNDEFINED,
**flags: bool
) -> None: ...
def destroy(self) -> None: ...
def set_windowed(self) -> None: ...
def set_fullscreen(self, desktop: bool = False) -> None: ...
def focus(self, input_only: bool = False) -> None: ...
def hide(self) -> None: ...
def show(self) -> None: ...
def restore(self) -> None: ...
def maximize(self) -> None: ...
def minimize(self) -> None: ...
def set_modal_for(self, parent: Window) -> None: ...
def set_icon(self, icon: Surface) -> None: ...
grab: bool
title: str
resizable: bool
borderless: bool
relative_mouse: bool
id: int
size: Iterable[int]
position: Union[int, Iterable[int]]
opacity: float
display_index: int
@classmethod
def from_display_module(cls) -> Window: ...
2 changes: 2 additions & 0 deletions buildconfig/stubs/pygame/constants.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,8 @@ WINDOWLEAVE: int
WINDOWMAXIMIZED: int
WINDOWMINIMIZED: int
WINDOWMOVED: int
WINDOWPOS_CENTERED: int
WINDOWPOS_UNDEFINED: int
WINDOWRESIZED: int
WINDOWRESTORED: int
WINDOWSHOWN: int
Expand Down
2 changes: 2 additions & 0 deletions buildconfig/stubs/pygame/locals.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,8 @@ WINDOWLEAVE: int
WINDOWMAXIMIZED: int
WINDOWMINIMIZED: int
WINDOWMOVED: int
WINDOWPOS_CENTERED: int
WINDOWPOS_UNDEFINED: int
WINDOWRESIZED: int
WINDOWRESTORED: int
WINDOWSHOWN: int
Expand Down
1 change: 1 addition & 0 deletions buildconfig/stubs/pygame/mixer.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Channel:
def unpause(self) -> None: ...
def fadeout(self, time: int) -> None: ...
def queue(self, sound: Sound) -> None: ...
def set_source_location(self, angle:float, distance:float) -> None: ...
@overload
def set_volume(self, value: float) -> None: ...
@overload
Expand Down
Loading

0 comments on commit d1c5556

Please sign in to comment.