From 39fa3fdc6d7d680467334fede3238f7ea7b8b6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20S=C3=A1nchez=20Magari=C3=B1os?= Date: Thu, 4 Jun 2026 13:46:37 -0300 Subject: [PATCH] =?UTF-8?q?feat:=20migrar=20de=20pyenv+pip=20a=20uv=20para?= =?UTF-8?q?=20gesti=C3=B3n=20de=20dependencias=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .envrc | 2 +- .python-version | 1 + .tool-versions | 2 ++ README.md | 22 +++++++++++----------- 4 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 .python-version diff --git a/.envrc b/.envrc index 175de89..929f81b 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -layout python +layout uv diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..2d4715b --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.11.11 diff --git a/.tool-versions b/.tool-versions index 5c0a496..b0e853c 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1,3 @@ +# Usado por asdf/pyenv. Con uv este archivo no es necesario — la versión +# de Python se especifica en .python-version. python 3.11.11 diff --git a/README.md b/README.md index fc8a24c..ae8c307 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,26 @@ trabajar inmediatamente luego de correrlo. Al momento, depende de dos roles: ## Herramientas requeridas -* [direnv](https://direnv.net/) -* [python3](https://www.python.org/downloads/) -* [pyenv](https://github.com/pyenv/pyenv#installation) +* [uv](https://docs.astral.sh/uv/getting-started/installation/) — gestor de Python y paquetes +* [direnv](https://direnv.net/) — opcional, para activar el entorno automáticamente al entrar al directorio ## Instalar roles y requerimientos -Primero se deben correr los siguientes comandos para instalar Ansible: +Instalar `uv` si no está instalado: ```bash -## Instalamos la version de Python a utilizar -pyenv install 3.11.11 +curl -LsSf https://astral.sh/uv/install.sh | sh +``` -## Fijamos la version de Python a utilizar -pyenv local 3.11.11 +Instalar Ansible: -## Creamos el entorno de Python con direnv +```bash +## Con direnv (recomendado): activar el entorno y luego instalar direnv allow +uv pip install -r requirements.txt -## Instalamos Ansible en el entorno de Python -pip3 install -r requirements.txt +## Sin direnv: instalar directamente en un venv +uv venv && uv pip install -r requirements.txt ``` Luego de instalar ansible, se deben instalar los requerimientos del playbook: