llama-stack/llama_stack/cli/stack
Ignas Baranauskas 28930cdab6
fix: handle None external_providers_dir in build with run arg (#2269)
# What does this PR do?
Fixes an issue where running `llama stack build --template ollama
--image-type venv --run` fails with a TypeError when validating external
providers directory paths.

The error occurs because `os.path.exists()` is called with `Path(None)`
instead of converting it to a string first. This change ensures
consistent handling of `None` values for `external_providers_dir` across
both build and
[run](https://github.com/meta-llama/llama-stack/blob/main/llama_stack/cli/stack/run.py#L134)
commands by using `str()` conversion before path validation.

[//]: # (If resolving an issue, uncomment and update the line below)
[//]: # (Closes #[issue-number])

## Test Plan
```bash
INFERENCE_MODEL=llama3.2:3b uv run --with llama-stack llama stack build --template ollama --image-type venv --run
```
Command completes successfully without TypeError

[//]: # (## Documentation)
2025-05-27 09:41:12 +02:00
..
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
_build.py fix: handle None external_providers_dir in build with run arg (#2269) 2025-05-27 09:41:12 +02:00
build.py feat: --image-type argument overrides value in --config build.yaml (#2179) 2025-05-16 14:45:41 -07:00
list_apis.py API Updates (#73) 2024-09-17 19:51:35 -07:00
list_providers.py chore: more mypy fixes (#2029) 2025-05-06 09:52:31 -07:00
list_stacks.py feat: add llama stack rm command (#2127) 2025-05-21 10:25:51 +02:00
remove.py chore: make cprint write to stderr (#2250) 2025-05-24 23:39:57 -07:00
run.py feat: start ui server in llama stack run (#2170) 2025-05-23 20:00:09 -07:00
stack.py feat: add llama stack rm command (#2127) 2025-05-21 10:25:51 +02:00
utils.py fix: Use CONDA_DEFAULT_ENV presence as a flag to use conda mode (#1555) 2025-03-27 17:13:22 -04:00