- Pygame GUI uses PEP8 as a style guide, mainly because it is enforced by PyCharm. Contributions should be in the same general style.
- Pygame GUI tries to use type hinting as much as possible. This is mainly to help with code auto completion and refactoring operations, See here for the typing documentation if you are unfamiliar with it's use.
- Pygame GUI uses docstrings. At least most of the time; this is to help encourage better documentation.
- Pygame GUI tries to use pygame-like approaches wherever possible. This is to make using the library as familiar to users of pygame as possible. This is why we use the pygame event system for communicating GUI events and pygame sprites for drawing GUI elements.
- Pygame GUI has a game focus - but we also don't want to get too-specific to an individual project. New elements should have applicability to a reasonably wide range of game projects.
- Pygame GUI aims to be easy to use - so it is approachable for relative novices, while still being practical for proper released projects. It's a tricky balance, but in general we want to minimise the amount of code to get something up and running, and keep extra depth a little more tucked away.
- Pygame GUI has good documentation & tutorials. In keeping with our newbie friendly approach, the Pygame GUI documentation aims to be up-to-date and friendly.
- Be nice - try to remember to be nice & helpful to another when contributing!
- These are guidelines rather than hard rules. Submitted issues are pretty much always welcome in whatever form as it lets us know someone is making use of the library! The creators of Pygame GUI are fallible humans and just as likely to not be doing something right as the next person, if you think we are doing something wrong and it doesn't fit these guidelines, just let us know.
Building Pygame GUI as a developer has a few additional dependencies.
For building the documentation you will need:
- sphinx
- sphinx_rtd_theme
For running the tests you will need:
- pytest
- pytest-cov
- pytest-benchmark
All should be pip installable.
python -m pip install sphinx sphinx_rtd_theme pytest pytest-cov pytest-benchmark
Venv:
- If developing a virtual environment (recommended), use this command while in the environment to download all relevant dependencies
python -m pip install pygame-ce python-i18n importlib_resources typing_extensions
- Or here's a one-liner to set up the virtual environment all at once
python -m pip install pygame-ce python-i18n importlib_resources typing_extensions sphinx sphinx_rtd_theme pytest pytest-cov pytest-benchmark
- Do the tests run?
pytest --cov-report term --cov=pygame_gui tests/
- Do the relevant examples run & look OK?
- Have I documented any new features/code in a helpful fashion. If so, does the documentation build and look OK?
Thank you for reading and considering contributing.