diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-10-20 00:06:49 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-10-20 00:48:59 +0200 |
| commit | 806deb655dc2cce32ceffde65ebb7abe88937da1 (patch) | |
| tree | f7fc2ca0796f18d5f95fb3346feb7a931c8331e9 /roles/python | |
| parent | cf400c3e738f9660cc76e9fad82c4654acca2583 (diff) | |
Refactor python role to remove homebrew dependency
Diffstat (limited to 'roles/python')
| -rw-r--r-- | roles/python/meta/main.yml | 3 | ||||
| -rw-r--r-- | roles/python/tasks/main.yml | 17 |
2 files changed, 13 insertions, 7 deletions
diff --git a/roles/python/meta/main.yml b/roles/python/meta/main.yml index 4cbc7559..20f1f049 100644 --- a/roles/python/meta/main.yml +++ b/roles/python/meta/main.yml @@ -1,6 +1,7 @@ --- dependencies: - - role: "homebrew" + - role: "bash" + - role: "curl" galaxy_info: author: "a14m" description: "Install uv and python (versions) on Linux distributions" diff --git a/roles/python/tasks/main.yml b/roles/python/tasks/main.yml index b469c9d2..55f4e34a 100644 --- a/roles/python/tasks/main.yml +++ b/roles/python/tasks/main.yml @@ -2,10 +2,17 @@ - name: "Include OS-specific variables" ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" -- name: "Install uv" - community.general.homebrew: - name: "uv" - state: "present" +- name: "Download uv installer" + ansible.builtin.get_url: + url: "https://astral.sh/uv/install.sh" + dest: "/tmp/install_uv.sh" + mode: "0755" + +- name: "Run uv installer" + ansible.builtin.command: + cmd: "/tmp/install_uv.sh" + args: + creates: "{{ ansible_env.HOME }}/.local/bin/uv" - name: "Add uv to shell profile" ansible.builtin.blockinfile: @@ -24,7 +31,5 @@ cmd: "uv python install {{ item }}" args: creates: "{{ ansible_env.HOME }}/.local/share/uv/python/cpython-{{ item }}*/bin/python{{ item }}" - environment: - PATH: "/home/linuxbrew/.linuxbrew/bin:{{ ansible_env.PATH }}" loop: "{{ python_versions }}" when: python_versions | length > 0 |
