I have a method cli in mymodule which is the entrypoint for my programm. cli takes several keyword arguments. The module mymodule does not contain something like
if __name__ == "__main__":
cli(...)
How do i specify a run-configuration for this?
I tried
{
"name": "myentrypoint",
"type": "debugpy",
"request": "launch",
"module": "mymodule.cli",
"console": "integratedTerminal",
"args": [
"--arg1", "value1",
"--arg2", "value2"
],
"justMyCode": true
}
(as suggested in How to make VScode launch.json for a Python module)
This gives me
/home/xxxxxx/projects/myproject/.venv/bin/python: Error while finding module specification for 'mymodule.cli' (ModuleNotFoundError: __path__ attribute not found on 'mymodule' while trying to find 'mymodule.cli')
Normally I use this entrypoint using poetry like
[tool.poetry.scripts]
myentrypoint= 'mymodule:cli'
And then from the terminal
poetry run myentrypoint --arg1 "value1" --arg2 "value2
But now I need to debug the program