Developer's Setup Guide

The following steps show how to install Protari so that you can easily make changes to the code, and test them.

Follow the protari-sample quick start guide (almost)

First, make sure you have protari-sample working by following the steps in the Quick Start guide. You probably want to use the master version of protari-sample, so do not checkout the last tagged version (unless you have a reason to).

Point protari-sample's pipenv to your protari directories

Currently, protari-sample sets you up with editable protari and protari-api directories, but they are located in a directory such as ~/.local/share/virtualenvs/protari-sample-LlMjhBnu/src/protari-api.

If you want your protari, protari-api and protari-setup repositories to sit alongside protari-sample, you can override this as follows:

cd ..  # ie. the level above protari-sample
git clone path/to/protari.git
git clone path/to/protari-api.git
git clone path/to/protari-setup.git
cd protari-sample
pipenv shell
(protari-sample-LlMjhBnu) bash-3.2$ pip install -e ../protari
(protari-sample-LlMjhBnu) bash-3.2$ pip install -e ../protari-api
(protari-sample-LlMjhBnu) bash-3.2$ pip install -e ../protari-setup
(protari-sample-LlMjhBnu) bash-3.2$ python application.py  # to run the API

Point protari-* pipenvs to your protari directory

If you plan to change protari-api or protari-setup, you will need to repeat this process for them too.

cd ../protari-api
pipenv install --dev  # install the development dependencies
pipenv shell
(protari-api-J8HU-PNA) bash-3.2$ pip install -e ../protari
(protari-api-J8HU-PNA) bash-3.2$ source scripts/check_code.sh  # see below
(protari-api-J8HU-PNA) bash-3.2$ exit
cd ../protari-setup
pipenv install --dev  # install the development dependencies
pipenv shell
(protari-setup-Kofx0a1M) bash-3.2$ pip install -e ../protari
(protari-setup-Kofx0a1M) bash-3.2$ source scripts/check_code.sh  # see below
(protari-setup-Kofx0a1M) bash-3.2$ exit

Try it out

Aside - Pipfile vs setup.py

How do the protari-sample requirements relate to those of protari and protari-api?

protari-sample's Pipfile.lock file contains pinned versions of all the dependencies used to run the sample instance of the API, including protari and protari-api. (Formerly this function was filled by requirements.txt.) If you use pipenv install, every time you run protari-sample, you know you are getting the same versions.

Two of those requirements are protari and protari-api. These are libraries, just like all the other dependencies (such as Flask or SqlAlchemy).

This means that when they are installed, their setup.py scripts are used to get their dependencies: their Pipfile and Pipfile.lock files are ignored. These files are only made available to record which versions Protari has been tested against, and to help you choose versions for your own instance, if desired.