Tasks
The nmk-python plugin defines the tasks described below.
Setup tasks
All tasks in this chapter are dependencies of the base setup task.
py.version – Python version stamping
This task creates/updates the ${pythonVersionStamp} stamp file, only when ${gitVersion} has changed. This allows incremental build depending on python version change (i.e. trigger rebuild if only version changed).
Property |
Value/description |
|---|---|
builder |
|
input |
${gitVersionStamp} file |
output |
|
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
version |
py.project – Python project file generation
This task generates the ${pythonProjectFile} project file.
Property |
Value/description |
|---|---|
builder |
|
input |
|
output |
${pythonProjectFile} file |
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
fragment_files |
|
items |
Build tasks
All tasks in this chapter are dependencies of the base build task.
py.format – Python code format
This task calls ruff format command to format python code of this project.
Property |
Value/description |
|---|---|
builder |
|
input |
|
output |
|
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
src_folders |
|
command |
format |
py.analysis – Python code analysis
This task calls ruff check command to analyze python code of this project.
Property |
Value/description |
|---|---|
builder |
|
input |
|
output |
|
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
src_folders |
|
command |
check |
py.build – Build Python wheel
This task use the python build module to handle the wheel build.
Property |
Value/description |
|---|---|
builder |
|
input |
|
output |
${pythonWheel} file |
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
project_file |
|
version_file |
|
source_dirs |
|
artifacts_dir |
|
build_dir |
|
extra_resources |
py.install – Install Python wheel
This task installs the built python wheel in the project venv.
Property |
Value/description |
|---|---|
builder |
|
input |
${pythonWheel} file |
output |
|
if |
${pythonSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
name |
|
pip_args |
“–force-reinstall –no-deps ${venvPipArgs}” |
Tests tasks
All tasks in this chapter are dependencies of the base tests task.
py.tests – Run Python tests
This task calls pytest command to execute python tests.
Property |
Value/description |
|---|---|
builder |
|
if |
${pythonTestSrcFiles} are found |
The builder is called with the following parameters mapping:
Name |
Value |
|---|---|
pytest_args |