We are happy and welcome if you want to contribute to fusion engine. But please consider a few details before continuing:
- Branch: Please when working on your fork, work in the dev branch, because we only will accept commits to the dev branch. It will later be released with the next version of fusion.
- Explain: Please explain why this should be considered and merged. That will make our life easier.
- Test: Please test your code before even opening a new pull request.
- Documentation: Please, if your adding something new, like a feature, please document everything.
- Format: Please, run black for formatting of the code.
If we see a pull request that doesn't follow these rules, we will tell you that, and close the pull request. We allow you to re-open a new pull request, but we expect you to have your code fixed. So make sure that you followed the rules
- PDM: We are using pdm for our main interaction with the library.
- pyproject.toml: Pythons way for setting up a project. A replacement for setup.py
- pygame-ce: Used for windowing and events
- FusionGL (ctypes): Used for rendering everything. Its a custom wrapper around OpenGL for python
- pymunk: Will be used for physics
- black: We are using black to format code
If you want to contribute, you got to setup the work environment, so you can develop fusion the right way. First, install PDM using pip:
pip install --user pdm
PDM will manage everything for us, like virtual enviorments, packages and scripts.
Then, fork the repository to your profile.
Then, clone your forked github repository:
git clone https://github.com/your_username_/fusion.git
cd fusion-engine
Then, change the branch to the dev branch to follow rule #1:
git checkout dev
After that we need to run a special PDM command for creating the venv with the dev dependencies:
pdm install --dev
This will create a .venv, with all dependencies needed and will install a editable version of fusion engine. This will have the same effect as pip install -e .
.
To test if it works properly, run one of the example using PDM:
pdm run example1
If you want to test documentation code, run the mkdocs command for starting a local server with the documentation. Run it with:
pdm run docs
If you want to run some specific files, then just run:
pdm run your_file.py
If you're ready with your changes, then you must follow a few steps before pull requesting. First, run black using PDM to format your code:
pdm run lint
Then make sure your pull request code works without erroring and you followed the contribution rules
After all of this, you can create a pull request and one of our main organisation members will look at it.