In Python, files with relative imports need to be run as a module using python -m module.submodule instead of as a script (python module/submodule). This is especially important for executing the main() block within submodules for testing purposes.
Currently, there doesn’t seem to be an easy way to add the -m flag and convert the path from module/submodule to module.submodule when using the Python: Run File task. This limitation also makes it challenging to achieve the same behavior in debug mode.
It would be incredibly helpful if the extension provided a setting to enable running files as modules directly.
In Python, files with relative imports need to be run as a module using python -m module.submodule instead of as a script (python module/submodule). This is especially important for executing the main() block within submodules for testing purposes.
Currently, there doesn’t seem to be an easy way to add the -m flag and convert the path from module/submodule to module.submodule when using the Python: Run File task. This limitation also makes it challenging to achieve the same behavior in debug mode.
It would be incredibly helpful if the extension provided a setting to enable running files as modules directly.