This document is intended for developers of this project. It explains first, how to a local version of the library inside the provided Docker container. Later, it explains how to build Python wheels for distribution via PyPI.
The following steps explain how to build and run a local version of the library inside the provided Docker container.
- Build and start the container image
sudo docker-compose build
sudo-docker-compose up
- Enter interactive shell in a new terminal
sudo docker exec -it video_cap_dev bash
- Build from source
python3 setup.py install
- Run the test to see if everything works
python3 video_cap_test.py
This packages the entire application in form of binary python wheels which can be uploaded to PyPI and easily installed via pip.
Build and start the Docker container with sudo docker-compose build
and sudo-docker-compose up
and enter an interactive shell prompt sudo docker exec -it video_cap_dev bash
. All following steps have to be performed inside this shell prompt.
Install all Python versions for which distribution wheels should be build
sudo apt-get update && sudo apt-get install python3.6 python3.7
Install virtual environment
pip3 install virtualenv
For each Python version (3.x) repeat the following steps 0. Enter the correct directory
cd /home/video_cap
- Create a virtual environment
virtualenv --python=/usr/bin/python3.x venv3.x
- Activate the environment
source venv3.x/bin/activate
- Install packages into virtual environment
pip3 install pkgconfig==1.5.1 numpy==1.17.0
- Create the python wheel
python3 setup.py bdist_wheel
- Deactivate the environment
deactivate
This creates the Python wheel for distribution via PyPI. For further details refer to the packaging guide.
Once uploaded to PyPI, installation via pip install video_cap
is possible on machines which run a compatible python version.