8.5.1.3. pymodaq_utils.plugin_tools.extension_checks module
Check the modules of Dashboard extensions: the check_extension command.
It applies the rules PMQ330 to PMQ339 (see pymodaq_utils.plugin_tools.rules.check_extension_source()) to a python
file or to a folder, whether the extension belongs to a plugin package or to PyMoDAQ itself. The sources are read,
nothing is imported. check_plugin also applies these rules to the extensions folder of a plugin package.
Added in version 5.3.7.
- pymodaq_utils.plugin_tools.extension_checks.check_extension_files(targets, fail_on='error', core=None)[source]
Run the extension rules on files or folders and return a report
- Parameters:
targets (
Sequence[str|Path]) – python files of extensions, or folders (seefind_extension_files())fail_on (
str) – ‘error’ (default), ‘warning’ or ‘todo’, seepymodaq_utils.plugin_tools.checks.FAIL_LEVELScore (
Optional[bool]) – True for the extensions of PyMoDAQ: PMQ330 (EXTENSION_NAMEandCLASS_NAMEmissing) is then not reported. By default found from the path of each file (pymodaq/extensions).
- Return type:
- pymodaq_utils.plugin_tools.extension_checks.find_extension_files(target)[source]
The python files to check: the file itself, or the modules of a folder
For a folder holding an
extensionsfolder (the plugin package, or the repository with itssrcfolder) the modules of this folder are taken, otherwise all the modules of the folder and its sub-folders. The__init__and the private modules (starting with_) are left out.
- pymodaq_utils.plugin_tools.extension_checks.is_core_extension(path)[source]
Whether a file is in the
extensionsof thepymodaqpackage: the core extensions are registered inpymodaq.extensionsand do not need to defineEXTENSION_NAMEandCLASS_NAME- Return type:
- pymodaq_utils.plugin_tools.extension_checks.main(argv=None)[source]
Print the report on extension modules: the
check_extensioncommand (orpython -m pymodaq_utils.plugin_tools.extension_checks)Returns 0 if the checks pass, 1 otherwise (so that it can also be used in a script or a CI).
- Return type: