DGP can be installed into a virtual environment and is a convenient way of developing locally and testing small changes.
To make a new virtual environment named env:
dgp$ python3 -m venv envActivate your virtual environment.
dgp$ source env/bin/activateWhile active, running python will run the virtual environment's python, and installing packages with pip will install them to the virtual environment's site-packages. You will need to install a few dependencies prior to installing DGP.
dgp$ pip install --upgrade pip
dgp$ pip install -r requirements.txt -r requirements-dev.txtFinally DGP can be installed. Installing in editable mode means that changes you make to DGP locally will be reflected in the version installed in pip which makes local development very convenient. From DGP repository root:
dgp$ pip install --editable .To check if DGP is installed correctly, run the unit tests by running:
dgp$ make testRun DGP CLI via:
dgp$ dgp_cli --helpWhile most changes will be reflected automatically in editable mode, any changes to the protos, which require their own build step, will need to be run manually. To update any changes to the protos, please run make develop again.
Finally to deactivate the environment
dgp$ deactivateTo set up linters, run
dgp$ make setup-linters
Note that if your environment's Python version does not match the version DGP targets, your linting experience might not match that in CI.