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 buildenv tool creates the venv if it doesn’t exist yet

  • The 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 disabled. nmk projects or plugins may override the gitEnableDirtyCheck item to implement a logic able to toggle this check in certain conditions (e.g. in automated builds).

Example:

gitEnableDirtyCheck:
    __resolver__: path.to.my.resolver