Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pipx/tasks/main.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 - name: Bail out if Python < 3.8
7 when: ansible_facts.python_version is version('3.8', '<')
8 ansible.builtin.meta: end_play
9 - name: Install pipx>=1.7.0
10 ansible.builtin.pip:
11 name: pipx>=1.7.0
12 extra_args: --user
13
14 - name: Determine packaging level
15 block:
16 - name: Install packaging>=22.0
17 ansible.builtin.pip:
18 name: packaging>=22.0
19 - name: Set has_packaging22 fact true
20 ansible.builtin.set_fact:
21 has_packaging22: true
22 rescue:
23 - name: Set has_packaging22 fact false
24 ansible.builtin.set_fact:
25 has_packaging22: false
26 - name: Install has_packaging (no version spec)
27 ansible.builtin.pip:
28 name: packaging
29
30 ##############################################################################
31 - name: ensure application tox is uninstalled
32 community.general.pipx:
33 state: absent
34 name: tox
35 register: uninstall_tox
36
37 - name: install application tox
38 community.general.pipx:
39 name: tox
40 register: install_tox
41
42 - name: set fact latest_tox_version
43 set_fact:
44 latest_tox_version: "{{ install_tox.application.tox.version }}"
45
46 - name: install application tox again
47 community.general.pipx:
48 name: tox
49 register: install_tox_again
50
51 - name: install application tox again force
52 community.general.pipx:
53 name: tox
54 force: true
55 register: install_tox_again_force
56
57 - name: uninstall application tox
58 community.general.pipx:
59 state: absent
60 name: tox
61 register: uninstall_tox
62
63 - name: check assertions tox
64 assert:
65 that:
66 - install_tox is changed
67 - "'version' in install_tox"
68 - "'tox' in install_tox.application"
69 - install_tox_again is not changed
70 - install_tox_again_force is changed
71 - uninstall_tox is changed
72 - "'tox' not in uninstall_tox.application"
73
74 ##############################################################################
75 - name: install application tox with system-site-packages
76 community.general.pipx:
77 name: tox
78 system_site_packages: true
79 register: install_tox
80
81 - name: get raw pipx_info
82 community.general.pipx_info:
83 include_raw: true
84 register: pipx_info_raw
85
86 - name: uninstall application tox
87 community.general.pipx:
88 state: absent
89 name: tox
90 register: uninstall_tox
91
92 - name: check assertions tox
93 assert:
94 that:
95 - install_tox is changed
96 - "'tox' in install_tox.application"
97 - pipx_info_raw is not changed
98 - "'--system-site-packages' in pipx_info_raw.raw_output.venvs.tox.metadata.venv_args"
99 - uninstall_tox is changed
100 - "'tox' not in uninstall_tox.application"
101
102 ##############################################################################
103 - name: install application tox 3.24.0
104 community.general.pipx:
105 name: tox
106 source: tox==3.24.0
107 register: install_tox_324
108
109 - name: reinstall tox 3.24.0
110 community.general.pipx:
111 name: tox
112 state: reinstall
113 register: reinstall_tox_324
114
115 - name: upgrade tox from 3.24.0
116 community.general.pipx:
117 name: tox
118 state: upgrade
119 register: upgrade_tox_324
120
121 - name: downgrade tox 3.24.0
122 community.general.pipx:
123 name: tox
124 source: tox==3.24.0
125 force: true
126 register: downgrade_tox_324
127
128 - name: cleanup tox 3.24.0
129 community.general.pipx:
130 state: absent
131 name: tox
132 register: uninstall_tox_324
133
134 - name: check assertions tox 3.24.0
135 assert:
136 that:
137 - install_tox_324 is changed
138 - "'tox' in install_tox_324.application"
139 - install_tox_324.application.tox.version == '3.24.0'
140 - reinstall_tox_324 is changed
141 - reinstall_tox_324.application.tox.version == '3.24.0'
142 - upgrade_tox_324 is changed
143 - upgrade_tox_324.application.tox.version != '3.24.0'
144 - downgrade_tox_324 is changed
145 - downgrade_tox_324.application.tox.version == '3.24.0'
146 - uninstall_tox_324 is changed
147 - "'tox' not in uninstall_tox_324.application"
148
149 ##############################################################################
150 - name: install application latest tox
151 community.general.pipx:
152 name: tox
153 state: latest
154 register: install_tox_latest
155
156 - name: cleanup tox latest
157 community.general.pipx:
158 state: absent
159 name: tox
160 register: uninstall_tox_1
161
162 - name: install application tox 3.24.0 for latest
163 community.general.pipx:
164 name: tox
165 source: tox==3.24.0
166 register: install_tox_324_for_latest
167
168 - name: install application latest tox
169 community.general.pipx:
170 name: tox
171 state: latest
172 register: install_tox_latest_with_preinstall
173
174 - name: install application latest tox again
175 community.general.pipx:
176 name: tox
177 state: latest
178 register: install_tox_latest_with_preinstall_again
179
180 - name: install application latest tox (force)
181 community.general.pipx:
182 name: tox
183 state: latest
184 force: true
185 register: install_tox_latest_with_preinstall_again_force
186
187 - name: cleanup tox latest again
188 community.general.pipx:
189 state: absent
190 name: tox
191 register: uninstall_tox_latest_again
192
193 - name: install application tox with deps
194 community.general.pipx:
195 state: latest
196 name: tox
197 install_deps: true
198 register: install_tox_with_deps
199
200 - name: cleanup tox latest yet again
201 community.general.pipx:
202 state: absent
203 name: tox
204 register: uninstall_tox_2
205
206 - name: install tox with extra 'docs'
207 community.general.pipx:
208 name: tox
209 source: tox[docs]
210 state: latest
211 register: install_tox_latest_docs
212
213 - name: install tox with extra 'docs' again
214 community.general.pipx:
215 name: tox
216 source: tox[docs]
217 state: latest
218 register: install_tox_latest_docs_again
219
220 - name: cleanup tox latest yet again
221 community.general.pipx:
222 state: absent
223 name: tox
224 register: uninstall_tox_3
225
226 - name: check assertions tox latest
227 assert:
228 that:
229 - install_tox_latest is changed
230 - "'tox' in install_tox_latest.application"
231 - install_tox_latest.application.tox.version != '3.24.0'
232 - uninstall_tox_1 is changed
233 - "'tox' not in uninstall_tox_1.application"
234 - install_tox_324_for_latest is changed
235 - "'tox' in install_tox_324_for_latest.application"
236 - install_tox_324_for_latest.application.tox.version == '3.24.0'
237 - install_tox_latest_with_preinstall is changed
238 - "'tox' in install_tox_latest_with_preinstall.application"
239 - install_tox_latest_with_preinstall.application.tox.version != '3.24.0'
240 - install_tox_latest_with_preinstall_again is not changed
241 - install_tox_latest_with_preinstall_again_force is changed
242 - uninstall_tox_2 is changed
243 - "'tox' not in uninstall_tox_2.application"
244 - install_tox_latest_docs is changed
245 - install_tox_latest_docs_again is not changed
246 - uninstall_tox_3 is changed
247 - "'tox' not in uninstall_tox_3.application"
248
249 ##############################################################################
250 # Test version specifiers in name parameter
251 - name: Run version specifier tests
252 ansible.builtin.include_tasks: testcase-10031-version-specs.yml
253
254 ##############################################################################
255
256 - name: Include testcase for inject packages
257 ansible.builtin.include_tasks: testcase-injectpkg.yml
258
259 - name: Include testcase for jupyter
260 ansible.builtin.include_tasks: testcase-jupyter.yml
261
262 - name: Include testcase for old site-wide
263 ansible.builtin.include_tasks: testcase-oldsitewide.yml
264
265 - name: Include testcase for issue 7497
266 ansible.builtin.include_tasks: testcase-7497.yml
267
268 - name: Include testcase for issue 8656
269 ansible.builtin.include_tasks: testcase-8656.yml
270
271 - name: Include testcase for PR 8793 --global
272 ansible.builtin.include_tasks: testcase-8793-global.yml
273
274 - name: Include testcase for PR 8809 install-all
275 ansible.builtin.include_tasks: testcase-8809-installall.yml
276
277 - name: Include testcase for PR 8809 pin
278 ansible.builtin.include_tasks: testcase-8809-pin.yml
279
280 - name: Include testcase for PR 8809 injectpkg
281 ansible.builtin.include_tasks: testcase-8809-uninjectpkg.yml
282
283 - name: Include testcase for PR 9009 injectpkg --global
284 ansible.builtin.include_tasks: testcase-9009-fixglobal.yml
285
286 - name: Include testcase for PR 9103 upgrade --global
287 ansible.builtin.include_tasks: testcase-9103-upgrade-global.yml
288
289 - name: Include testcase for issue 9619 latest --global
290 ansible.builtin.include_tasks: testcase-9619-latest-global.yml