Development

So you want to help with MyPaint development? This is the place to start.

Coding
Interested in hacking and/or contributing to MyPaint?

MyPaint is mainly written in Python (using the GTK toolkit), with a brush engine in C++. More information about the code can be found in the developer documentation. In general, the codebase is quite simple and easy to get into.

We use git for code maintenance and the main repository is currently located on gitorious.org. We will shortly (as of 2014-06-30) be moving the focus of development activity to github, but for now the master branches on both repositories are maintained in parallel.

Finding tasks
If you don't know exactly what you want to do, here are some ideas:
 * Have a look at the list of tasks especially suited for new developers
 * Check our release planning page for what needs to be done for next release
 * Check the bug tracker for bugs or features that need to be fixed
 * Find inspiration and ideas here in the wiki: Brainstorming

Getting in touch
If you have any questions, don't hesitate to ask!

Getting contributions into MyPaint
Please follow these best practices when writing code. It will make it easier for maintainers to review your code, increasing the chance that it will be included into mainline MyPaint significantly.


 * Follow the code conventions of the files you are editing.
 * For new Python code, please follow the emerging Python Style Guide for MyPaint.
 * Document your code
 * Write docstrings describing what a function or class does
 * When it is not obvious, add comments to explain why you are doing something
 * Keep commits/patches atomic, containing only one logical change
 * Keep commit history clean, use a separate branch which contains only the relevant commits
 * Let your commits or patches apply cleanly to the latest git version
 * Tell us about your work and bug us to look at it. The bug tracker or mailing list is the most reliable way.
 * Make sure your code or artwork is licensed so that we, and others, can redistribute it. See the Licensing policy for more.

Bug Reporting
Anyone can help out by reporting bugs when you find them. Fixing bugs makes MyPaint better for everyone. Just go to our Github bug reporting page to report new bugs.

When reporting a bug, try to be specific.

First, try to make sure it is a bug. A mistake installing, corrupt files, problems with other software, and unintuitive functions can all seem like bugs in MyPaint. Try to be able to replicate the bug on demand. Make sure to include detailed information which can help in pinpointing and fixing the bug. Try to include a concise overview without speculating too much. Include the steps you know of to reproduce the bug. Include what happens when the bug appears. In-program bug reports, error messages, and strange program behavior are all good info to provide. Share what you expect to happen and what actually happens. Include the version of MyPaint, your operating system, and whatever other information (such as your tablet brand and model) that is related to the bug.

Here's an example of a helpful bug report from our old tracker.


 * Help for Debugging Tablet Issues

Packaging
Want to help making easy-to-install packages for your favorite platform/distribution? Check out this page.

Translating
Want to translate MyPaint into your language?

MyPaint uses GNU gettext to allow translation. The translations can be found in the po/ directory in the source code (online browser). This directory also contains a README which has some info on how to contribute fixes or new translations.

Brushes and backgrounds
Have you created some cool brushes or backgrounds for MyPaint? Share them with others!

Documentation
Know how to use MyPaint? Perhaps you have some nice painting tricks to show? Help teach others by contributing to our documentation.

Brainstorming
Got good ideas? Every user can help with the brainstorming process and have an influence on future development of MyPaint!

Quick Setup
If you are running a relatively modern distribution of Linux, you can probably use the following bash script to quickly set up MyPaint's development version on a new machine for immediate testing. Run as a normal user, not as root. The script installs the dev version in its own prefix, so your stable version shouldn't be broken.

'''This script assumes you have a deb-based packaging system. You may need to adjust it for other systems. This script may become outdated occasionally.'''

echo "Enter password to install dependencies..." if [ -f /etc/debian_version ]; then sudo apt-get update && sudo apt-get install git scons python-numpy swig libglib2.0-dev python-dev python-gtk2-dev python-cairo-dev libpng12-dev g++ gettext liblcms2-dev libjson0-dev else sudo yum install git scons numpy swig glib2-devel python-devel pycairo-devel libpng-devel gcc-c++ gettext liblcms2-devel libjson0-devel fi
 * 1) !/bin/bash
 * 2) Installs MyPaint's dependencies.

mkdir ~/mypaintdev git clone https://github.com/mypaint/mypaint.git ~/mypaint-src cd ~/mypaint-src git submodule update --init scons prefix=~/mypaintdev/ install
 * 1) Makes two folders, one to store GIT clones, and one in which MyPaint will be installed.

ln -s ~/mypaintdev/lib/libmypaint-brushlib.so ~/mypaintdev/lib/mypaint/libmypaint-brushlib.so # see next comment

scons prefix=~/mypaintdev/ install # not ideal, but making a symlink for a 'missing' lib, then running scons again

echo "MyPaint is now installed in the mypaintdev folder in your home directory."
 * 1) Just lets you know that you've installed MyPaint into this folder.

sleep 3
 * 1) wait three seconds so the user can see the above message

~/mypaintdev/bin/mypaint
 * 1) Launches the MyPaint installation.

This is a simple update (bash) script you can use.

cd ~/mypaint-src/ scons --clean git pull git submodule update --init --force scons prefix=~/mypaintdev/ install ~/mypaintdev/bin/mypaint
 * 1) !/bin/bash