pipx: fix state=latest w/ install_deps=true (#6303)

* pipx and pipx_info: Document that modules require pipx 0.16.2.1 or above

Since their introduction, these modules rely on 'pipx list --json' to
return machine-readable output about installed pipx applications. That
functionality was introduced in 0.16.2, along with a critical bug fix
(invalid json) in 0.16.2.1.

* pipx: fix state=latest with install_deps=true

"pipx upgrade" stopped supporting the "--include-deps" option
("install_deps" in the ansible module) in pipx 0.15
(https://pypa.github.io/pipx/changelog/#01500).

The lack of support causes the pipx module to fail if attempting to use
state=latest with install_deps, since the parameter is passed to both
pipx install (fine) and pipx upgrade (fails).

* Add changelog fragment
This commit is contained in:
Paul Aurich 2023-04-19 21:43:49 -07:00 committed by GitHub
parent ae5090d90e
commit 996fc8c18e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 3 deletions

View file

@ -184,6 +184,19 @@
name: tox
register: uninstall_tox_latest_again
- name: install application tox with deps
community.general.pipx:
state: latest
name: tox
install_deps: true
register: install_tox_with_deps
- name: cleanup tox latest yet again
community.general.pipx:
state: absent
name: tox
register: uninstall_tox_again
- name: check assertions tox latest
assert:
that:
@ -198,6 +211,10 @@
- install_tox_latest_with_preinstall_again_force is changed
- install_tox_latest_with_preinstall_again_force.application.tox.version == latest_tox_version
- uninstall_tox_latest_again is changed
- install_tox_with_deps is changed
- install_tox_with_deps.application.tox.version == latest_tox_version
- uninstall_tox_again is changed
- "'tox' not in uninstall_tox_again.application"
##############################################################################
- name: ensure application ansible-lint is uninstalled