The development version

Unit tests
$ git clone git://
$ cd pygit2
$ python build_ext --inplace
$ pytest test

Coding style: documentation strings


def f(a, b):
    The general description goes here.

    Returns: bla bla.


    a : <type>
        Bla bla.

    b : <type>
        Bla bla.


        >>> f(...)

Running Valgrind

Step 1. Build libc and libgit2 with debug symbols. See your distribution documentation.

Step 2. Build Python to be used with valgrind, e.g.:

$ ./configure --prefix=~/Python-3.7.4 --without-pymalloc --with-pydebug --with-valgrind
$ make
$ make install
$ export PYTHONBIN=~/Python-3.7.4/bin

Step 3. Build pygit2 with debug symbols:

$ rm build -rf && $PYTHONBIN/python3 build_ext --inplace -g

Step 4. Install requirements:

$ $PYTHONBIN/python3 install
$ pip insall pytest

Step 4. Run valgrind:

$ valgrind -v –leak-check=full –suppressions=misc/valgrind-python.supp $PYTHONBIN/pytest &> valgrind.txt