pipx: use global in state=latest (#9623)

* pipx: use global in state=latest

* add changelog frag
This commit is contained in:
Alexei Znamensky 2025-01-27 17:24:38 +13:00 committed by GitHub
parent 96f465ddf8
commit 03dfed4c35
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 2 deletions

View file

@ -267,3 +267,6 @@
- name: Include testcase for PR 9103 upgrade --global
ansible.builtin.include_tasks: testcase-9103-upgrade-global.yml
- name: Include testcase for issue 9619 latest --global
ansible.builtin.include_tasks: testcase-9619-latest-global.yml

View file

@ -0,0 +1,38 @@
---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: 9619-Ensure application hello-world is uninstalled
community.general.pipx:
name: hello-world
state: absent
global: true
- name: 9619-Install application hello-world
community.general.pipx:
name: hello-world
source: hello-world==0.1
global: true
register: install_hw
- name: 9619-Upgrade application hello-world
community.general.pipx:
state: latest
name: hello-world
global: true
register: latest_hw
- name: 9619-Ensure application pylint is uninstalled
community.general.pipx:
name: pylint
state: absent
global: true
- name: 9619-Assertions
ansible.builtin.assert:
that:
- install_hw is changed
- latest_hw is changed
- latest_hw.cmd[-3] == "upgrade"
- latest_hw.cmd[-2] == "--global"