--- name: init_uv_venv kind: function lang: bash domain: infra version: "1.0.0" purity: impure signature: "init_uv_venv([project_dir: string]) -> string" description: "Crea un virtualenv Python con uv en el directorio dado si no existe. Fallback a python3 -m venv. Retorna la ruta del venv." tags: [python, venv, uv, setup, infra] uses_functions: [] uses_types: [] returns: [] returns_optional: false error_type: "error_go_core" imports: [] tested: false tests: [] test_file_path: "" file_path: "bash/functions/infra/init_uv_venv.sh" --- ## Ejemplo ```bash source init_uv_venv.sh venv=$(init_uv_venv /home/lucas/analysis/finanzas) echo "Venv creado en: $venv" # Idempotente — si ya existe, retorna la ruta sin recrear venv=$(init_uv_venv .) ``` ## Notas Idempotente: si el venv ya existe con un python valido, retorna la ruta sin hacer nada. Prefiere uv por velocidad, usa python3 como fallback.