Configuration Reference
The nmk-python plugin handles the configuration items listed in this page.
All of them are initiliazed with convenient default values, so that you don’t need to setup them for a default working behavior. You can anyway override them in your project if you need to fine tune the plugin behavior. Some items are specifically designed to be extended by nmk projects and plugins.
Files
pythonSrcFolders – Python source code folders
Type |
Default value |
|---|---|
list[str] |
[ ${sourceDir} ] |
These are the paths nmk will browse to find source files.
pythonGeneratedSrcFiles – Python generated source files
Type |
Default value |
|---|---|
list[str] |
[] |
This is a list of generated source files, which shall be contributed by any source code generation logic (out of scope of this plugin).
pythonFoundSrcFiles – Python found source files
Type |
Default value |
|---|---|
list[str] |
Generated by |
This is the list of source files for this python project (excluding test and generated ones; found in ${pythonSrcFolders}).
pythonTestPackage – Python tests package name
Type |
Default value |
|---|---|
str |
tests |
This is the name of the python module containing tests.
pythonTestSources – Python tests source code root folder
Type |
Default value |
|---|---|
str |
This is the root folder for python tests source code.
pythonTestSrcFiles – Python tests found source files
Type |
Default value |
|---|---|
list[str] |
Generated by |
This is the list of python tests files for this project (found in ${pythonTestSources} folder).
pythonSrcFiles – All python source files
Type |
Default value |
|---|---|
list[str] |
[ ${pythonFoundSrcFiles}, ${pythonTestSrcFiles}, ${pythonGeneratedSrcFiles} ] |
This is a concatenation of all python source code files for this project.
Version
pythonVersion – Python version
Type |
Default value |
|---|---|
str |
Generated by |
This is the current project version (respecting PyPa version specifiers), derived from ${gitVersion}
pythonVersionStamp – Python version stamp file
Type |
Default value |
|---|---|
str |
${outputDir}/.pythonversion |
This is the python version stamp file, updated each time the version is modified.
pythonMinVersion – Minimum supported python version
Type |
Default value |
|---|---|
str |
“3.8” |
This is the minimum python version supported by this project.
pythonMaxVersion – Maximum supported python version
Type |
Default value |
|---|---|
str |
“3.12” |
This is the maximum python version supported by this project.
pythonSupportedVersions – List of all supported python version
Type |
Default value |
|---|---|
list[str] |
Generated by |
This is the list of all supported python versions for this project.
Project
pythonProjectFile – Python project file
Type |
Default value |
|---|---|
str |
${PROJECTDIR}/pyproject.toml |
This is python project file, holding settings for python package generation and various python tools.
pythonProjectFileFragments – Python project contributed fragment files
Type |
Default value |
|---|---|
list[str] |
[] |
List of project fragment files to be merged in generated ${pythonProjectFile} file.
pythonProjectFileItems – Python project file contributed items
Type |
Default value |
|---|---|
Dict |
{} |
Dictionary of items to be contributed in generated ${pythonProjectFile} file.
Code format/analysis
pythonLineLength – Max python source line length
Type |
Default value |
|---|---|
int |
160 |
This is the maximum line length when formatting code with ruff.
pythonIgnoredRules – List of ignored rules
Type |
Default value |
|---|---|
list[str] |
[“E203”,”E501”] |
This is the list of rules that need to be ignored when analyzing code with ruff.
pythonRuffFormatStamp – Python format stamp file
Type |
Default value |
|---|---|
str |
${outputDir}/.ruff-format |
This is the stamp file updated each time the py.format task is executed.
pythonRuffCheckStamp – Python check stamp file
Type |
Default value |
|---|---|
str |
${outputDir}/.ruff-check |
This is the stamp file updated each time the py.analysis task is executed.
Build
pythonPackage – Python package name
Type |
Default value |
|---|---|
str |
This is the name of the python package (wheel) to be generated.
pythonModule – Python module name
Type |
Default value |
|---|---|
str |
Generated by |
This is the name of the python module (typically the same than the wheel name, with “_” instead of “-“).
pythonPackagePlatform – Python package platform tag
Type |
Default value |
|---|---|
str |
any |
This is the platform tag for the current python project.
pythonArtifacts – Python artifacts folder
Type |
Default value |
|---|---|
str |
${outputDir}/artifacts |
This is the output folder where the python wheel is generated.
pythonBuildDir – Python build folder
Type |
Default value |
|---|---|
str |
${outputDir}/python |
This is the output path where the wheel build is performed.
pythonWheel – Python generated wheel file
Type |
Default value |
|---|---|
str |
${pythonArtifacts}/${pythonModule}-${pythonVersion}-py3-none-${pythonPackagePlatform}.whl |
This is the generated python wheel file.
pythonPackageRequirements – Python package dependencies
Type |
Default value |
|---|---|
list[str] |
[] |
This is the list of python package dependencies for the built wheel (i.e. list of packages to be installed when the wheel itself is installed).
pythonExtraResources – Python extra bundled resources
Type |
Default value |
|---|---|
dict[str,str] |
{} |
This is a dictionary specifying extra resources to be bundled in the built python wheel, that are not part of the source tree:
keys are existing resource files or folders
values are expected paths in the source tree
Paths may be absolute or relative; non-absolute paths are considered to be relative to the project root folder.
Note
Resources won’t actually be copied in the source tree. Destination path should be considered as the location where resource would exist in the source tree.
pythonEditableStamp – Python editable install stamp file
Type |
Default value |
|---|---|
str |
${outputDir}/.pyeditable |
This is the python editable install stamp file, updated each time the project is installed in editable mode.
Tests
pythonTestOutput – Python tests output folder
Type |
Default value |
|---|---|
str |
${outputDir}/tests |
This is the output folder where tests results are generated.
pythonCoverageHtmlReport – Python code coverage HTML report folder
Type |
Default value |
|---|---|
str |
${outputDir}/coverage-report |
This is the output folder where python code coverage HTML report is generated.
pythonCoverageXmlReport – Python code coverage XML report file
Type |
Default value |
|---|---|
str |
${outputDir}/coverage.xml |
This is the output file for python code coverage XML report.
pythonCoverageFile – Python code coverage data file
Type |
Default value |
|---|---|
str |
${outputDir}/.coverage |
This is the cumulative data file for python code coverage.
pytestExtraArgs – Extra pytest arguments
Type |
Default value |
|---|---|
dict[str, str] |
{“numprocesses”: “auto”, “cov-fail-under”: 100, “dist”: “loadgroup”} |
This is a name/value dictionary of pytest options used on the command line when launching tests.