Contributing

Requirements

When submitting a pull request, please ensure your changes meet the following requirements:

  • Pull request points to dev (development) branch.
  • Changes are squashed into a single commit.
  • Commit message is in present tense (e.g. “Add foo” over “Added foo”).
  • Sphinx-compatible docstrings.
  • PEP8 compliance.
  • Test coverage remains at %100.
  • No build failures on TravisCI.
  • Up-to-date documentation (see below).
  • Maintains backward-compatibility.
  • Maintains compatibility with Python 2.7+ and 3.4+.

Style

Run flake8 to check style:

~$ pip install flake8
~$ git clone https://github.com/joowani/binarytree.git
~$ cd binarytree
~$ flake8

Testing

Run unit tests:

~$ pip install pytest
~$ git clone https://github.com/joowani/binarytree.git
~$ cd binarytree
~$ py.test --verbose

Run unit tests with coverage:

~$ pip install coverage pytest pytest-cov
~$ git clone https://github.com/joowani/binarytree.git
~$ cd binarytree
~$ py.test --cov=binarytree --cov-report=html

# Open the generated file htmlcov/index.html in a browser

Documentation

Documentation uses reStructuredText and Sphinx. To build locally:

~$ pip install sphinx sphinx_rtd_theme
~$ git clone https://github.com/joowani/binarytree.git
~$ cd binarytree/docs
~$ sphinx-build . build
# Open build/index.html in a browser