Skip to content

Commit 23c6822

Browse files
author
Derek
committed
fix(gnome): remove distro pipx and install via pip system-wide
Instead of --break-system-packages, remove the outdated distro pipx package (apt on Ubuntu, dnf on Fedora) and install latest via pip to /usr/local. Cleaner approach that doesn't bypass PEP 668 protection.
1 parent 59cc731 commit 23c6822

1 file changed

Lines changed: 16 additions & 10 deletions

File tree

ansible/roles/dfe_developer/tasks/gnome_common.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,23 @@
5050

5151
# Distro-packaged pipx can be outdated (Ubuntu 24.04 has 1.4.3).
5252
# community.general.pipx requires >= 1.7.0 for application parameter.
53-
# Upgrade system-wide pip/pipx using --break-system-packages flag.
54-
- name: Upgrade pip system-wide to latest
55-
ansible.builtin.command:
56-
cmd: python3 -m pip install --upgrade --break-system-packages pip
57-
changed_when: false
58-
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
53+
# Remove distro pipx and install via pip to /usr/local (system-wide, latest version)
54+
- name: Remove distro-packaged pipx (outdated version) - Ubuntu
55+
ansible.builtin.apt:
56+
name: pipx
57+
state: absent
58+
when: ansible_facts['distribution'] == 'Ubuntu'
5959

60-
- name: Upgrade pipx system-wide to latest
61-
ansible.builtin.command:
62-
cmd: python3 -m pip install --upgrade --break-system-packages pipx
63-
changed_when: false
60+
- name: Remove distro-packaged pipx (outdated version) - Fedora
61+
ansible.builtin.dnf:
62+
name: pipx
63+
state: absent
64+
when: ansible_facts['distribution'] == 'Fedora'
65+
66+
- name: Install pipx via pip system-wide (latest version)
67+
ansible.builtin.pip:
68+
name: pipx
69+
state: latest
6470
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
6571

6672
- name: Install gnome-extensions-cli via pipx

0 commit comments

Comments
 (0)