A condition is missing for the case that app_path
does not contain a colon.
Using Litestar app from env: 'invalid'
Traceback (most recent call last):
File "/home/henry/miniconda3/envs/facefusion/bin/litestar", line 8, in <module>
sys.exit(run_cli())
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/litestar/__main__.py", line 6, in run_cli
litestar_group()
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/rich_click/rich_command.py", line 367, in __call__
return super().__call__(*args, **kwargs)
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/rich_click/rich_command.py", line 151, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/litestar/cli/_utils.py", line 224, in make_context
self._prepare(ctx)
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/litestar/cli/_utils.py", line 206, in _prepare
env = ctx.obj = LitestarEnv.from_env(ctx.params.get("app_path"), ctx.params.get("app_dir"))
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/litestar/cli/_utils.py", line 112, in from_env
loaded_app = _load_app_from_path(app_path)
File "/home/henry/miniconda3/envs/facefusion/lib/python3.10/site-packages/litestar/cli/_utils.py", line 276, in _load_app_from_path
module_path, app_name = app_path.split(":")
ValueError: not enough values to unpack (expected 2, got 1)
Either add a condition to _load_app_from_path
or introduce a safe_split
utility/helper.
No response
litestar --app invalid
### Steps to reproduce
_No response_
### Screenshots
```bash
"![SCREENSHOT_DESCRIPTION](SCREENSHOT_LINK.png)"
No response
2.13.0final0
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too