Configuration Extension¶
As for all nmk projects config items, nmk-base ones are all overridable by other plug-ins and project files. But the ones described on this page are specifically designed to be extended.
Dependencies handling¶
The nmk-base plugin allows to declare and install different kind of dependencies in an nmk project.
Python modules dependencies¶
The nmk-base plugin handles a Python virtual environment (”venv”) for nmk projects.
It generates a requirements file (typically a requirements.txt file in the project root folder), and handles the venv lifecycle:
The
buildenvtool creates the venv if it doesn’t exist yetThe py.venv task maintains it up to date by adding new requirements when project files are updated.
nmk projects or plugins can extend the following config items to declare Python modules dependencies to be installed in the venv:
venvPkgDeps: list of Python modules names to be installed. Example:
venvPkgDeps: - numpy
venvArchiveDeps: list of local Python module archives installed. Example:
venvArchiveDeps: - /some/local/path/to/my-module.wheel - /some/other/module.tar.gz
venvFileDeps: list of requirements files to be merged in the generated requirements file. Example:
venvFileDeps: - ${PROJECTDIR}/test-requirements.txt
System dependencies¶
The nmk-base plugin provides the sys.deps task, which verifies system dependencies before running the full nmk build.
These dependencies are declared through the systemDeps configuration item.
Example:
systemDeps:
git:
apt: ["git"]
url: https://git-scm.com/downloads
Project information¶
nmk plugins or project can override to the following items to give information about the project:
projectName: string giving the name of the project Example:
projectName: MyAwesomeProject
projectAuthor: string giving the author of the project Example:
projectAuthor: The project team name
Plugin information¶
nmk plugins can contribute to the following items to give version/doc information:
nmkPluginsVersions: object giving the plugin version. Example:
nmkPluginsVersions: my-plugin-name: 1.0.0
nmkPluginsDocs: object giving the URL to the plugin documentation. Example:
nmkPluginsDocs: my-plugin-name: https://someurl/to/my/doc
Git ignored files¶
nmk projects or plugins that want to ignore some specific files/folders can contribute to the following items:
gitIgnoredFiles: list of files to be ignored by git. Example:
gitIgnoredFiles: - some-generated-folder/ - some-generated-files.*
Line endings handling¶
nmk projects or plugins that want to identify some file types for which the line endings must be kept can contribute to the following items:
linuxLineEndings: list of file extensions which must be kept with Linux line endings. Example:
linuxLineEndings: - .csh
windowsLineEndings: list of file extensions which must be kept with Windows line endings. Example:
windowsLineEndings: - .ps
Dirty check enablement¶
By default, the git.dirty task is enabled only in CI. nmk projects or plugins may override the gitEnableDirtyCheck item to implement a logic able to toggle this check in other conditions.
Example:
gitEnableDirtyCheck:
__resolver__: path.to.my.resolver
Download tasks¶
By default, tasks using the nmk_base.common.DownloadBuilder builder are based on request.get function.
nmk projects or plugins may override the requestFunction item to specify an alternative function to do the same.
It can be convenient for credentials injection, proxy handling or URL re-writing, for example.
Example:
requestFunction: mymodule.my_get_override
Java runtime¶
If any nmk project aims to use a custom java runtime instead of the system one, it may override the javaRuntimeCustomPath to define this path.
Example:
javaRuntimeCustomPath: /tmp/custom/java