,--. | oo| | ~~| o o o o o o o o o o o |/\/\| pip install pygame==2.0.0.dev12
Locked in or Locked out? That's not going to stop a new pygame <https://pygame.org/wiki/about> coming out. The main theme of this release is testing. With many new contributors having worked on unit tests, we can be much more confident that many more features will continue to work with our SDL2 based pygame 2 as in pygame 1 which is based on SDL1. But we also have a few new features, and plenty of bug fixes. Thanks to everyone for their help with this release. Critical backwards compatibility fixes for pygame 2 First up, some 'critical' improvements that have been made to pygame. 'critical' labeled issues are ones are backwards incompatible issues stopping a pygame 2 release. We start with some joystick improvements from Daniel Pope @lordmauve <https://github.com/lordmauve>. Add SDL2-specific methods to Joystick; rename event fields <https://github.com/pygame/pygame/pull/2027>. Now joysticks(game pads, drum sets, dance mats) can be hot-plugged, and the game will still work properly. @robertpfeiffer <https://github.com/robertpfeiffer> got posting of keydown events working on SDL2 <https://github.com/pygame/pygame/pull/1584>. This is part of the android work that has now been merged into the main branch - but it is also a backwards compatibility fix. Thanks to Dan Lawrence @MyreMylar <https://github.com/MyreMylar> for fixing segfaults caused when interacting with display surface after quit <https://github.com/pygame/pygame/pull/1899>, which is mainly useful for when writing unit tests or playing with pygame interactively. Sometimes writing tests for existing functionality finds real issues and bugs. First @tsadama <https://github.com/tsadama> Added unit tests for display.toggle_fullscreen and display.get_active <https://github.com/pygame/pygame/pull/1927> which uncovered an issue with SDL2. Then Dan Lawrence @MyreMylar <https://github.com/MyreMylar> Fixed get_active() function so it works as described in docs on windows under SDL2. <https://github.com/pygame/pygame/pull/1988>. Tests Here we see the amount of unit tests left to write to get full coverage of every pygame method. During this release period you can see a lot of things got new tests. During the testing it uncovered a number of real issues, and some of them were even fixed. pygame version Methods left to test 2.0.0.dev12 81 2.0.0.dev10 127 2.0.0.dev8 143 2.0.0.dev6 147 1.9.6 156 1.9.5 155 1.9.4 189 1.9.3 194 1.9.2 194 1.9.1 232 1.9.0 232 1.8.1 25 1.8.0 0 The count can be found with the following command run in the pygame code base: grep todo test/*.py | wc -l 'goodfirstissue <https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22>' is a label applied to issues which would be good for someone who wants to try contributing to a Free, Open Source, or community project (like pygame). A lot of these issues were written up containing unit tests that needed to be finished off. Unfortunately we will probably run out of things to test in some months. We hope to prepare new types of 'good first issues', and educational material in other areas next. So that there is something else for people who are interested in contributing as a way to learn. Hopefully we can structure it as a learning pathway, with even some advanced topics. Thanks to Andy Nguyen @anguye13 <https://github.com/anguye13>, who worked on a number of tests in the display, image, and surface areas. - Unit test for image.save_extended() <https://github.com/pygame/pygame/pull/2040> - display.set_gamma_ramp() unit test <https://github.com/pygame/pygame/pull/2039> - Added unit test: surface.get_shifts() <https://github.com/pygame/pygame/pull/2034> - Added unit test: surface.get_pitch() <https://github.com/pygame/pygame/pull/2037> Adam Andrews @adamandrews1 <https://github.com/adamandrews1> worked on the transform, threads parts of the code base. They have also begun work on cleaning up the buffer code, which is in C and kind of complicated. But that work is still waiting, and will likely make it into the next release. - threads.benchmark_workers and threads.WorkerQueue.do <https://github.com/pygame/pygame/pull/2064> - pygame.transform.smoothscale <https://github.com/pygame/pygame/pull/2063> - Reintroduce sizing checks for transform.smoothscale test <https://github.com/pygame/pygame/pull/2074> Travis Chang @Reminisque <https://github.com/Reminisque> - Added unit test for mouse.get_cursor() <https://github.com/pygame/pygame/pull/1955> - Add unit test for surface.get_losses <https://github.com/pygame/pygame/pull/2020> - Add mouse.set_cursor unit test <https://github.com/pygame/pygame/pull/1967> Dan Lawrence @MyreMylar <https://github.com/MyreMylar> - Some colorkey test fixes <https://github.com/pygame/pygame/pull/1913> - Testing mixer.music.play() start parameter & adding mp3 warning <https://github.com/pygame/pygame/pull/1886> @khuang0312 <https://github.com/khuang0312> - Added time.get_ticks() and time test improvements <https://github.com/pygame/pygame/pull/1880> - surface.get_colorkey() test <https://github.com/pygame/pygame/pull/1881> @lkito <https://github.com/lkito> - Surface.get_bitsize and Surface.get_bytesize tests <https://github.com/pygame/pygame/pull/1898> - Surface.test_get_abs_parent and Surface.test_get_abs_offset tests, and fix. <https://github.com/pygame/pygame/pull/1900> Pedro de la Peña @pedrodelapena <https://github.com/pedrodelapena> - Unit tests for time.Clock.get_time() <https://github.com/pygame/pygame/pull/1909> - Unit tests for transform.rotate() <https://github.com/pygame/pygame/pull/1960> @galexandreg <https://github.com/galexandreg> continued to - Add time.set_timer() unittest <https://github.com/pygame/pygame/pull/1924> - Add some mixer Sound tests <https://github.com/pygame/pygame/pull/1934> @tsadama <https://github.com/tsadama> - Added unit tests for display.toggle_fullscreen and display.get_active <https://github.com/pygame/pygame/pull/1927> - Added Unit Test for joystick.init() <https://github.com/pygame/pygame/pull/1937> pygame.joystick tests @raphacosta27 <https://github.com/raphacosta27> Add unit test: joystick.quit() <https://github.com/pygame/pygame/pull/1912> Bill @AdditionalPylons <https://github.com/AdditionalPylons> Added unit test: JoystickModuleTest.test_get_count <https://github.com/pygame/pygame/pull/2009> pygame.display tests Gabriel Moreira @gabsmoreira <https://github.com/gabsmoreira> Add unit test: display.get_driver <https://github.com/pygame/pygame/pull/1911> @zoldalma999 <https://github.com/zoldalma999> Adding unit test to display.iconify <https://github.com/pygame/pygame/pull/2006> @amipy <https://github.com/amipy> Added a unit test for display.flip() <https://github.com/pygame/pygame/pull/2054> @DGMcKenney <https://github.com/DGMcKenney> Adds a unit test of the display.set_icon() function. <https://github.com/pygame/pygame/pull/2042> Grigoris Tsopouridis @gtsopus <https://github.com/gtsopus> Add display.set_gamma unit test <https://github.com/pygame/pygame/pull/1942> pygame.time tests Ilia Gogotchuri @Gogotchuri <https://github.com/Gogotchuri> Implemented time.Clock.get_fps unit test <https://github.com/pygame/pygame/pull/1926> Jim Quach @jiquach <https://github.com/jiquach> Add unit test to Clock.get_rawtime <https://github.com/pygame/pygame/pull/1939> Aaron Li @AaronLi <https://github.com/AaronLi> Added test for time.Clock.tick() <https://github.com/pygame/pygame/pull/1938> Clark Seanor @cruxicheiros <https://github.com/cruxicheiros> Add basic tests for time.Clock.tick_busy_loop <https://github.com/pygame/pygame/pull/1976> pygame.threads tests K Duggan @kduggan15 <https://github.com/kduggan15> Adds test for threadloop <https://github.com/pygame/pygame/pull/1961> Michał Górny @mgorny <https://github.com/mgorny> Replace long-deprecated Thread.isAlive() with .is_alive() <https://github.com/pygame/pygame/pull/1928> Clark Seanor @cruxicheiros <https://github.com/cruxicheiros> threads.tmap() test and and fix. Unsurfaced bug #1768 <https://github.com/pygame/pygame/pull/1965> pygame.Surface tests @jtoloff <https://github.com/jtoloff> unit test for Surface.get_locks function <https://github.com/pygame/pygame/pull/1980> @41aaronb <https://github.com/41aaronb> Added unit test for the surface.lock() function <https://github.com/pygame/pygame/pull/1977> other tests Prasanna Venkatesh @hanzohasashi33 <https://github.com/hanzohasashi33> math.Vector.scale_to_length docs and add test for display.set_palette() <https://github.com/pygame/pygame/pull/1972> @zoldalma999 <https://github.com/zoldalma999> Add unit test to image.get_extended <https://github.com/pygame/pygame/pull/2002> Nihal Mittal @codescientist703 <https://github.com/codescientist703> Added unit test for pygame.cursors.compile <https://github.com/pygame/pygame/pull/2012> @leopoldwe <https://github.com/leopoldwe> Add key.get focused unit test <https://github.com/pygame/pygame/pull/2026> draw Josip Komljenović @MightyJosip <https://github.com/MightyJosip> Fixed drawing of ellipse. No more holes. <https://github.com/pygame/pygame/pull/1994> Old: [image: Old] <https://user-images.githubusercontent.com/29337110/86373093-4e61ee80-bc83-11ea-839a-febb416075d1.png> New: [image: New] <https://user-images.githubusercontent.com/29337110/86373038-3db17880-bc83-11ea-9b44-903e40eb658b.png> Scott Noyes @snoyes <https://github.com/snoyes> draw_py._draw_line: Use correct endpoints during swap <https://github.com/pygame/pygame/pull/1964> Charles @charlesej <https://github.com/charlesej> Fix aatrigon/aapolygon drawing horizontal edges <https://github.com/pygame/pygame/pull/2015> Math Daniel Pope @lordmauve <https://github.com/lordmauve> Fix OOB access in math.Vector swizzle; add '0' and '1' swizzles <https://github.com/pygame/pygame/pull/2024> These will be useful to prepare homogenous coordinates for affine transforms by matrix multiplication <https://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations>. Here is a matrix representing a 2x scale + (3, -1) translation: >>> import numpy as np>>> from pygame.math import Vector2>>> v = Vector2(0.5, >>> 0.8)>>> mat = np.array([ ... [2, 0, 3], ... [0, 2, -1], ... ])>>> mat @ v.xy1array([4. , 0.6]) Community help A special thanks to all the people who help out others. From making videos, to answering questions, to writing guides. MyreMylar, MichaelCPalmer, jtiai, claudeb, DaFluffyPotato, Rabbid76, The Big Kahuna, sloth, Kingsley, ... and lots of other people. Special thanks to @Zireael07 <https://github.com/Zireael07> for cheering on pull requests that people make 🎉 Type hints, and lint tools We are down to zero alerts on the LGTM linting tool on python and C/C++. We are now the largest python codebase with zero alerts on the LGTM platform (and also the largest C/C++ codebase with zero alerts). This doesn't mean we have perfect code yet however! pylint pylint is another python code quality tool we are using. With which we currently have *thousands* of reported issues left. Not only can this tool find correctness problems with the code, it can also offer ideas on how to make the code more readable and 'pythonic'. Once we have the files pylint-clean we can use pylint to take some of the load off the code reviewers. Dan Lawrence @MyreMylar <https://github.com/MyreMylar> pylint - version module <https://github.com/pygame/pygame/pull/1891> - sysfont module <https://github.com/pygame/pygame/pull/1892> - pkgdata module <https://github.com/pygame/pygame/pull/1893> - py_draw.py module <https://github.com/pygame/pygame/pull/1936> - midi module <https://github.com/pygame/pygame/pull/1946> - locals.py module <https://github.com/pygame/pygame/pull/1921> - A start on linting the sprite module <https://github.com/pygame/pygame/pull/1925> Charles @charlesej <https://github.com/charlesej> - colordict.py <https://github.com/pygame/pygame/pull/2003> - _numpysurfarray.py <https://github.com/pygame/pygame/pull/2004> Josip Komljenović @MightyJosip <https://github.com/MightyJosip> - Rect and Color type hint fixes <https://github.com/pygame/pygame/pull/2079/files> Android Some more of the android branch got merged into the main pygame branch. @robertpfeiffer <https://github.com/robertpfeiffer> - use rwops for font loading <https://github.com/pygame/pygame/pull/2065> - Keep all window events in SDL2 <https://github.com/pygame/pygame/pull/1897> - setup.py cleanup: add -stripped build option to not include docs or tests <https://github.com/pygame/pygame/pull/1878> big endian CPU architecture Thanks to Travis CI, we now have a builder which can test our big endian code. Even though big endian is not very common these days, it's still helpful to support it because it helps shake out some bugs we wouldn't normally see just testing on little endian CPU architectures. René Dudfield @illume <https://github.com/illume> s390x build robot on travis CI for big endian testing <https://github.com/pygame/pygame/pull/1929> Michał Górny @mgorny <https://github.com/mgorny> Account for big endian support for RGB/BGR images <https://github.com/pygame/pygame/pull/1930> Dan Lawrence @MyreMylar <https://github.com/MyreMylar> Remove hard coded RGB bitshifts that don't work with SDL_MapRGB()/SDL_MapRGBA() <https://github.com/pygame/pygame/pull/1919> image Sigurður Sveinn Halldórsson @siggisv <https://github.com/siggisv> image.save(namehint='') and image.get_sdl_image_version <https://github.com/pygame/pygame/pull/2053> useful for when saving images to file objects and you want to tell it what format to save in (jpg, png, etc). >>> file = BytesIO()>>> pygame.image.save(surface, file, namehint='.png') Documentation and tutorials _________________________ =(__ ___ __ __)= | | | | | python -m pygame.docs | | | | A number of small | | documentation fixes | | were made in this | | release. | | | |__ ___ __ _____| =(_________________________)= @Starbuck5 <https://github.com/Starbuck5> Fix typo in draw.rst <https://github.com/pygame/pygame/pull/1885> Dan Lawrence @MyreMylar <https://github.com/MyreMylar> - Strengthen warning in event docs about handling the event queue <https://github.com/pygame/pygame/pull/1883> - Key constants link added to event documentation <https://github.com/pygame/pygame/pull/2072> @wuzh07 <https://github.com/wuzh07> Fix typos in draw.rect docs <https://github.com/pygame/pygame/pull/1969> Gerardo Antonio Hagad @ginohagad <https://github.com/ginohagad> Chimp tutorial: Changed the variable "wav" to "fullname". <https://github.com/pygame/pygame/pull/2005> Evan Kanter @evank28 <https://github.com/evank28> Updated documentation of blit method <https://github.com/pygame/pygame/pull/2035> Vicente González Ruiz @vicente-gonzalez-ruiz <https://github.com/vicente-gonzalez-ruiz> Update SpriteIntro.rst <https://github.com/pygame/pygame/pull/2045> Douglas @douglas-cpp <https://github.com/douglas-cpp> Fix grammar in sprite docs <https://github.com/pygame/pygame/pull/2062> mouse Dan Lawrence @MyreMylar <https://github.com/MyreMylar> mouse.get_pressed() supports 5 buttons <https://github.com/pygame/pygame/pull/1887> Optimizations @nthykier <https://github.com/nthykier> Add a SSE4.2 optimized version of image_tostring for some 32bit surfaces <https://github.com/pygame/pygame/pull/1715>. The new pygame.image.tostring is up to 8x faster on x86 and x64 systems. Bug fixes and Cleanups René Dudfield @illume <https://github.com/illume> - Manylinux builds tested properly on travis CI <https://github.com/pygame/pygame/pull/1906> - Remove unused gp2x files. <https://github.com/pygame/pygame/pull/1917> - freetype.py unused imports, and black code formatting <https://github.com/pygame/pygame/pull/1918> - Move .appveyor.yml config to buildconfig/appveyor.yml One less file in root. <https://github.com/pygame/pygame/pull/1935> - setup.cfg for tooling config. Starting with tox and pylint config. <https://github.com/pygame/pygame/pull/1944> - Name some travis ci jobs (SDL1, manylinux) <https://github.com/pygame/pygame/pull/1978> including - Atlassian Bitbucket deleted repos. Host windows prebuilts file on pygame website <https://github.com/pygame/pygame/pull/2059> - Disable mouse.set_system_cursor on CI <https://github.com/pygame/pygame/pull/2060> - Fix mouse.set_system_cursor when using SDL1 to do nothing. <https://github.com/pygame/pygame/pull/2061> Inada Naoki @methane <https://github.com/methane> Avoid PEP393 deprecated APIs. <https://github.com/pygame/pygame/pull/1956> Niels Thykier @nthykier <https://github.com/nthykier> Fix test failure without SDL_AUDIODRIVER set <https://github.com/pygame/pygame/pull/1987> Jani Tiainen @jtiai <https://github.com/jtiai> Pipenv: Fixed incorrect base class comparison <https://github.com/pygame/pygame/pull/2001> Christian Clauss @cclauss <https://github.com/cclauss> Travis CI: Test Py38 on Ubuntu Bionic <https://github.com/pygame/pygame/pull/1727> Dan Lawrence @MyreMylar <https://github.com/MyreMylar> - Alphabetised colourdict.py colour names <https://github.com/pygame/pygame/pull/2068> - Defined WINDOWEVENT_MINIMIZED <https://github.com/pygame/pygame/pull/2090> Sigurður Sveinn Halldórsson @siggisv <https://github.com/siggisv> Fix pygame.event.custom_type() off by one error. <https://github.com/pygame/pygame/pull/2076> Josip Komljenović MightyJosip - Fix event.custom_event first call <https://github.com/pygame/pygame/pull/2071> - Add PyCharm config directory to gitignore <https://github.com/pygame/pygame/pull/1941> - transform.chop test and fix <https://github.com/pygame/pygame/pull/1996> @Starbuck5 <https://github.com/Starbuck5> Internal pyinstaller hook to include dynamic libraries on Windows <https://github.com/pygame/pygame/pull/2058> Gosha Zacharov @Gosha <https://github.com/Gosha> Allow setting several paths in PYGAME_EXTRA_BASE <https://github.com/pygame/pygame/pull/1989> sprite Sigurður Sveinn Halldórsson @siggisv <https://github.com/siggisv> Fix and test sprite.collide_circle_ratio <https://github.com/pygame/pygame/pull/2030> Josip Komljenović @MightyJosip <https://github.com/MightyJosip> Fix sprite drawing on Renderer <https://github.com/pygame/pygame/pull/2080> Reviews Special thanks to @MyreMylar <https://github.com/MyreMylar>, @MightyJosip <https://github.com/MightyJosip>, @charlesej <https://github.com/charlesej>, @robertpfeiffer <https://github.com/robertpfeiffer>, @illume <https://github.com/illume> and @nthykier <https://github.com/nthykier> who have provided plenty of code reviews and testing of other peoples work. It's vitally important that people volunteering (sometimes for the first time) are treated with respect and in a friendly way. It's also important that everyone in our community should feel free to review code, so we can all learn from one another. Issue gardening ******** **************** ******************* ******************** ******************** wWWWw wWWWw \\ // ******** vVVVv (___) wWWWw (___) vVVVv \\\// ******* (___) ~Y~ (___) vVVVv ~Y~ (___) \\\//// ~Y~ \| ~Y~ (___) |/ ~Y~ |||// \| \ |/ \| / \~Y~/ \| \ |/ ||||| \\|// \\|// \\|/// \\|// \\|// \\\|/// ,,,,,,,,,,,//||||\,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; This time 4 'critical' backwards compatibility issues were fixed since the last release. ------------------------------ - 9 open 'critical' issues <https://github.com/pygame/pygame/issues?q=is%3Aissue+is%3Aopen+label%3Acritical> (backwards compatibility issues reported by people), and 28 closed (last release: 8 open, 24 closed). - merged PRs <https://github.com/pygame/pygame/pulls?q=is%3Apr+is%3Aclosed+merged%3A2020-06-01..2020-09-20+sort%3Aupdated-desc+> - 1867 Commits since 1.9.6 stable release <https://github.com/pygame/pygame/compare/1.9.6...2.0.0.dev12> - 424 Commits since 2.0.0.dev10 pre release <https://github.com/pygame/pygame/compare/2.0.0.dev10...2.0.0.dev12>