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 nmk_python.files.PythonFilesFinder

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

${sourceDir}/${pythonTestPackage}

This is the root folder for python tests source code.

pythonTestSrcFiles – Python tests found source files

Type

Default value

list[str]

Generated by nmk_python.files.PythonTestFilesFinder

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 nmk_python.version.PythonVersionResolver

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.10”

Last update in version 1.6.0

This is the minimum python version supported by this project.

pythonMaxVersion – Maximum supported python version

Type

Default value

str

“3.14”

Last update in version 1.6.0

This is the maximum python version supported by this project.

pythonSupportedVersions – List of all supported python version

Type

Default value

list[str]

Generated by nmk_python.version.PythonSupportedVersionsResolver

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.

pythonAutoFixRules – List of auto-fixed rules (list version)

Type

Default value

list[str]

[“I”]

This is the list of rules categories for which ruff will be invoked with fix option, helping the developer to quickly fix common mistakes.

Added in version 1.2

pythonAutoFixJoinedRules – List of auto-fixed rules (string version)

Type

Default value

str

Generated by nmk_python.ruff.JoinedRulesResolver

This is a comma seperated string version of ${pythonAutoFixRules}

Added in version 1.2

pythonRuffCommonExtraArgs – Extra args for all ruff commands

Type

Default value

str

“”

Extra arguments to be added to all ruff commands executed by py.format, py.fix and py.analyze tasks.

Added in version 1.2

pythonRuffFormatExtraArgs – Extra args for ruff format command

Type

Default value

str

“”

Extra arguments to be added to ruff command executed by py.format task.

Added in version 1.2

pythonRuffFixExtraArgs – Extra args for ruff fix command

Type

Default value

str

“”

Extra arguments to be added to ruff command executed by py.fix task.

Added in version 1.2

pythonRuffCheckExtraArgs – Extra args for ruff check command

Type

Default value

str

“”

Extra arguments to be added to ruff command executed by py.analyze task.

Added in version 1.2

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.

pythonRuffFixStamp – Python fix stamp file

Type

Default value

str

${outputDir}/.ruff-fix

This is the stamp file updated each time the py.fix task is executed.

Added in version 1.2

pythonRuffCheckStamp – Python check stamp file

Type

Default value

str

${outputDir}/.ruff-check

This is the stamp file updated each time the py.analyze task is executed.

pythonTypeCheckingMode – Pyright type checking mode

Type

Default value

str

“strict”

This is the rule set to use with pyright type checking tool (executed from VSCode extension).

Added in version 1.4

Build

pythonPackage – Python package name

Type

Default value

str

${projectName}

This is the name of the python package (wheel) to be generated.

pythonModule – Python module name

Type

Default value

str

Generated by nmk_python.build.PythonModuleResolver

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).

pythonPackageOptionalRequirements – Python package optional dependencies

Type

Default value

dict[str,list[str]]

{}

This is the list of python package optional dependencies for the built wheel. This is a map of extra dependencies to be installed when the wheel itself is installed with an extra specifier.

E.g. when a sample wheel is built with this configuration:

pythonPackageOptionalRequirements:
  my-option:
    - numpy

… the extra numpy dependency will be installed only if the sample[my-option] syntax is used in requirements.

Added in version 1.3

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.

pythonEditablePipInstallArgs – pip arguments for editable mode install

Type

Default value

list[str]

[”–no-deps”, “–no-build-isolation”]

This is the list of pip install options to be used when installing project in editable mode with py.editable task, with pip build backend.

Renamed in version 1.7.0 – was previously named ${pythonEditableInstallArgs}

pythonWheelPipInstallArgs – pip arguments for wheel install

Type

Default value

list[str]

[”–force-reinstall”, “–no-deps”]

This is the list of pip install options to be used when installing project built wheel with py.install task, with pip build backend.

Renamed in version 1.7.0 – was previously named ${pythonWheelInstallArgs}

pythonEditableUvInstallArgs – uv arguments for editable mode install

Type

Default value

list[str]

[]

This is the list of uv sync options to be used when installing project in editable mode with py.editable task, with uv build backend.

Added in version 1.7.0

pythonWheelUvInstallArgs – uv arguments for wheel install

Type

Default value

list[str]

[]

This is the list of uv pip install options to be used when installing project built wheel with py.install task, with uv build backend.

Added in version 1.7.0 – was previously named ${pythonWheelInstallArgs}

pythonBuildExcludedModules – Excluded modules from wheel build

Type

Default value

list[str]

[”${pythonTestPackage}*”]

This is the list of python modules to be excluded (relatively to source directories) when building the python wheel. Default behavior is to exclude the tests modules (i.e. ${pythonTestPackage} module and sub-modules).

Added in version 1.5

pythonDevRequirements – Python development dependencies

Type

Default value

list[str]

Generated by nmk_python.build.PythonDevDepsResolver

This is the generated list of python packages which are not direct dependencies of the current package. It’s mainly used for dev dependency group generation in ${pythonProjectFile} file.

Added in version 1.7.0

pythonArchiveRequirements – Python archive dependencies

Type

Default value

dict[str,str]

Generated by nmk_python.build.PythonArchiveDepsResolver

This is the generated dict of referenced python local wheels (see ${venvArchiveDeps}), indexed by package names. It’s mainly used for dev dependency group generation in ${pythonProjectFile} file.

Added in version 1.7.0

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]

see below

This is a name/value dictionary of pytest options used on the command line when launching tests. Name/value pairs are converted to command-line options using the --name=value syntax.

Warning

Because of YAML “feature” to consider some values as valid booleans (e.g. unquoted no value is parsed as a boolean false), please pay attention to these options syntax.

Default options are: