Contributing to Larq

👍 🎉 First off, thanks for taking the time to contribute! 👍 🎉

Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub.

Ask a question or raise an issue

If you have questions about Larq or just want to say Hi you can chat with us on Spectrum.

If something is not working as expected, if you run into problems with Larq or if you have ideas for missing features, please open a new issue.

Project setup

To send a Pull Request it is required to fork Larq on GitHub. After that clone it to a desired directory:

git clone

Install all required dependencies for local development by running:

cd larq # go into the directory you just cloned
pip install -e ".[tensorflow]" # Installs Tensorflow for CPU
# pip install -e ".[tensorflow_gpu]" # Installs Tensorflow for GPU
pip install -e ".[test]" # Installs all development dependencies

Run Unit tests

Inside the project directory run:

pytest . -n auto

Build documentation

Installs dependencies for building the docs:

pip install nbconvert git+
pip install -e ".[docs]"

Inside the project directory run:

mkdocs serve

A new version of the documentation will be automatically published once merged into the master branch.

Code style

We use black to format all of our code. We recommend installing it as a plugin for your favorite code editor.

Publish release

  1. Increment the version number in, and make a PR with that change.

  2. Wait until your PR is reviewed and merged.

  3. Create and push a new tag from the latest master branch (e.g. v0.7.0).

git checkout master
git pull
git tag <version number>
git push --tags
  1. A GitHub action will automatically publish a release to PyPI based on the tag.

  2. Go to the GitHub releases and publish the draft based on the tag you've just pushed and edit the release notes.