mpi_cmake_modules package

Submodules

mpi_cmake_modules.cmake_format module

@namespace mpi_cmake_modules.cmake_format.py

Formatting script based on cmake-format

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.cmake_format.run_cmake_format(sys_args)[source]

mpi_cmake_modules.cpp_format module

cpp_format.py

Formatting script based on clang .

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.cpp_format.run_cpp_format(sys_args)[source]

mpi_cmake_modules.documentation_builder module

documentation_builder.py

Build the documentation based on sphinx and the read_the_doc layout.

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.documentation_builder.build_documentation(build_dir, project_source_dir, project_version)[source]

mpi_cmake_modules.python_format module

python_format

Utility functions for creating formatting script based on clang

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.python_format.run_python_format(sys_args)[source]

mpi_cmake_modules.utils module

utils Utility functions for creating formatting scripts.

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.utils.code_formatter_parse_args(sys_args)[source]
mpi_cmake_modules.utils.get_absolute_path(file_or_directory)[source]

Get the absolute path of a given path and check its existence

Check if file_or_directory is an existing file or directory, if so, returns it. Otherwise, assumes it is a relative path, which it upgrades to an absolute path, this it returns. If the upgraded path does not correspond to an existing file or directory, returns None

Parameters

file_or_directory – str a relative or an absolute path

Returns

an absolute existing path (str) or None

mpi_cmake_modules.utils.list_of_files_to_format(files_or_directories, extensions)[source]

Get the list of files to format exploring the input arguments.

Explore recursively the directories given in the input list and create a list of all files. Add to this list the files given in the input list. Sort out the files that are source-files or not and return the list of source files.

Parameters
  • files_or_directories – list(str) List of files or directories.

  • extensions – list(str) List of extensions to check against

Returns

(“.h”, “.c”, “.hh”, “.cc”, “.hpp”, “.cpp”, “.hxx”, “.cxx”)

False otherwise.

Return type

True if the file ends with one of the given extensions, typically

mpi_cmake_modules.utils.test_valid_file(filename, extensions)[source]

Test if the input file exists and is of one of the provided extension.

Parameters
  • filename (str) – Path to the file to test.

  • extensions (str) – iterable of accepted extensions.

Returns

True if the file exits and ends with one of the extension.

False otherwise.

mpi_cmake_modules.yaml2oneline module

Convert a YAML file in a one line string

Example

For example, a YAML file with the content.

foo: 13 bar: 42

would be converted into

{foo: 13, bar: 42}

License BSD-3-Clause Copyright (c) 2021, New York University and Max Planck Gesellschaft.

mpi_cmake_modules.yaml2oneline.yaml2oneline(filename)[source]

Convert a yaml file into a dictionnary one-line string

This function is used here typically in order to parse the yaml config file defining the clang-format parameters.

Parameters

filename – str Path relative to the execution path or global path.

Module contents

@file @license License BSD-3-Clause @copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft.