summaryrefslogtreecommitdiffstats
path: root/roles/python/tasks/main.yml
blob: 8a09c930243cbd37e5174873ee1db1c54701eaf0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
- name: "Check installed python versions"
  ansible.builtin.command:
    cmd: "mise ls python"
  register: python_installed_versions
  changed_when: false

- name: "Install python versions"
  ansible.builtin.command:
    cmd: "mise use --global python@{{ item }}"
  changed_when: true
  when: item not in python_installed_versions.stdout
  loop: "{{ python_versions }}"

- name: "Check installed uv version"
  ansible.builtin.command:
    cmd: "mise ls uv"
  register: python_uv_installed_version
  changed_when: false

- name: "Install uv {{ python_uv_version }}"
  ansible.builtin.command:
    cmd: "mise use --global uv@{{ python_uv_version }}"
  changed_when: true
  when: python_uv_version not in python_uv_installed_version.stdout