Open GalacticEmperor1 opened 1 year ago
Hey, while executing the following
import pygame.examples.aliens
pygame.examples.aliens.main()
I get weird behaviour. The game works perfectly fine but as soon as player dies it freezes. I must force quit the application to exit it. I am using pygame-ce 2.5.1 (SDL 2.30.6, Python 3.12.4)
@StanCDev you're not supposed to run the main function of an example directly. Just do python -m pygame.examples.aliens
Hello, can i try this issue ?
Hi @Joao-antonio-gg , sure you can !
Issue №2136 opened by illume at 2020-10-04 11:14:08
Now that pyinstaller has per package hooks, it makes sense to test it ourselves.
python -m pip install pyinstaller
to each of the CI jobs we want to test it on.Comments
*ankith26 commented at 2020-10-04 13:26:10*
I found a useful link (I havent done much research myself, but the link looks useful for this case): https://github.com/pyinstaller/hooksample
Continuing from my last message in the PR linked, let me clearly explain this time.
Here is how I would launch the "aliens" example that comes with pygame.
I save this bit of code into a python file, and when I run it, it loads the nice game.
Now I use pyinstaller on this file, and when I run the exe, it crashes. This crash is intentional, you can try it out.
This is happenning because pyinstaller has not bundled any data files needed by aliens to work. Neither will any other examples work if they are used this way.
Now for tests/pyinstaller_test.py, it means that the test code we are writing must not rely on any external resource, because pyinstaller is not going to bundle it automatically for us. If it does rely on any image/font/audio file, then we would have to write a spec file for it
*illume commented at 2022-01-22 21:10:35*
I guess there could be a way to hunt data files. If not, then specify them.
*illume commented at 2022-01-22 21:14:13*
I guess there are examples without data files where we could start.
It would be handy to be able to quit the examples via environment variable. Otherwise perhaps one of the command line examples would be fine for this pyinstaller test… because they should exit with a suitable return code that can be checked.