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

pipx: document parameters supported with state=latest, and fix include_injected parameter #6212

Merged
merged 6 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelogs/fragments/6212-pipx-include-injected.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
darkrain42 marked this conversation as resolved.
Show resolved Hide resolved
- pipx - Ensure ``include_injected`` parameter works with ``state=upgrade`` and ``state=latest`` (https://github.com/ansible-collections/community.general/pull/6212).
darkrain42 marked this conversation as resolved.
Show resolved Hide resolved
15 changes: 8 additions & 7 deletions plugins/modules/pipx.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
install_deps:
description:
- Include applications of dependent packages.
- Only used when I(state=install), I(state=upgrade), or I(state=inject).
- Only used when I(state=install), I(state=latest), I(state=upgrade), or I(state=inject).
type: bool
default: false
inject_packages:
Expand All @@ -69,24 +69,25 @@
force:
description:
- Force modification of the application's virtual environment. See C(pipx) for details.
- Only used when I(state=install), I(state=upgrade), I(state=upgrade_all), or I(state=inject).
- Only used when I(state=install), I(state=upgrade), I(state=upgrade_all), I(state=latest), or I(state=inject).
type: bool
default: false
include_injected:
description:
- Upgrade the injected packages along with the application.
- Only used when I(state=upgrade) or I(state=upgrade_all).
- Only used when I(state=upgrade), I(state=upgrade_all), or I(state=latest).
- I(state=upgrade) and I(state=latest) added in community.general 6.5.0.
darkrain42 marked this conversation as resolved.
Show resolved Hide resolved
type: bool
default: false
index_url:
description:
- Base URL of Python Package Index.
- Only used when I(state=install), I(state=upgrade), or I(state=inject).
- Only used when I(state=install), I(state=upgrade), I(state=latest), or I(state=inject).
type: str
python:
description:
- Python version to be used when creating the application virtual environment. Must be 3.6+.
- Only used when I(state=install), I(state=reinstall), or I(state=reinstall_all).
- Only used when I(state=install), I(state=latest), I(state=reinstall), or I(state=reinstall_all).
type: str
executable:
description:
Expand Down Expand Up @@ -254,7 +255,7 @@ def state_upgrade(self):
if self.vars.force:
self.changed = True

with self.runner('state index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx:
with self.runner('state include_injected index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx:
ctx.run()
self._capture_results(ctx)

Expand Down Expand Up @@ -307,7 +308,7 @@ def state_latest(self):
ctx.run(state='install', name_source=[self.vars.name, self.vars.source])
self._capture_results(ctx)

with self.runner('state index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx:
with self.runner('state include_injected index_url install_deps force editable pip_args name', check_mode_skip=True) as ctx:
ctx.run(state='upgrade')
self._capture_results(ctx)

Expand Down