Skip to content

Latest commit

 

History

History
78 lines (57 loc) · 2.47 KB

building.md

File metadata and controls

78 lines (57 loc) · 2.47 KB

Building and running a local version of KUKSA Puthon SDK

For development purposes it may be necessary to customize the code for the client and run a locally built version. To be able to build all submodules must be present, and you build from the kuksa-client folder.

git submodule update --init
cd kuksa-client

First we suggest you create a dedicated python virtual environment for kuksa-client:

mkdir --parents ~/.venv
python3 -m venv ~/.venv/kuksa-client
source ~/.venv/kuksa-client/bin/activate  # Run this every time you want to activate kuksa-client's virtual environment

Your prompt should change to somehting indicating you are in the virutal environment now, e.g.

(kuksa-client) $

Inside the virtual environment install the dependencies

pip install --upgrade pip

Now in order to ensure local *.py files will be used when running the client, we need to install kuksa-client in editable mode:

pip install -r requirements.txt -e .

If you wish to also install test dependencies, run instead:

pip install -r test-requirements.txt -e ".[test]"

Now you should be able to start using kuksa-client:

kuksa-client --help

Whenever you want to exit kuksa-client's virtual environment, simply run:

deactivate

Managing Build Requirements

kuksa-client relies on pip-tools to pin requirements versions. This guide gives you instructions to pin requirements for python3.8 which is the minimum version kuksa-client supports.

Upgrade Requirements

We're using pip-tools against our setup.cfg file. This means pip-tools will make sure that the versions it will pin match constraints from setup.cfg.

First install pip-tools:

$ pip install pip-tools

Then, check requirements version constraints within setup.cfg are still valid or update them accordingly. Then:

To upgrade requirements versions within requirements.txt, do:

$ python3.8 -m piptools compile --upgrade --resolver=backtracking setup.cfg

To upgrade requirements versions within test-requirements.txt, do:

$ python3.8 -m piptools compile --upgrade --extra=test --output-file=test-requirements.txt --resolver=backtracking setup.cfg

If you wish to upgrade individual packages see Updating requirements.