From fea1aa7b7c824775ffabd8d4903edcc79784db61 Mon Sep 17 00:00:00 2001 From: Ivan Golikov Date: Thu, 16 Jan 2025 18:05:34 +0100 Subject: [PATCH] uv packages installation improvement --- .local/share/dotfiles/install_dev_tools.yml | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/.local/share/dotfiles/install_dev_tools.yml b/.local/share/dotfiles/install_dev_tools.yml index b012656..a204a51 100644 --- a/.local/share/dotfiles/install_dev_tools.yml +++ b/.local/share/dotfiles/install_dev_tools.yml @@ -25,14 +25,20 @@ apt_packages: - fd-find + uv_tools_default_python: '3.12' + uv_packages: - - aider-chat - - asciinema - - poetry - - basedpyright - - pre-commit - - posting - - ipython + # python 3.12 is used by default + # if package requires another version, specify item + # - name: numpy + # python: 3.8 + - name: aider-chat + - name: asciinema + - name: poetry + - name: basedpyright + - name: pre-commit + - name: posting + - name: ipython macos_fish_path: /usr/local/bin/fish arch_fish_path: /usr/bin/fish @@ -113,7 +119,9 @@ state: absent - name: Install uv packages - ansible.builtin.command: "uv tool install {{ item }}" + ansible.builtin.command: "uv tool install --python {{ item.python | default(uv_tools_default_python) }} {{ item.name }}" + register: uv_install_result + changed_when: "'is already installed' not in uv_install_result.stderr" loop: "{{ uv_packages }}" tags: - dev_tools