☀️🌊🏖️😎🏄🐚🌈🏝️🍹☀️🌊🏖️🎉
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
- added
mouse.get_just_[pressed|released]in #2836 - added
display.[get|set]_window_positionin #2816 (F)Rectcan be initialized with no arguments in #2655
@whydoubt added the pitch argument for image.tobytes in #2602
@XFajk added Color.from_normalized constructor and Color.normalized property in #2693
@mzivic7 added draw.aacircle in #2800
@itzpr3d4t0r added transform.hsl in #2398
@ScriptLineStudios implemented a few convenience properties to Surface class: Surface.width, Surface.height and Surface.size in #2813
@bilhox added math.invlerp and math.remap in #2654
@ankith26 added mixer.get_driver in #2741
SIMD Performance enhancements
@Starbuck5 improved performance of SSE2 no_surf_alpha_opaque_dst blitter in #2601 and #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.
- Partially refactor SSE2 blitters with macros in #2656.
- Implemented AVX2 variant of
Surface.premul_alphain #2615
@MyreMylar added SIMD versions transform.invert in #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: #2561, #2660, #2634, #2662, #2661, #2709, #2791, #2732, #2731
A big thanks to everyone who contributed to pygame-geometry so far: @Emc2356, @itzpr3d4t0r, @andrewhong04, @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 #2659
@ankith26 added Wayland and PipeWire support in the linux wheels distributed by us in #1997 and #2733
@ankith26 rewrote the build machinery in the meson buildsystem, while deprecating the old build machinery in the PRs #2557, #2803, #2853, #2856, #2875, #2854, #2831, #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 #2762
@oddbookworm re-added and properly deprecated the blend argument of draw.aaline in #2743
Performance Enhancements
In addition to those mentioned above that are SIMD-related
- Optimized
(F)Rect.unionall(_ip)in #2784 - Optimized
(F)Rect.collideXXfamily of methods in #2786 - Replaced use of internal C-API functions with more efficient alternatives in #2819
Bug fixes
@oddbookworm added shim to fix broken midi module compilation in #2863
- fixed some init related issues in the experimental
windowAPI in #2860 - fixed segmentation fault during invalid
PixelArrayusage in #2742
General Enhancements
@Kn4ughty made error messages for using font align clearer in #2777
@pmp-p ensured we keep supporting pygame on the web in
- wasm: unify pygame-web/pyodide/static Freetype init in #2748
- fixed some
METH_NOARGSarg missing in #2888
- made
transformblur on a surface with either width or height equal to 0 not raiseValueErrorin #2852 - Cleanup codebase, docs and examples with American spelling in #2827
@Starbuck5 added a briefcase template to pygame-ce in #2862
@RainRat fixed typos across the repository in #2847
@robertpfeiffer relax Surface.convert conditions in #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 #2823
Examples and Unit tests
@snowfruit added an example for retro scaling in #2785
@Matiiss removed undefined variable in aliens.py in #2769
@Starbuck5 fixed ftfont_test being run directly in #2763
- Add a delta of 2 ms to test_music_pause__unpause() in #2898
- Force window surface update after set_size, hopefully proper fix for that pesky frequent pypy test fail in #2865
- Minor changes to support pytest in #2675
Docs, Tutorials and typestubs
- fixed documentation mix up in attributes of object returned by
get_power_statein #2734 - added clarifications about ranges in
mixerdocs in #2738
@kritserv fixed an issue in pygame.display.get_caption docs in #2765
@yohanmoon added instructions for resolving setuptools issue in the docs readme in #2868
@Matiiss added more / (positional-only notation) to docs and stubs in #2691
@oddbookworm fixed indentation of surface attributes in #2900
@ankith26 did some minor docs/stubs improvements in invlerp/remap in #2902
@Starbuck5 added warning about 7.1 stereo on set_source_location in #2881
- removed duplicate images in tutorials in #2871
- including
print_debug_info()in issue template in #2879 - adjusted symbol color in light theme in #2891
Code quality and robustness
- Minor optimizations by using comprehensions in #2771
- PEP572 Use Python's assignment expression in #2782
- Remove lint logic from
setup.pyin #2796 setup.py: Properly add_sdl2_data_filestodata_filesin #2770
@Lumiobyte fix a comment typo in rect_impl.h in #2658
@Matiiss reduced redundancy in surface.fblits code and handled generator exception in #2679
@oddbookworm applied formatting updates using newest version of clang-format in #2744
- Unify freetype init codepaths in #2801
- (Freetype) use calloc where possible in #2802
- Cleanup
rwobject.cfile object methods in #2717 - gitignore meson temp folder in #2805
- Use
HasColorKeybeforeGetColorKeyin #2835 and #2844
- Remove docs non-public module stubs in #2794
- Fix pylint undefined usage error in sysfont in #2858
- Add explicit check and error for system cursor in #2843
- Track version only in pyproject.toml in #2820
- Remove all
.editorconfigduplicates, re-add in project root with updates in #2788
Dependencies, DevOps and CI
@cclauss helped us improve our DevOps and CI
python3 setup.py lintis deprecated: Let's lint withpre-commitin #2772build-on-msys2.yml: Upgrade GitHubactions/checkout@v4in #2812- Format Python code with ruff format instead of black in #2824
@Starbuck5 continued working on changes that make our code ready for SDL3
transform.scale: softstretch SDL2/SDL3 compat in #2707- SDL2/SDL3 mutex support in #2712
- Simple SDL3 patches for
freetype,surfaceandmousein #2838 - Use macros for
[Bytes|Bits]PerPixelcompat in SDL3 in #2804
- bumped gh actions mac runners (gets us native M1 builds) in #2494
- kept the CI running by fixing a few dependency update related issues in #2774, #2778 and #2916
- fixed
python -m docsdev time convenience command in #2889
@MyreMylar altered our CODEOWNERS file to switch required PR review team in #2873
@Matiiss, @oddbookworm, and @Starbuck5 kept our SDL dependency updated in #2689, #2690, #2705, #2761, #2806, #2837
@dependabot kept all our CI dependencies updated in #2814, #2809, #2767, #2755, #2756, #2754, #2747, #2746, #2736, #2730, #2683, #2628, #2874, #2861, #2851, #2833
@Starbuck5 and @ankith26 kept them releases coming in at #2631, #2817, #2818, #2903, #2904, #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: 2.4.1...2.5.0