โ๏ธ๐๐๏ธ๐๐๐๐๐๏ธ๐นโ๏ธ๐๐๏ธ๐
`pip uninstall pygame` (if previously installed, to avoid package conflicts)
`pip install pygame-ce --upgrade`
โ๏ธ๐๐๏ธ๐๐๐๐๐๏ธ๐นโ๏ธ๐๐๏ธ๐
This release, coming in just four months after the previous one, has been possible due to patches submitted by over 30 contributors, who have collectively made over 132 pull requests with 464 commits that touch 413 files! Impressive!
Now, onto the highlights!
Highlights
API updates
damusss
- added `mouse.get_just_[pressed|released]` in https://github.com/pygame-community/pygame-ce/pull/2836
- added `display.[get|set]_window_position` in https://github.com/pygame-community/pygame-ce/pull/2816
- `(F)Rect` can be initialized with no arguments in https://github.com/pygame-community/pygame-ce/pull/2655
whydoubt added the `pitch` argument for `image.tobytes` in https://github.com/pygame-community/pygame-ce/pull/2602
XFajk added `Color.from_normalized` constructor and `Color.normalized` property in https://github.com/pygame-community/pygame-ce/pull/2693
mzivic7 added `draw.aacircle` in https://github.com/pygame-community/pygame-ce/pull/2800
itzpr3d4t0r added `transform.hsl` in https://github.com/pygame-community/pygame-ce/pull/2398
ScriptLineStudios implemented a few convenience properties to `Surface` class: `Surface.width`, `Surface.height` and `Surface.size` in https://github.com/pygame-community/pygame-ce/pull/2813
bilhox added `math.invlerp` and `math.remap` in https://github.com/pygame-community/pygame-ce/pull/2654
ankith26 added `mixer.get_driver` in https://github.com/pygame-community/pygame-ce/pull/2741
SIMD Performance enhancements
Starbuck5 improved performance of SSE2 `no_surf_alpha_opaque_dst` blitter in https://github.com/pygame-community/pygame-ce/pull/2601 and https://github.com/pygame-community/pygame-ce/pull/2896. As a result of this PR, some kinds of blit operations should get a nice speed up (upto about 2.5x speedup on the testcases we used) on some hardware.
itzpr3d4t0r
- Partially refactor SSE2 blitters with macros in https://github.com/pygame-community/pygame-ce/pull/2656.
- Implemented AVX2 variant of `Surface.premul_alpha` in https://github.com/pygame-community/pygame-ce/pull/2615
MyreMylar added SIMD versions `transform.invert` in https://github.com/pygame-community/pygame-ce/pull/2534. This gives a significant performance boost, and in the example we tested, we have observed a 12x-13x speedup!
More `pygame.geometry` goodies
The recently introduced experimental `pygame.geometry` submodule has gotten more features and polish in this release in the PRs: https://github.com/pygame-community/pygame-ce/pull/2561, https://github.com/pygame-community/pygame-ce/pull/2660, https://github.com/pygame-community/pygame-ce/pull/2634, https://github.com/pygame-community/pygame-ce/pull/2662, https://github.com/pygame-community/pygame-ce/pull/2661, https://github.com/pygame-community/pygame-ce/pull/2709, https://github.com/pygame-community/pygame-ce/pull/2791, https://github.com/pygame-community/pygame-ce/pull/2732, https://github.com/pygame-community/pygame-ce/pull/2731
A big thanks to everyone who contributed to pygame-geometry so far: Emc2356, itzpr3d4t0r, novialriptide, ScriptLineStudios, avaxar, gresm, Matiiss, newpaxonian, maqa41, and blankRiot96
As with all experimental submodules, do remember that things in here are subject to change, and there are a lot more things to be added! See the docs for the current progress.
Other general highlights
oddbookworm added `opengl` support to the experimental `pygame.Window` interface in https://github.com/pygame-community/pygame-ce/pull/2659
ankith26 added Wayland and PipeWire support in the linux wheels distributed by us in https://github.com/pygame-community/pygame-ce/pull/1997 and https://github.com/pygame-community/pygame-ce/pull/2733
ankith26 rewrote the build machinery in the `meson` buildsystem, while deprecating the old build machinery in the PRs https://github.com/pygame-community/pygame-ce/pull/2557, https://github.com/pygame-community/pygame-ce/pull/2803, https://github.com/pygame-community/pygame-ce/pull/2853, https://github.com/pygame-community/pygame-ce/pull/2856, https://github.com/pygame-community/pygame-ce/pull/2875, https://github.com/pygame-community/pygame-ce/pull/2854, https://github.com/pygame-community/pygame-ce/pull/2831, https://github.com/pygame-community/pygame-ce/pull/2779. As part of these changes, a few improvements are:
- On 32-bit ARMv7 systems (which includes many Raspberry Pi), NEON (SIMD) optimizations are now enabled by default. Therefore users of this should see a significant performance boost in many operations that can support SIMD.
- Enhanced support for Windows MinGW/MSYS2 systems.
- Reduced wheel size.
Deprecations and Removals
Starbuck5 removed the `pygame.threads` submodule in https://github.com/pygame-community/pygame-ce/pull/2762
oddbookworm re-added and properly deprecated the `blend` argument of `draw.aaline` in https://github.com/pygame-community/pygame-ce/pull/2743
Performance Enhancements
*In addition to those mentioned above that are SIMD-related*
itzpr3d4t0r
- Optimized `(F)Rect.unionall(_ip)` in https://github.com/pygame-community/pygame-ce/pull/2784
- Optimized `(F)Rect.collideXX` family of methods in https://github.com/pygame-community/pygame-ce/pull/2786
- Replaced use of internal C-API functions with more efficient alternatives in https://github.com/pygame-community/pygame-ce/pull/2819
Bug fixes
oddbookworm added shim to fix broken `midi` module compilation in https://github.com/pygame-community/pygame-ce/pull/2863
ankith26
- fixed some init related issues in the experimental `window` API in https://github.com/pygame-community/pygame-ce/pull/2860
- fixed segmentation fault during invalid `PixelArray` usage in https://github.com/pygame-community/pygame-ce/pull/2742
General Enhancements
Kn4ughty made error messages for using `font` align clearer in https://github.com/pygame-community/pygame-ce/pull/2777
pmp-p ensured we keep supporting pygame on the web in
- wasm: unify pygame-web/pyodide/static Freetype init in https://github.com/pygame-community/pygame-ce/pull/2748
- fixed some `METH_NOARGS` arg missing in https://github.com/pygame-community/pygame-ce/pull/2888
damusss
- made `transform` blur on a surface with either width or height equal to 0 not raise `ValueError` in https://github.com/pygame-community/pygame-ce/pull/2852
- Cleanup codebase, docs and examples with American spelling in https://github.com/pygame-community/pygame-ce/pull/2827
Starbuck5 added a `briefcase` template to pygame-ce in https://github.com/pygame-community/pygame-ce/pull/2862
RainRat fixed typos across the repository in https://github.com/pygame-community/pygame-ce/pull/2847
robertpfeiffer relax `Surface.convert` conditions in https://github.com/pygame-community/pygame-ce/pull/2839, now it is no longer a requirement to have called `display.set_mode` when this method has been invoked with a
oddbookworm removed the xwayland warning and ensured that debug info now contains whether x11 is running or xwayland in https://github.com/pygame-community/pygame-ce/pull/2823
Examples and Unit tests
snowfruit added an example for retro scaling in https://github.com/pygame-community/pygame-ce/pull/2785
Matiiss removed undefined variable in `aliens.py` in https://github.com/pygame-community/pygame-ce/pull/2769
Starbuck5 fixed `ftfont_test` being run directly in https://github.com/pygame-community/pygame-ce/pull/2763
MyreMylar
- Add a delta of 2 ms to test_music_pause__unpause() in https://github.com/pygame-community/pygame-ce/pull/2898
ankith26
- Force window surface update after set_size, hopefully proper fix for that pesky frequent pypy test fail in https://github.com/pygame-community/pygame-ce/pull/2865
- Minor changes to support pytest in https://github.com/pygame-community/pygame-ce/pull/2675
Docs, Tutorials and typestubs
lispspb
- fixed documentation mix up in attributes of object returned by `get_power_state` in https://github.com/pygame-community/pygame-ce/pull/2734
- added clarifications about ranges in `mixer` docs in https://github.com/pygame-community/pygame-ce/pull/2738
kritserv fixed an issue in `pygame.display.get_caption` docs in https://github.com/pygame-community/pygame-ce/pull/2765
yohanmoon added instructions for resolving setuptools issue in the docs readme in https://github.com/pygame-community/pygame-ce/pull/2868
Matiiss added more `/` (positional-only notation) to docs and stubs in https://github.com/pygame-community/pygame-ce/pull/2691
oddbookworm fixed indentation of surface attributes in https://github.com/pygame-community/pygame-ce/pull/2900
ankith26 did some minor docs/stubs improvements in `invlerp`/`remap` in https://github.com/pygame-community/pygame-ce/pull/2902
Starbuck5 added warning about 7.1 stereo on `set_source_location` in https://github.com/pygame-community/pygame-ce/pull/2881
MyreMylar
- removed duplicate images in tutorials in https://github.com/pygame-community/pygame-ce/pull/2871
- including `print_debug_info()` in issue template in https://github.com/pygame-community/pygame-ce/pull/2879
- adjusted symbol color in light theme in https://github.com/pygame-community/pygame-ce/pull/2891
Code quality and robustness
cclauss
- Minor optimizations by using comprehensions in https://github.com/pygame-community/pygame-ce/pull/2771
- PEP572 Use Python's assignment expression in https://github.com/pygame-community/pygame-ce/pull/2782
- Remove lint logic from `setup.py` in https://github.com/pygame-community/pygame-ce/pull/2796
- `setup.py`: Properly add `_sdl2_data_files` to `data_files` in https://github.com/pygame-community/pygame-ce/pull/2770
Lumiobyte fix a comment typo in `rect_impl.h` in https://github.com/pygame-community/pygame-ce/pull/2658
Matiiss reduced redundancy in `surface.fblits` code and handled generator exception in https://github.com/pygame-community/pygame-ce/pull/2679
oddbookworm applied formatting updates using newest version of clang-format in https://github.com/pygame-community/pygame-ce/pull/2744
itzpr3d4t0r
- removed shuffle masks in AVX fillers in https://github.com/pygame-community/pygame-ce/pull/2642
- simplified SIMD fill algorithms in https://github.com/pygame-community/pygame-ce/pull/2793
Starbuck5
- Unify freetype init codepaths in https://github.com/pygame-community/pygame-ce/pull/2801
- (Freetype) use calloc where possible in https://github.com/pygame-community/pygame-ce/pull/2802
- Cleanup `rwobject.c` file object methods in https://github.com/pygame-community/pygame-ce/pull/2717
- gitignore meson temp folder in https://github.com/pygame-community/pygame-ce/pull/2805
- Use `HasColorKey` before `GetColorKey` in https://github.com/pygame-community/pygame-ce/pull/2835 and https://github.com/pygame-community/pygame-ce/pull/2844
ankith26
- Remove docs non-public module stubs in https://github.com/pygame-community/pygame-ce/pull/2794
- Fix pylint undefined usage error in sysfont in https://github.com/pygame-community/pygame-ce/pull/2858
- Add explicit check and error for system cursor in https://github.com/pygame-community/pygame-ce/pull/2843
- Track version only in pyproject.toml in https://github.com/pygame-community/pygame-ce/pull/2820
- Remove all `.editorconfig` duplicates, re-add in project root with updates in https://github.com/pygame-community/pygame-ce/pull/2788
Dependencies, DevOps and CI
cclauss helped us improve our DevOps and CI
- `python3 setup.py lint` is deprecated: Let's lint with `pre-commit` in https://github.com/pygame-community/pygame-ce/pull/2772
- `build-on-msys2.yml`: Upgrade GitHub `actions/checkoutv4` in https://github.com/pygame-community/pygame-ce/pull/2812
- Format Python code with ruff format instead of black in https://github.com/pygame-community/pygame-ce/pull/2824
Starbuck5 continued working on changes that make our code ready for SDL3
- `transform.scale`: softstretch SDL2/SDL3 compat in https://github.com/pygame-community/pygame-ce/pull/2707
- SDL2/SDL3 mutex support in https://github.com/pygame-community/pygame-ce/pull/2712
- Simple SDL3 patches for `freetype`, `surface` and `mouse` in https://github.com/pygame-community/pygame-ce/pull/2838
- Use macros for `[Bytes|Bits]PerPixel` compat in SDL3 in https://github.com/pygame-community/pygame-ce/pull/2804
ankith26
- bumped gh actions mac runners (gets us native M1 builds) in https://github.com/pygame-community/pygame-ce/pull/2494
- kept the CI running by fixing a few dependency update related issues in https://github.com/pygame-community/pygame-ce/pull/2774, https://github.com/pygame-community/pygame-ce/pull/2778 and https://github.com/pygame-community/pygame-ce/pull/2916
- fixed `python -m docs` dev time convenience command in https://github.com/pygame-community/pygame-ce/pull/2889
MyreMylar altered our CODEOWNERS file to switch required PR review team in https://github.com/pygame-community/pygame-ce/pull/2873
Matiiss, oddbookworm, and Starbuck5 kept our `SDL` dependency updated in https://github.com/pygame-community/pygame-ce/pull/2689, https://github.com/pygame-community/pygame-ce/pull/2690, https://github.com/pygame-community/pygame-ce/pull/2705, https://github.com/pygame-community/pygame-ce/pull/2761, https://github.com/pygame-community/pygame-ce/pull/2806, https://github.com/pygame-community/pygame-ce/pull/2837
dependabot kept all our CI dependencies updated in https://github.com/pygame-community/pygame-ce/pull/2814, https://github.com/pygame-community/pygame-ce/pull/2809, https://github.com/pygame-community/pygame-ce/pull/2767, https://github.com/pygame-community/pygame-ce/pull/2755, https://github.com/pygame-community/pygame-ce/pull/2756, https://github.com/pygame-community/pygame-ce/pull/2754, https://github.com/pygame-community/pygame-ce/pull/2747, https://github.com/pygame-community/pygame-ce/pull/2746, https://github.com/pygame-community/pygame-ce/pull/2736, https://github.com/pygame-community/pygame-ce/pull/2730, https://github.com/pygame-community/pygame-ce/pull/2683, https://github.com/pygame-community/pygame-ce/pull/2628, https://github.com/pygame-community/pygame-ce/pull/2874, https://github.com/pygame-community/pygame-ce/pull/2861, https://github.com/pygame-community/pygame-ce/pull/2851, https://github.com/pygame-community/pygame-ce/pull/2833
Starbuck5 and ankith26 kept them releases coming in at https://github.com/pygame-community/pygame-ce/pull/2631, https://github.com/pygame-community/pygame-ce/pull/2817, https://github.com/pygame-community/pygame-ce/pull/2818, https://github.com/pygame-community/pygame-ce/pull/2903, https://github.com/pygame-community/pygame-ce/pull/2904, https://github.com/pygame-community/pygame-ce/pull/2921
New Contributors
This release we have had 11 new contributors, special thanks to everyone getting started!
* Lumiobyte made their first contribution in 2658
* XFajk made their first contribution in 2693
* whydoubt made their first contribution in 2602
* lispspb made their first contribution in 2734
* kritserv made their first contribution in 2765
* cclauss made their first contribution in 2770
* Kn4ughty made their first contribution in 2777
* snowfruit made their first contribution in 2785
* RainRat made their first contribution in 2847
* yohanmoon made their first contribution in 2868
* mzivic7 made their first contribution in 2800
In addition, we're also inviting 2 new members to the contributor team: damusss and gresm! Members of the team have more permissions and more responsibilities, as regular reviewers: https://github.com/pygame-community/pygame-ce/wiki/Becoming-a-Reviewer#becoming-a-regular-reviewer
Thanks all
A sincere thank you to everyone involved! This involves not only the PR makers but also to the broader community which includes issue reporters, PR reviewers, tutorial creators, admins/mods/helpers across various online platforms, individuals developing helper libraries, and most importantly, all our users โ including you, the reader of these notes!
Apologies in advance if we've made an error in these notes, and please get in touch with us to get a correction made.
Until next time, take care, and enjoy pygaming!
**Full Changelog**: https://github.com/pygame-community/pygame-ce/compare/2.4.1...2.5.0