Everyone that wants to contribute to the project should read this document.
You may follow these steps if you wish to create a pull request. Fork the repo and clone it on your local machine. Then in the project's directory:
virtualenv env # Create a virtualenv for the project's dependencies.
source env/bin/activate # Activate the virtualenv.
pip install tox # Install tox, which runs linting and tests.
tox # This runs all tests on your local machine. Make sure they pass.
If you don't have Python 2.6, 2.7, and 3.4 installed, you can manually run tests on one specific version by running
tox -e lint,py27
(for Python 2.7) instead.
Keep code style consistent with the rest of the project. Some suggestions:
- Write tests for your new features.
if new_feature else
Write tests for bug-causing scenarios. - Write docstrings for all classes, functions, methods, modules, etc.
- Document all function/method arguments and return values.
- Document all class variables instance variables.
- Documentation guidelines also apply to tests, though not as strict.
- Keep code style consistent, such as the kind of quotes to use and spacing.
- Don't use
except:
orexcept Exception:
unless you have araise
in the block. Be specific about error handling. - Don't use
isinstance()
(it breaks duck typing).
Thanks for fixing bugs or adding features to the project!