If the main.py contains an import which raises ModuleNotFoundError, then the plugin concludes that it was the import of main itself that caused this exception, and then continues after printing a misleading warning: No default module `main` found. The expected and more helpful behavior would be a big obvious fail with ModuleNotFound :)
$ cat mkdocs.yml
site_name: My Test
plugins:
- macros
$ cat main.py
import does_not_exist # raises ModuleNotFoundError
$ mkdocs serve
INFO - Building documentation...
INFO - [macros] - No default module `main` found
INFO - [macros] - Config variables: ['extra', 'config', 'environment', 'plugin', 'git', 'macros', 'filters', 'filters_builtin']
INFO - [macros] - Config macros: ['context', 'macros_info', 'now', 'fix_url']
INFO - [macros] - Config filters: ['pretty', 'relative_url']
INFO - Cleaning site directory
INFO - Documentation built in 0.05 seconds
INFO - [22:48:38] Serving on http://127.0.0.1:8000/
^CINFO - Shutting down...
If the main.py contains an import which raises ModuleNotFoundError, then the plugin concludes that it was the import of
mainitself that caused this exception, and then continues after printing a misleading warning:No default module `main` found. The expected and more helpful behavior would be a big obvious fail with ModuleNotFound :)