mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
[PR #8793/9c9c4cbc backport][stable-9] pipx/pipx_info: add parameter global
(#8807)
pipx/pipx_info: add parameter `global` (#8793)
* pipx/pipx_info: add new parameters
* add test for --global, refactor int test main file
* ensure initial state of test
* ensure PATH includes /usr/local/bin
* ensure PATH includes /usr/local/bin for entire block
* ensure minimum version of pip
* ensure pipx 1.6.0 is installed
* push recommendation for pipx 1.7.0 instead of 1.6.0
* add changelog frag
* add deprecatons to changelog frag
* add deprecatons to changelog frag, better
* Update changelogs/fragments/8793-pipx-global.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* Update changelogs/fragments/8793-pipx-global.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
---------
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 9c9c4cbc3e
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
c58181bdc9
commit
b935dcedd8
11 changed files with 355 additions and 207 deletions
|
@ -24,26 +24,29 @@ _state_map = dict(
|
|||
|
||||
|
||||
def pipx_runner(module, command, **kwargs):
|
||||
arg_formats = dict(
|
||||
state=fmt.as_map(_state_map),
|
||||
name=fmt.as_list(),
|
||||
name_source=fmt.as_func(fmt.unpack_args(lambda n, s: [s] if s else [n])),
|
||||
install_apps=fmt.as_bool("--include-apps"),
|
||||
install_deps=fmt.as_bool("--include-deps"),
|
||||
inject_packages=fmt.as_list(),
|
||||
force=fmt.as_bool("--force"),
|
||||
include_injected=fmt.as_bool("--include-injected"),
|
||||
index_url=fmt.as_opt_val('--index-url'),
|
||||
python=fmt.as_opt_val('--python'),
|
||||
system_site_packages=fmt.as_bool("--system-site-packages"),
|
||||
_list=fmt.as_fixed(['list', '--include-injected', '--json']),
|
||||
editable=fmt.as_bool("--editable"),
|
||||
pip_args=fmt.as_opt_eq_val('--pip-args'),
|
||||
suffix=fmt.as_opt_val('--suffix'),
|
||||
)
|
||||
arg_formats["global"] = fmt.as_bool("--global")
|
||||
|
||||
runner = CmdRunner(
|
||||
module,
|
||||
command=command,
|
||||
arg_formats=dict(
|
||||
state=fmt.as_map(_state_map),
|
||||
name=fmt.as_list(),
|
||||
name_source=fmt.as_func(fmt.unpack_args(lambda n, s: [s] if s else [n])),
|
||||
install_apps=fmt.as_bool("--include-apps"),
|
||||
install_deps=fmt.as_bool("--include-deps"),
|
||||
inject_packages=fmt.as_list(),
|
||||
force=fmt.as_bool("--force"),
|
||||
include_injected=fmt.as_bool("--include-injected"),
|
||||
index_url=fmt.as_opt_val('--index-url'),
|
||||
python=fmt.as_opt_val('--python'),
|
||||
system_site_packages=fmt.as_bool("--system-site-packages"),
|
||||
_list=fmt.as_fixed(['list', '--include-injected', '--json']),
|
||||
editable=fmt.as_bool("--editable"),
|
||||
pip_args=fmt.as_opt_eq_val('--pip-args'),
|
||||
suffix=fmt.as_opt_val('--suffix'),
|
||||
),
|
||||
arg_formats=arg_formats,
|
||||
environ_update={'USE_EMOJI': '0'},
|
||||
check_rc=True,
|
||||
**kwargs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue