Tasks

The nmk-proto plugin defines the tasks described below.

Setup tasks

All tasks in this chapter are dependencies of the base setup task.

proto.gen.py – Generate python code

This task is used to generate python source code from protos files found in ${protoFolder} folder. Files will be generated in first found python source folder (first element of ${pythonSrcFolders}). Generated python module(s) folder(s) will be automatically declared to be ignored by ruff tool and source code coverage when running pytest.

Property

Value/description

builder

nmk_proto.python.ProtoPythonBuilder

input

${protoInputFiles} proto files

output

${pythonGeneratedSrcFiles} generated files

if

${pythonGeneratedSrcFiles} (i.e. only if python generated files are expected)

The builder is called with the following parameters mapping:

Name

Value

init_template

${protoPythonGeneratedInitTemplate}

all_input_subdirs

${protoAllInputSubDirs}

options

${protoPathOptions}

src_folders

${protoPythonSrcFolders}

extra_args

${protoPythonExtraArgs}

Test tasks

All tasks in this chapter are dependencies of the base tests task.

proto.check.py – Verify generated python code

This task verifies if generated code can correctly be imported in a python script (e.g. it typically fails if 2 different enums are defining the same constant).

Property

Value/description

builder

nmk_proto.python.ProtoPythonChecker

if

${pythonGeneratedSrcFiles} (i.e. only if python generated files are expected)

unless

${protoDisableCheck}

The builder is called with the following parameters mapping:

Name

Value

src_folders

${protoPythonSrcFolders}