-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
pipx: fix state=latest w/ install_deps=true #6303
pipx: fix state=latest w/ install_deps=true #6303
Conversation
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 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).
Docs Build 📝Thank you for contribution!✨ The docsite for this PR is available for download as an artifact from this run: File changes:
Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_info_module.html b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_info_module.html
index 824f575..cc359db 100644
--- a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_info_module.html
+++ b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_info_module.html
@@ -264,6 +264,7 @@
<li><p>This module does not install the <code class="docutils literal notranslate"><span class="pre">pipx</span></code> python package, however that can be easily done with the module <a class="reference external" href="https://docs.ansible.com/ansible/devel/collections/ansible/builtin/pip_module.html#ansible-collections-ansible-builtin-pip-module" title="(in Ansible vdevel)"><span class="xref std std-ref">ansible.builtin.pip</span></a>.</p></li>
<li><p>This module does not require <code class="docutils literal notranslate"><span class="pre">pipx</span></code> to be in the shell <code class="docutils literal notranslate"><span class="pre">PATH</span></code>, but it must be loadable by Python as a module.</p></li>
<li><p>This module will honor <code class="docutils literal notranslate"><span class="pre">pipx</span></code> environment variables such as but not limited to <code class="docutils literal notranslate"><span class="pre">PIPX_HOME</span></code> and <code class="docutils literal notranslate"><span class="pre">PIPX_BIN_DIR</span></code> passed using the <a class="reference external" href="https://docs.ansible.com/ansible/devel/playbook_guide/playbooks_environment.html#playbooks-environment" title="(in Ansible vdevel)"><span class="xref std std-ref">environment Ansible keyword</span></a>.</p></li>
+<li><p>This module requires <code class="docutils literal notranslate"><span class="pre">pipx</span></code> version 0.16.2.1 or above.</p></li>
<li><p>Please note that <code class="docutils literal notranslate"><span class="pre">pipx</span></code> requires Python 3.6 or above.</p></li>
<li><p>See also the <code class="docutils literal notranslate"><span class="pre">pipx</span></code> documentation at <a class="reference external" href="https://pypa.github.io/pipx/">https://pypa.github.io/pipx/</a>.</p></li>
</ul>
diff --git a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_module.html b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_module.html
index 27f06b7..a8ebb6f 100644
--- a/home/runner/work/community.general/community.general/docsbuild/base/collections/community/general/pipx_module.html
+++ b/home/runner/work/community.general/community.general/docsbuild/head/collections/community/general/pipx_module.html
@@ -252,7 +252,7 @@
<a class="ansibleOptionLink" href="#parameter-install_deps" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Include applications of dependent packages.</p>
-<p>Only used when <em>state=install</em>, <em>state=latest</em>, <em>state=upgrade</em>, or <em>state=inject</em>.</p>
+<p>Only used when <em>state=install</em>, <em>state=latest</em>, or <em>state=inject</em>.</p>
<p class="ansible-option-line"><span class="ansible-option-choices">Choices:</span></p>
<ul class="simple">
<li><p><code class="ansible-option-default-bold docutils literal notranslate"><span class="pre">false</span></code> <span class="ansible-option-choices-default-mark">← (default)</span></p></li>
@@ -354,6 +354,7 @@
<li><p>This module does not install the <code class="docutils literal notranslate"><span class="pre">pipx</span></code> python package, however that can be easily done with the module <a class="reference external" href="https://docs.ansible.com/ansible/devel/collections/ansible/builtin/pip_module.html#ansible-collections-ansible-builtin-pip-module" title="(in Ansible vdevel)"><span class="xref std std-ref">ansible.builtin.pip</span></a>.</p></li>
<li><p>This module does not require <code class="docutils literal notranslate"><span class="pre">pipx</span></code> to be in the shell <code class="docutils literal notranslate"><span class="pre">PATH</span></code>, but it must be loadable by Python as a module.</p></li>
<li><p>This module will honor <code class="docutils literal notranslate"><span class="pre">pipx</span></code> environment variables such as but not limited to <code class="docutils literal notranslate"><span class="pre">PIPX_HOME</span></code> and <code class="docutils literal notranslate"><span class="pre">PIPX_BIN_DIR</span></code> passed using the <a class="reference external" href="https://docs.ansible.com/ansible/devel/playbook_guide/playbooks_environment.html#playbooks-environment" title="(in Ansible vdevel)"><span class="xref std std-ref">environment Ansible keyword</span></a>.</p></li>
+<li><p>This module requires <code class="docutils literal notranslate"><span class="pre">pipx</span></code> version 0.16.2.1 or above.</p></li>
<li><p>Please note that <code class="docutils literal notranslate"><span class="pre">pipx</span></code> requires Python 3.6 or above.</p></li>
<li><p>This first implementation does not verify whether a specified version constraint has been installed or not. Hence, when using version operators, <code class="docutils literal notranslate"><span class="pre">pipx</span></code> module will always try to execute the operation, even when the application was previously installed. This feature will be added in the future.</p></li>
<li><p>See also the <code class="docutils literal notranslate"><span class="pre">pipx</span></code> documentation at <a class="reference external" href="https://pypa.github.io/pipx/">https://pypa.github.io/pipx/</a>.</p></li>
|
Hi @darkrain42 Thanks for your contribution! :-) Please submit the bug fix in a PR of its own, so it can be backported to previous versions. The rest of the PR looks good on a first glance but I shall review it more thoroughly in the next couple of days. |
3fc1983
to
be9465d
Compare
Created #6308 for the |
@russoz any more comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nop, it LGTM
Backport to stable-5: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 996fc8c on top of patchback/backports/stable-5/996fc8c18e43dcadf32c06ef6179d8b1d0c3bae5/pr-6303 Backporting merged PR #6303 into main
🤖 @patchback |
Backport to stable-6: 💚 backport PR created✅ Backport PR branch: Backported as #6377 🤖 @patchback |
@darkrain42 thanks for your contribution! |
* 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)
…all_deps=true (#6377) 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 (cherry picked from commit 996fc8c) Co-authored-by: Paul Aurich <[email protected]>
SUMMARY
state=latest
andinstall_deps=true
from working, because thepipx 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
COMPONENT NAME
pipx
ADDITIONAL INFORMATION
The failure that occurs with
install_deps=true
andstate=latest
looks like this: