mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-30 00:21:23 -07:00
pipx: accept python version specs in parameter `name` (#10031)
* pipx: accept python version specs in parameter "name"
* pipx_info: adjustment for backward compatibility
* remove unnecessary comprehension
* remove f-str
* no shebang for module utils
* remove f-str
* fix syntax error
* fix pipx_info
* rollback adjustments in existing tests
* docs & test update
* add debugging tasks to int test
* integration test checks for version of packaging
* move assertion to block
* fix idempotency when using version specifier
* add changelog frag
* fix docs
* dial down the version of tox used in tests
To accommodate old Pythons
* Update plugins/modules/pipx.py
* Apply suggestions from code review
* refactor/rename package requirements code
* fix filename in BOTMETA
* Update plugins/modules/pipx.py
* Update plugins/modules/pipx.py
* pipx mod utils: create make_process_dict and deprecate make_process_list
* pkg_req: make method private
* make_process_dict is simpler and more specialized
* ensure version specifiers are honored when state=install
* fix insanity
* pipx: reformat yaml blocks
* pipx: doc wordsmithing
---------
(cherry picked from commit 2b4cb6dabc
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
83 lines
2.6 KiB
YAML
83 lines
2.6 KiB
YAML
---
|
|
# Copyright (c) Ansible Project
|
|
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
##############################################################################
|
|
# Test version specifiers in name parameter
|
|
|
|
- name: Ensure tox is uninstalled
|
|
community.general.pipx:
|
|
state: absent
|
|
name: tox
|
|
register: uninstall_tox
|
|
|
|
- name: Install tox with version specifier in name
|
|
community.general.pipx:
|
|
name: tox>=3.22.0,<3.27.0
|
|
register: install_tox_version
|
|
|
|
- name: Install tox with same version specifier (idempotency check)
|
|
community.general.pipx:
|
|
name: tox>=3.22.0,<3.27.0
|
|
register: install_tox_version_again
|
|
|
|
- name: Ensure tox is uninstalled again
|
|
community.general.pipx:
|
|
state: absent
|
|
name: tox
|
|
|
|
- name: Install tox with extras and version
|
|
community.general.pipx:
|
|
name: "tox[testing]>=3.22.0,<3.27.0"
|
|
register: install_tox_extras
|
|
ignore_errors: true # Some versions might not have this extra
|
|
|
|
- name: Install tox with higher version specifier
|
|
community.general.pipx:
|
|
name: "tox>=3.27.0"
|
|
register: install_tox_higher_version
|
|
|
|
- name: Install tox with higher version specifier (force)
|
|
community.general.pipx:
|
|
name: "tox>=3.27.0"
|
|
force: true
|
|
register: install_tox_higher_version_force
|
|
|
|
- name: Cleanup tox
|
|
community.general.pipx:
|
|
state: absent
|
|
name: tox
|
|
register: uninstall_tox_final
|
|
|
|
- name: Check version specifier assertions
|
|
assert:
|
|
that:
|
|
- install_tox_version is changed
|
|
- "'tox' in install_tox_version.application"
|
|
- "install_tox_version.application.tox.version is version('3.22.0', '>=')"
|
|
- "install_tox_version.application.tox.version is version('3.27.0', '<')"
|
|
- install_tox_version_again is not changed
|
|
- "'tox' in install_tox_extras.application"
|
|
- "install_tox_extras.application.tox.version is version('3.22.0', '>=')"
|
|
- "install_tox_extras.application.tox.version is version('3.27.0', '<')"
|
|
- install_tox_higher_version is changed
|
|
- install_tox_higher_version_force is changed
|
|
- uninstall_tox_final is changed
|
|
- "'tox' not in uninstall_tox_final.application"
|
|
|
|
- name: If packaging is recent
|
|
when:
|
|
- has_packaging22
|
|
block:
|
|
- name: Install tox with invalid version specifier
|
|
community.general.pipx:
|
|
name: "tox>>>>>3.27.0"
|
|
register: install_tox_invalid
|
|
ignore_errors: true
|
|
|
|
- name: Check version specifier assertions
|
|
assert:
|
|
that:
|
|
- install_tox_invalid is failed
|
|
- "'Invalid package specification' in install_tox_invalid.msg"
|