Skip to content

Building and Testing

Before starting building and testing package set up Developer's Environment first. From here and below we consider the shell's current directory matches the project's root directory.

Building Package

To test the package build run:

$ python -m build --sdist --wheel

Compiled packages will be available in the dist/ directory.

Running tests

To run the test suit:

$ pytest -vv

Running Lints

All lints are checked as part of GitHub Actions Workflow. You may run lints manually before committing to the project.

Check Formatting

Python Code Formatting is the mandatory requirement in our Code Quality standards. To check code formatting run:

$ black --check examples/ src/ tests/

To fix formatting errors run:

$ black examples/ src/ tests/

We recommend setting python code formatting on file saving (Done in VS Code Dev Container out of the box).

Python Code Lints

Python Code Linting is the mandatory requirement in our Code Quality standards. To check code for linting errors run:

$ flake8 examples/ src/ tests/

Python Code Static Checks

Python Code Static Checks is the mandatory requirement in our Code Quality standards. To check code for typing errors run:

$ mypy --strict src/

Python Test Code Coverage Check

To evaluate code coverage run tests:

$ coverage run -m pytest -vv

To report the coverage after the test run:

$ coverage report

To show line-by-line coverage:

$ coverage html

Then open dist/coverage/index.html file in your browser.

Building Documentation

To rebuild and check documentation run

$ mkdocs serve

We recommend using Grammarly service to check documentation for common errors.