# 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](extend.md) are specifically designed to be extended by **`nmk`** projects and plugins. ## Files (pythonSrcFolders)= ### **`pythonSrcFolders`** -- Python source code folders | Type | Default value | |- |- | list[str] | [ [${sourceDir}](https://nmk-base.readthedocs.io/en/stable/config.html#sourcedir-source-base-directory) ] These are the paths **nmk** will browse to find source files. (pythonGeneratedSrcFiles)= ### **`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)= ### **`pythonFoundSrcFiles`** -- Python found source files | Type | Default value | |- |- | list[str] | Generated by {py:class}`nmk_python.files.PythonFilesFinder` This is the list of source files for this python project (excluding test and generated ones; found in **{ref}`${pythonSrcFolders}`**). (pythonTestPackage)= ### **`pythonTestPackage`** -- Python tests package name | Type | Default value | |- |- | str | tests This is the name of the python module containing tests. (pythonTestSources)= ### **`pythonTestSources`** -- Python tests source code root folder | Type | Default value | |- |- | str | [${sourceDir}](https://nmk-base.readthedocs.io/en/stable/config.html#sourcedir-source-base-directory)/**{ref}`${pythonTestPackage}`** This is the root folder for python tests source code. (pythonTestSrcFiles)= ### **`pythonTestSrcFiles`** -- Python tests found source files | Type | Default value | |- |- | list[str] | Generated by {py:class}`nmk_python.files.PythonTestFilesFinder` This is the list of python tests files for this project (found in **{ref}`${pythonTestSources}`** folder). (pythonSrcFiles)= ### **`pythonSrcFiles`** -- All python source files | Type | Default value | |- |- | list[str] | [ **{ref}`${pythonFoundSrcFiles}`**, **{ref}`${pythonTestSrcFiles}`**, **{ref}`${pythonGeneratedSrcFiles}`** ] This is a concatenation of all python source code files for this project. ## Version (pythonVersion)= ### **`pythonVersion`** -- Python version | Type | Default value | |- |- | str | Generated by {py:class}`nmk_python.version.PythonVersionResolver` This is the current project version (respecting [PyPa version specifiers](https://packaging.python.org/en/latest/specifications/version-specifiers/#version-specifiers)), derived from [${gitVersion}](https://nmk-base.readthedocs.io/en/stable/config.html#gitversion-git-version) (pythonVersionStamp)= ### **`pythonVersionStamp`** -- Python version stamp file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.pythonversion This is the python version stamp file, updated each time the version is modified. (pythonMinVersion)= ### **`pythonMinVersion`** -- Minimum supported python version | Type | Default value | |- |- | str | "3.8" This is the minimum python version supported by this project. (pythonMaxVersion)= ### **`pythonMaxVersion`** -- Maximum supported python version | Type | Default value | |- |- | str | "3.12" This is the maximum python version supported by this project. (pythonSupportedVersions)= ### **`pythonSupportedVersions`** -- List of all supported python version | Type | Default value | |- |- | list[str] | Generated by {py:class}`nmk_python.version.PythonSupportedVersionsResolver` This is the list of all supported python versions for this project. ## Project (pythonProjectFile)= ### **`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)= ### **`pythonProjectFileFragments`** -- Python project contributed fragment files | Type | Default value | |- |- | list[str] | [] List of project fragment files to be merged in generated **{ref}`${pythonProjectFile}`** file. (pythonProjectFileItems)= ### **`pythonProjectFileItems`** -- Python project file contributed items | Type | Default value | |- |- | Dict | {} Dictionary of items to be contributed in generated **{ref}`${pythonProjectFile}`** file. ## Code format/analysis (pythonLineLength)= ### **`pythonLineLength`** -- Max python source line length | Type | Default value | |- |- | int | 160 This is the maximum line length when formatting code with [ruff](https://astral.sh/ruff). (pythonIgnoredRules)= ### **`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](https://astral.sh/ruff). (pythonRuffFormatStamp)= ### **`pythonRuffFormatStamp`** -- Python format stamp file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.ruff-format This is the stamp file updated each time the **{ref}`py.format`** task is executed. (pythonRuffCheckStamp)= ### **`pythonRuffCheckStamp`** -- Python check stamp file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.ruff-check This is the stamp file updated each time the **{ref}`py.analysis`** task is executed. ## Build (pythonPackage)= ### **`pythonPackage`** -- Python package name | Type | Default value | |- |- | str | [${projectName}](https://nmk-base.readthedocs.io/en/stable/config.html#projectname) This is the name of the python package (wheel) to be generated. (pythonModule)= ### **`pythonModule`** -- Python module name | Type | Default value | |- |- | str | Generated by {py:class}`nmk_python.build.PythonModuleResolver` This is the name of the python module (typically the same than the wheel name, with "_" instead of "-"). (pythonPackagePlatform)= ### **`pythonPackagePlatform`** -- Python package platform tag | Type | Default value | |- |- | str | any This is the platform tag for the current python project. (pythonArtifacts)= ### **`pythonArtifacts`** -- Python artifacts folder | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/artifacts This is the output folder where the python wheel is generated. (pythonBuildDir)= ### **`pythonBuildDir`** -- Python build folder | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/python This is the output path where the wheel build is performed. (pythonWheel)= ### **`pythonWheel`** -- Python generated wheel file | Type | Default value | |- |- | str | {ref}`${pythonArtifacts}`/{ref}`${pythonModule}`-{ref}`${pythonVersion}`-py3-none-{ref}`${pythonPackagePlatform}`.whl This is the generated python wheel file. (pythonPackageRequirements)= ### **`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)= ### **`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)= ### **`pythonEditableStamp`** -- Python editable install stamp file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.pyeditable This is the python editable install stamp file, updated each time the project is installed in editable mode. ## Tests (pythonTestOutput)= ### **`pythonTestOutput`** -- Python tests output folder | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/tests This is the output folder where tests results are generated. (pythonCoverageHtmlReport)= ### **`pythonCoverageHtmlReport`** -- Python code coverage HTML report folder | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/coverage-report This is the output folder where python code coverage HTML report is generated. (pythonCoverageXmlReport)= ### **`pythonCoverageXmlReport`** -- Python code coverage XML report file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/coverage.xml This is the output file for python code coverage XML report. (pythonCoverageFile)= ### **`pythonCoverageFile`** -- Python code coverage data file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.coverage This is the cumulative data file for python code coverage. (pytestExtraArgs)= ### **`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](https://docs.pytest.org/) options used on the command line when launching tests.