Skip to content

Development environment setup

Joel edited this page Aug 4, 2020 · 1 revision

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

  1. Install virtualenv

pip3 install virtualenv

  1. 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 () preceeding the shell prompt, like so:

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

2b. To exit the virtualenv, run:

deactivate
  1. Ensure gpiod is accessible from within the virtualenv.
echo "/usr/lib64/python3.7/site-packages" > ./lib/python3.7/site-packages/gpiod.pth
  1. To install the library in the virtualenv and run the tests:
pip install -r requirements.txt
pip install -e .
make

If the tests are successful you will see two lines appear in the output among several others:

FUNCTIONAL PASS
AESTHETIC PASS
Clone this wiki locally