Installing the application

There are multiple ways of installing the application libs. The recommended way is to use poetry package manager, which will create virtual environment for the project and install all required dependencies.

Alternative way is to install the application libs using pip package manager within already existing virtual environment.

Installation the application libs with poetry from provided source code

  1. Installing and initializing poetry through pipx

Firstly, pipx should be installed.

> python -m pip install --user pipx
> python -m pipx ensurepath

When pipx is installed, the installation of poetry can be executed,

> pipx install poetry
  1. Check if poetry is successfully installed

> poetry --version
  1. Install project’s packets and documentation builder packets with poetry

    > poetry env use 3.13

The previous command will create virtual environment based on `python3.13` in subdirectory `/.venv`. After that, `poetry` will installed specified libs, as well as libs that are used for documentation.
> poetry install --with docs
  1. Install universal-optimizer-lib in editable form

Library universal-optimizer-lib, described here should be installed. Source code of that library id within folder lib.

> pip install -e libs

Installation the application libs with pip from provided source code

  1. Create and activate virtual environment

> python -m venv venv
> source venv/bin/activate      # On Linux
> .\venv\Scripts\activate       # On Windows
  1. Install required dependencies from requirements.txt file

> pip install -r requirements.txt
  1. Install universal-optimizer-lib in editable form

Library universal-optimizer-lib, described here should be installed. Source code of that library is added as a submodule within folder lib.

> pip install -e lib

Running of all the unit tests within application

Unit tests are located within tests subdirectory . To run all the unit tests, the following commands can be used.

> python -m unittest

Obtaining coverage analysis of all unit tests within library can be done with coverage package. The following commands can be used:

> python -m coverage run -m unittest
> python -m coverage report

Building documentation for the application

  1. Build documentation sources into /documentation/source folder from python source files

> sphinx-apidoc -o documentation/source/ opt
  1. Change current directory to /documentation

> cd documentation
  1. Clean previously builded HTML documentation

/documentation> ./make clean html
  1. Build HTML documentation from /documentation/source directory. Created documentation is within /documentation/build/html directory.

/documentation> ./make html
  1. Generated documentation, that is in folder /documentation/build/html should be then copied into folder /docs.

/documentation> cp build/html/*.* ../docs