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
protari-sample sets you up with editable protari and protari-api directories,
but they are located in a directory such as
If you want your
protari-setup repositories to sit alongside
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
- Test it the type checking and tests run without errors by running
source scripts/check_code.shin each of the three directories
protari-setup(inside their own pipenv shells). (Note
protari-sampledoes not have any tests or type checking).
- You can now edit the code in any of those directories and see the changes directly when you run
python application.pyin the
Aside - Pipfile vs setup.py
How do the
protari-sample requirements relate to those of
Pipfile.lock file contains pinned versions of all the dependencies used to run the sample
instance of the API, including
(Formerly this function was filled by
If you use
pipenv install, every time you run
protari-sample, you know you are getting the
Two of those requirements are
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.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.