So you want to contribute with thumbor? Awesome! Welcome aboard!
What kind of contribution are you aiming for? Features, documentation and bug fixes are always welcome.
Please note: we dropped feature-support for thumbor 6. That said, no
new features are going to be added on thumbor 6.x. If you still want to
contribute (a bug fix), please head at fixes/6.7.x
.
There are a few things you'll need in order to properly start hacking on it.
- Fork it
- Install dependencies and initialize environment
- Hack, in no particular order:
- Write enough code
- Write tests for that code
- Check that other tests pass
- Repeat until you're satisfied
- Submit a pull request
You'll need redis-server installed (for queued detector unit tests).
Other than that, we seriously advise you to use virtualenv since it will keep your environment clean of thumbor's dependencies and you can choose when to "turn them on".
The project requires Python 3.8+, and in this version virtualenv is already installed by default, to create a virtual environment follow the next steps:
- Create a virtual environment, in the folder .venv, located in the user's home folder
$ python3 -m venv ~/.venv/<my_env_name>
- Activate the virtual environment
$ source ~/.venv/<my_env_name>/bin/activate
- Now you can install the dependencies in your virtual environment
- In case you want deactivate your virtual environment:
$ deactivate
You can install thumbor dev dependencies with:
$ make setup
Running the tests is as easy as:
$ make test
You should see the results of running your tests after an instant.
If you are experiencing "Too many open files" errors while running the tests, try increasing the number of open files per process, by running this command:
$ ulimit -S -n 2048
Read http://superuser.com/questions/433746/is-there-a-fix-for-the-too-many-open-files-in-system-error-on-os-x-10-7-1 for more info on this.
Please ensure that your editor is configured to use black, flake8 and pylint.
Even if that's the case, don't forget to run make flake pylint
before
committing and fixing any issues you find. That way you won't get a
request for doing so in your PR.
After hacking and testing your contribution, it is time to make a pull
request. Make sure that your code is already integrated with the master
branch of thumbor before asking for a pull request.
To add thumbor as a valid remote for your repository:
$ git remote add thumbor git://github.com/thumbor/thumbor.git
To merge thumbor's master with your fork:
$ git pull thumbor master
If there was anything to merge, just run your tests again. If they pass, send a pull request.
The latest version of this document can be found at Hacking on thumbor.