Skip to content

Latest commit

 

History

History
48 lines (37 loc) · 1.45 KB

VIRTUAL_ENV.md

File metadata and controls

48 lines (37 loc) · 1.45 KB

Virtual Environment Installation

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 env

Activate your virtual environment.

dgp$ source env/bin/activate

While 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 cython==0.29.21 numpy==1.19.4 grpcio==1.41.0 grpcio-tools==1.41.0

Finally 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 repo root:

dgp$ pip install --editable .

Alternatively, you can install cython, numpy, grpc and DGP by running:

dgp$ make develop

To check if DGP is installed correctly, run the unit tests by running:

dgp$ make test

Run DGP CLI via:

dgp$ dgp_cli --help

While 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$ deactivate