Skip to content

Commit 5e8d691

Browse files
author
Derek
committed
refactor: replace pipx with UV tool for gnome-extensions-cli
Replace system pip/pipx upgrades with UV tool install: - Remove python3-pip and pipx from APT/DNF prerequisites - Remove pip/pipx system-wide upgrade tasks - Install gnome-extensions-cli via `uv tool install` - Update ui-mode script error message to mention UV Benefits: - No system package modification (respects PEP 668) - UV manages its own Python environment - Simpler, cleaner installation path - Tool venv at ~/.local/share/uv/tools/gnome-extensions-cli/ Requires UV to be installed first (done in base_tools.yml).
1 parent 8889fee commit 5e8d691

2 files changed

Lines changed: 13 additions & 51 deletions

File tree

ansible/roles/dfe_developer/files/ui-mode

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ check_gext_installed() {
266266
print_error "gnome-extensions-cli (gext) is not installed"
267267
print_error ""
268268
print_error "Install it with:"
269-
print_error " pipx install gnome-extensions-cli"
269+
print_error " uv tool install gnome-extensions-cli"
270270
print_error ""
271271
print_error "Or run the full DFE developer setup which includes it."
272272
exit 1

ansible/roles/dfe_developer/tasks/gnome_common.yml

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727
- gnome-shell-extensions # Base extension infrastructure
2828
- gnome-shell-extension-manager # GUI for managing extensions
2929
- gir1.2-gmenu-3.0 # Required by ArcMenu and Logo Menu
30-
- python3-pip # For pipx
31-
- pipx # Isolated Python apps
3230
state: present
3331
when: ansible_facts['distribution'] == 'Ubuntu'
3432

@@ -37,61 +35,25 @@
3735
name:
3836
- gnome-shell-extension-common # Base extension infrastructure
3937
- gnome-extensions-app # GUI for managing extensions
40-
- pipx # Isolated Python apps
4138
state: present
4239
when: ansible_facts['distribution'] == 'Fedora'
4340

44-
- name: Ensure pipx path is configured
41+
# Install gnome-extensions-cli via UV tool (not pipx)
42+
# UV manages its own Python environment - no system packages modified
43+
# Tool venv: ~/.local/share/uv/tools/gnome-extensions-cli/
44+
# Binary symlink: ~/.local/bin/gext
45+
- name: Install gnome-extensions-cli via uv tool
4546
ansible.builtin.command:
46-
cmd: pipx ensurepath
47-
become: false
48-
changed_when: false
49-
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
50-
51-
# Distro-packaged pipx can be outdated (Ubuntu 24.04 has 1.4.3).
52-
# community.general.pipx requires >= 1.7.0 for application parameter.
53-
# Upgrade pip and pipx system-wide - installs alongside distro versions.
54-
# --break-system-packages required on Ubuntu 24.04+ (PEP 668 protection).
55-
# --ignore-installed avoids "Cannot uninstall pip, RECORD file not found" error.
56-
- name: Upgrade pip to latest (system-wide)
57-
ansible.builtin.command:
58-
cmd: python3 -m pip install --upgrade --break-system-packages --ignore-installed pip
59-
become: true
60-
when: ansible_facts['distribution'] == 'Ubuntu'
61-
changed_when: true
62-
63-
- name: Upgrade pip to latest (Fedora)
64-
ansible.builtin.pip:
65-
name: pip
66-
state: latest
67-
become: true
68-
when: ansible_facts['distribution'] == 'Fedora'
69-
70-
- name: Upgrade pipx to latest (system-wide)
71-
ansible.builtin.command:
72-
cmd: python3 -m pip install --upgrade --break-system-packages --ignore-installed pipx
73-
become: true
74-
when: ansible_facts['distribution'] == 'Ubuntu'
75-
changed_when: true
76-
77-
- name: Upgrade pipx to latest (Fedora)
78-
ansible.builtin.pip:
79-
name: pipx
80-
state: latest
47+
cmd: uv tool install gnome-extensions-cli
8148
become: true
82-
when: ansible_facts['distribution'] == 'Fedora'
83-
84-
- name: Install gnome-extensions-cli via pipx
85-
community.general.pipx:
86-
name: gnome-extensions-cli
87-
state: present
88-
install_deps: true
89-
become: false
9049
become_user: "{{ dfe_actual_user }}"
9150
environment:
92-
PIPX_HOME: "{{ dfe_user_home }}/.local/pipx"
93-
PIPX_BIN_DIR: "{{ dfe_user_home }}/.local/bin"
94-
PATH: "{{ dfe_user_home }}/.local/bin:{{ ansible_env.PATH }}"
51+
PATH: "/usr/local/bin:{{ dfe_user_home }}/.local/bin:{{ ansible_env.PATH }}"
52+
register: gext_install
53+
changed_when: "'Installed' in gext_install.stdout"
54+
failed_when:
55+
- gext_install.rc != 0
56+
- "'already installed' not in gext_install.stderr"
9557
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
9658

9759
# ============================================================================

0 commit comments

Comments
 (0)