Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #6303/996fc8c1 backport][stable-6] pipx: fix state=latest w/ install_deps=true #6377

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Apr 20, 2023

This is a backport of PR #6303 as merged into main (996fc8c).

SUMMARY
  • Document the minimum version of pipx (0.16.2.1) that works with both pipx and pipx_info modules. I'm not changing the status quo; just documenting a preexisting limit since the pipx module was first introduced in f1807d3, where (as today) the module relies on "pipx list --json --include-injected". The same limitation applies to the pipx_info module since its introduction in 7ffe653
  • Fix a bug that prevents state=latest and install_deps=true from working, because the pipx upgrade command doesn't accept a --include-deps parameter, and hasn't since pipx 0.15. (It's safe to remove this since, per above, the module requires pipx 0.16.2.1).
ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
COMPONENT NAME

pipx

ADDITIONAL INFORMATION

The failure that occurs with install_deps=true and state=latest looks like this:

- community.general.pipx:
    state: latest
    name: tox
    install_deps: true
fatal: [testhost]: FAILED! => {"changed": false, "cmd": "/usr/bin/python3.10 -m pipx upgrade --include-deps tox", "msg": "usage: /usr/bin/python3.10 -m pipx [-h] [--version]\n                                   {install,uninject,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions}\n                                   ...\n/usr/bin/python3.10 -m pipx: error: unrecognized arguments: --include-deps", "rc": 2, "stderr": "usage: /usr/bin/python3.10 -m pipx [-h] [--version]\n                                   {install,uninject,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions}\n                                   ...\n/usr/bin/python3.10 -m pipx: error: unrecognized arguments: --include-deps\n", "stderr_lines": ["usage: /usr/bin/python3.10 -m pipx [-h] [--version]", "                                   {install,uninject,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,environment,completions}", "                                   ...", "/usr/bin/python3.10 -m pipx: error: unrecognized arguments: --include-deps"], "stdout": "", "stdout_lines": []}

* 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

(cherry picked from commit 996fc8c)
@ansibullbot
Copy link
Collaborator

cc @russoz
click here for bot help

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug integration tests/integration language module module new_contributor Help guide this first time contributor packaging plugins plugin (any type) tests tests labels Apr 20, 2023
@felixfontein felixfontein merged commit d393b16 into stable-6 Apr 20, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-6/996fc8c18e43dcadf32c06ef6179d8b1d0c3bae5/pr-6303 branch April 20, 2023 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug integration tests/integration language module module new_contributor Help guide this first time contributor packaging plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants