Project

General

Profile

Virtualenv

Virtualenv basically a way to isolate a python development environment with it's dependencies

1. Install virtualenv

pip3 install virtualenv

2. Change directory to the repoitory root and run:

virtualenv .
source bin/activate

Now, you are in the virtualenv and the python and pip commmands run versions specified in pyvenv.cfg.

2a. While in the virtualenv you will see the name of the virtualenv as (<name>) preceeding the shell prompt, like so:

(python3-libgpiod-rpi) [root@portaberry python3-libgpiod-rpi]#

2b. To exit the virtualenv, run:

deactivate

3. Ensure gpiod is accessible from within the virtualenv.

echo "/usr/lib64/python3.7/site-packages" > ./lib/python3.7/site-packages/gpiod.pth

(replace python3.7 with your locally installed version of python)

4. To install the library in the virtualenv and run the tests:

pip install -r requirements.txt
pip install -e .
make