Debian Codegraph @

debian/patches/use-py3.patch

raw
1 From: Lee Garrett <[email protected]>
2 Date: Mon, 11 Nov 2024 09:17:12 +0000
3 Subject: use py3
4
5 Forwarded: not-needed
6 Last-Update: 2021-11-06
7
8 Use python 3 for all helper scripts during build
9
10 This allows us to not depend on python 2 anymore for building.
11 Last-Update: 2024-11-11
12 ---
13 .../targets/ansible-galaxy-collection/files/build_bad_tar.py | 2 +-
14 test/integration/targets/blocks/runme.sh | 8 ++++----
15 test/integration/targets/builtin_vars_prompt/test-vars_prompt.py | 2 +-
16 test/integration/targets/cli/test-cli.py | 2 +-
17 test/integration/targets/cli/test_k_and_K.py | 2 +-
18 test/integration/targets/gathering/uuid.fact | 2 +-
19 test/integration/targets/gathering_facts/uuid.fact | 2 +-
20 test/integration/targets/module_utils/module_utils/sub/bam.py | 2 +-
21 test/integration/targets/module_utils/module_utils/sub/bam/bam.py | 2 +-
22 test/integration/targets/pause/test-pause.py | 2 +-
23 test/integration/targets/pip/files/setup.py | 2 +-
24 test/integration/targets/plugin_config_for_inventory/runme.sh | 4 ++--
25 test/integration/targets/service/files/ansible_test_service.py | 2 +-
26 .../targets/service_facts/files/ansible_test_service.py | 2 +-
27 .../targets/template/role_filter/filter_plugins/myplugin.py | 2 +-
28 test/integration/targets/throttle/test_throttle.py | 2 +-
29 .../targets/var_precedence/ansible-var-precedence-check.py | 2 +-
30 17 files changed, 21 insertions(+), 21 deletions(-)
31
32 --- a/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
33 +++ b/test/integration/targets/ansible-galaxy-collection/files/build_bad_tar.py
34 @@ -1,4 +1,4 @@
35 -#!/usr/bin/env python
36 +#!/usr/bin/env python3
37
38 # Copyright: (c) 2020, Ansible Project
39 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
40 --- a/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
41 +++ b/test/integration/targets/builtin_vars_prompt/test-vars_prompt.py
42 @@ -1,4 +1,4 @@
43 -#!/usr/bin/env python
44 +#!/usr/bin/env python3
45
46 from __future__ import annotations
47
48 --- a/test/integration/targets/cli/test-cli.py
49 +++ b/test/integration/targets/cli/test-cli.py
50 @@ -1,4 +1,4 @@
51 -#!/usr/bin/env python
52 +#!/usr/bin/env python3
53 # Copyright (c) 2019 Matt Martz <[email protected]>
54 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
55
56 --- a/test/integration/targets/cli/test_k_and_K.py
57 +++ b/test/integration/targets/cli/test_k_and_K.py
58 @@ -1,4 +1,4 @@
59 -#!/usr/bin/env python
60 +#!/usr/bin/env python3
61 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
62
63 from __future__ import annotations
64 --- a/test/integration/targets/gathering/uuid.fact
65 +++ b/test/integration/targets/gathering/uuid.fact
66 @@ -1,4 +1,4 @@
67 -#!/usr/bin/env python
68 +#!/usr/bin/env python3
69 # -*- coding: utf-8 -*-
70
71
72 --- a/test/integration/targets/gathering_facts/uuid.fact
73 +++ b/test/integration/targets/gathering_facts/uuid.fact
74 @@ -1,4 +1,4 @@
75 -#!/usr/bin/env python
76 +#!/usr/bin/env python3
77 # -*- coding: utf-8 -*-
78
79
80 --- a/test/integration/targets/module_utils/module_utils/sub/bam.py
81 +++ b/test/integration/targets/module_utils/module_utils/sub/bam.py
82 @@ -1,3 +1,3 @@
83 -#!/usr/bin/env python
84 +#!/usr/bin/env python3
85
86 bam = "BAM FROM sub/bam.py"
87 --- a/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
88 +++ b/test/integration/targets/module_utils/module_utils/sub/bam/bam.py
89 @@ -1,3 +1,3 @@
90 -#!/usr/bin/env python
91 +#!/usr/bin/env python3
92
93 bam = "BAM FROM sub/bam/bam.py"
94 --- a/test/integration/targets/pause/test-pause.py
95 +++ b/test/integration/targets/pause/test-pause.py
96 @@ -1,4 +1,4 @@
97 -#!/usr/bin/env python
98 +#!/usr/bin/env python3
99
100 from __future__ import annotations
101
102 --- a/test/integration/targets/pip/files/setup.py
103 +++ b/test/integration/targets/pip/files/setup.py
104 @@ -1,4 +1,4 @@
105 -#!/usr/bin/env python
106 +#!/usr/bin/env python3
107
108 from __future__ import annotations
109
110 --- a/test/integration/targets/service/files/ansible_test_service.py
111 +++ b/test/integration/targets/service/files/ansible_test_service.py
112 @@ -1,4 +1,4 @@
113 -#!/usr/bin/env python
114 +#!/usr/bin/env python3
115
116 # this is mostly based off of the code found here:
117 # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
118 --- a/test/integration/targets/service_facts/files/ansible_test_service.py
119 +++ b/test/integration/targets/service_facts/files/ansible_test_service.py
120 @@ -1,4 +1,4 @@
121 -#!/usr/bin/env python
122 +#!/usr/bin/env python3
123
124 # this is mostly based off of the code found here:
125 # http://code.activestate.com/recipes/278731-creating-a-daemon-the-python-way/
126 --- a/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
127 +++ b/test/integration/targets/template/role_filter/filter_plugins/myplugin.py
128 @@ -1,4 +1,4 @@
129 -#!/usr/bin/env python
130 +#!/usr/bin/env python3
131
132 from __future__ import annotations
133
134 --- a/test/integration/targets/throttle/test_throttle.py
135 +++ b/test/integration/targets/throttle/test_throttle.py
136 @@ -1,4 +1,4 @@
137 -#!/usr/bin/env python
138 +#!/usr/bin/env python3
139
140 from __future__ import annotations
141
142 --- a/test/integration/targets/var_precedence/ansible-var-precedence-check.py
143 +++ b/test/integration/targets/var_precedence/ansible-var-precedence-check.py
144 @@ -1,4 +1,4 @@
145 -#!/usr/bin/env python
146 +#!/usr/bin/env python3
147
148 # A tool to check the order of precedence for ansible variables
149 # https://github.com/ansible/ansible/blob/devel/test/integration/test_var_precedence.yml
150 --- a/lib/ansible/cli/adhoc.py
151 +++ b/lib/ansible/cli/adhoc.py
152 @@ -1,4 +1,4 @@
153 -#!/usr/bin/env python
154 +#!/usr/bin/env python3
155 # Copyright: (c) 2012, Michael DeHaan <[email protected]>
156 # Copyright: (c) 2018, Ansible Project
157 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
158 --- a/lib/ansible/cli/config.py
159 +++ b/lib/ansible/cli/config.py
160 @@ -1,4 +1,4 @@
161 -#!/usr/bin/env python
162 +#!/usr/bin/env python3
163 # Copyright: (c) 2017, Ansible Project
164 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
165 # PYTHON_ARGCOMPLETE_OK
166 --- a/lib/ansible/cli/console.py
167 +++ b/lib/ansible/cli/console.py
168 @@ -1,4 +1,4 @@
169 -#!/usr/bin/env python
170 +#!/usr/bin/env python3
171 # Copyright: (c) 2014, Nandor Sivok <[email protected]>
172 # Copyright: (c) 2016, Redhat Inc
173 # Copyright: (c) 2018, Ansible Project
174 --- a/lib/ansible/cli/doc.py
175 +++ b/lib/ansible/cli/doc.py
176 @@ -1,4 +1,4 @@
177 -#!/usr/bin/env python
178 +#!/usr/bin/env python3
179 # Copyright: (c) 2014, James Tanner <[email protected]>
180 # Copyright: (c) 2018, Ansible Project
181 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
182 --- a/lib/ansible/cli/galaxy.py
183 +++ b/lib/ansible/cli/galaxy.py
184 @@ -1,4 +1,4 @@
185 -#!/usr/bin/env python
186 +#!/usr/bin/env python3
187 # Copyright: (c) 2013, James Cammarata <[email protected]>
188 # Copyright: (c) 2018-2021, Ansible Project
189 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
190 --- a/lib/ansible/cli/inventory.py
191 +++ b/lib/ansible/cli/inventory.py
192 @@ -1,4 +1,4 @@
193 -#!/usr/bin/env python
194 +#!/usr/bin/env python3
195 # Copyright: (c) 2017, Brian Coca <[email protected]>
196 # Copyright: (c) 2018, Ansible Project
197 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
198 --- a/lib/ansible/cli/playbook.py
199 +++ b/lib/ansible/cli/playbook.py
200 @@ -1,4 +1,4 @@
201 -#!/usr/bin/env python
202 +#!/usr/bin/env python3
203 # (c) 2012, Michael DeHaan <[email protected]>
204 # Copyright: (c) 2018, Ansible Project
205 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
206 --- a/lib/ansible/cli/pull.py
207 +++ b/lib/ansible/cli/pull.py
208 @@ -1,4 +1,4 @@
209 -#!/usr/bin/env python
210 +#!/usr/bin/env python3
211 # Copyright: (c) 2012, Michael DeHaan <[email protected]>
212 # Copyright: (c) 2018, Ansible Project
213 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
214 --- a/lib/ansible/cli/vault.py
215 +++ b/lib/ansible/cli/vault.py
216 @@ -1,4 +1,4 @@
217 -#!/usr/bin/env python
218 +#!/usr/bin/env python3
219 # (c) 2014, James Tanner <[email protected]>
220 # Copyright: (c) 2018, Ansible Project
221 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
222 --- a/lib/ansible/plugins/inventory/script.py
223 +++ b/lib/ansible/plugins/inventory/script.py
224 @@ -75,7 +75,7 @@
225
226 ### python example with ini config
227
228 - #!/usr/bin/env python
229 + #!/usr/bin/env python3
230 """
231 # ansible_inventory.py
232 """
233 --- a/packaging/cli-doc/build.py
234 +++ b/packaging/cli-doc/build.py
235 @@ -1,4 +1,4 @@
236 -#!/usr/bin/env python
237 +#!/usr/bin/env python3
238 # PYTHON_ARGCOMPLETE_OK
239 """Build documentation for ansible-core CLI programs."""
240
241 --- a/packaging/release.py
242 +++ b/packaging/release.py
243 @@ -1,4 +1,4 @@
244 -#!/usr/bin/env python
245 +#!/usr/bin/env python3
246 # PYTHON_ARGCOMPLETE_OK
247 """Manage upstream ansible-core releases."""
248
249 --- a/test/integration/targets/ansible-config/files/ini_dupes.py
250 +++ b/test/integration/targets/ansible-config/files/ini_dupes.py
251 @@ -1,4 +1,4 @@
252 -#!/usr/bin/env python
253 +#!/usr/bin/env python3
254 # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
255
256 from __future__ import annotations
257 --- a/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py
258 +++ b/test/integration/targets/ansible-galaxy-role/files/create-role-archive.py
259 @@ -1,4 +1,4 @@
260 -#!/usr/bin/env python
261 +#!/usr/bin/env python3
262 """Create a role archive which overwrites an arbitrary file."""
263 from __future__ import annotations
264
265 --- a/test/integration/targets/ansible-test-container/runme.py
266 +++ b/test/integration/targets/ansible-test-container/runme.py
267 @@ -1,4 +1,4 @@
268 -#!/usr/bin/env python
269 +#!/usr/bin/env python3
270 """Test suite used to verify ansible-test is able to run its containers on various container hosts."""
271
272 from __future__ import annotations
273 --- a/test/integration/targets/ansible-test-integration-targets/test.py
274 +++ b/test/integration/targets/ansible-test-integration-targets/test.py
275 @@ -1,4 +1,4 @@
276 -#!/usr/bin/env python
277 +#!/usr/bin/env python3
278 from __future__ import annotations
279
280 import subprocess
281 --- a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py
282 +++ b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/run-with-pty.py
283 @@ -1,4 +1,4 @@
284 -#!/usr/bin/env python
285 +#!/usr/bin/env python3
286 """Run a command using a PTY."""
287 from __future__ import annotations
288
289 --- a/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
290 +++ b/test/integration/targets/ansible-test-no-tty/ansible_collections/ns/col/tests/integration/targets/no-tty/assert-no-tty.py
291 @@ -1,4 +1,4 @@
292 -#!/usr/bin/env python
293 +#!/usr/bin/env python3
294 """Assert no TTY is available."""
295 from __future__ import annotations
296
297 --- a/test/integration/targets/ansible-test/venv-pythons.py
298 +++ b/test/integration/targets/ansible-test/venv-pythons.py
299 @@ -1,4 +1,4 @@
300 -#!/usr/bin/env python
301 +#!/usr/bin/env python3
302 """Return target Python options for use with ansible-test."""
303 from __future__ import annotations
304
305 --- a/test/integration/targets/ansible-vault/faux-editor.py
306 +++ b/test/integration/targets/ansible-vault/faux-editor.py
307 @@ -1,4 +1,4 @@
308 -#!/usr/bin/env python
309 +#!/usr/bin/env python3
310 #
311 # Ansible is free software: you can redistribute it and/or modify
312 # it under the terms of the GNU General Public License as published by
313 --- a/test/integration/targets/ansible-vault/password-script.py
314 +++ b/test/integration/targets/ansible-vault/password-script.py
315 @@ -1,4 +1,4 @@
316 -#!/usr/bin/env python
317 +#!/usr/bin/env python3
318 #
319 # Ansible is free software: you can redistribute it and/or modify
320 # it under the terms of the GNU General Public License as published by
321 --- a/test/integration/targets/ansible-vault/test-vault-client.py
322 +++ b/test/integration/targets/ansible-vault/test-vault-client.py
323 @@ -1,4 +1,4 @@
324 -#!/usr/bin/env python
325 +#!/usr/bin/env python3
326 # -*- coding: utf-8 -*-
327
328 from __future__ import annotations
329 --- a/test/integration/targets/binary_modules/build.py
330 +++ b/test/integration/targets/binary_modules/build.py
331 @@ -1,4 +1,4 @@
332 -#!/usr/bin/env python
333 +#!/usr/bin/env python3
334 """
335 Compile binary modules for this test for access from S3 at:
336 https://ci-files.testing.ansible.com/test/integration/roles/test_binary_modules/
337 --- a/test/integration/targets/collection/update-ignore.py
338 +++ b/test/integration/targets/collection/update-ignore.py
339 @@ -1,4 +1,4 @@
340 -#!/usr/bin/env python
341 +#!/usr/bin/env python3
342 """Rewrite a sanity ignore file to expand Python versions for import ignores and write the file out with the correct Ansible version in the name."""
343 from __future__ import annotations
344
345 --- a/test/integration/targets/debugger/test_run_once.py
346 +++ b/test/integration/targets/debugger/test_run_once.py
347 @@ -1,4 +1,4 @@
348 -#!/usr/bin/env python
349 +#!/usr/bin/env python3
350 from __future__ import annotations
351
352 import io
353 --- a/test/integration/targets/fork_safe_stdio/run-with-pty.py
354 +++ b/test/integration/targets/fork_safe_stdio/run-with-pty.py
355 @@ -1,4 +1,4 @@
356 -#!/usr/bin/env python
357 +#!/usr/bin/env python3
358 """Run a command using a PTY."""
359 from __future__ import annotations
360
361 --- a/test/integration/targets/packaging_cli-doc/verify.py
362 +++ b/test/integration/targets/packaging_cli-doc/verify.py
363 @@ -1,4 +1,4 @@
364 -#!/usr/bin/env python
365 +#!/usr/bin/env python3
366 from __future__ import annotations
367
368 import os
369 --- a/test/integration/targets/test_utils/scripts/timeout.py
370 +++ b/test/integration/targets/test_utils/scripts/timeout.py
371 @@ -1,4 +1,4 @@
372 -#!/usr/bin/env python
373 +#!/usr/bin/env python3
374 from __future__ import annotations
375
376 import argparse
377 --- a/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
378 +++ b/test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
379 @@ -1,4 +1,4 @@
380 -#!/usr/bin/env python
381 +#!/usr/bin/env python3
382 # PYTHON_ARGCOMPLETE_OK
383 """Command line entry point for ansible-test."""
384
385 --- a/test/integration/targets/blocks/runme.sh
386 +++ b/test/integration/targets/blocks/runme.sh
387 @@ -9,7 +9,7 @@
388 rm -f block_test.out
389 # run the test and check to make sure the right number of completions was logged
390 ansible-playbook -vv main.yml -i ../../inventory | tee block_test.out
391 -env python -c \
392 +env python3 -c \
393 'import sys, re; sys.stdout.write(re.sub(r"\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
394 <block_test.out >block_test_wo_colors.out
395 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
396 @@ -17,7 +17,7 @@
397 rm -f block_test.out block_test_wo_colors.out
398 # run test with free strategy and again count the completions
399 ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=free | tee block_test.out
400 -env python -c \
401 +env python3 -c \
402 'import sys, re; sys.stdout.write(re.sub(r"\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
403 <block_test.out >block_test_wo_colors.out
404 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
405 @@ -25,7 +25,7 @@
406 rm -f block_test.out block_test_wo_colors.out
407 # run test with host_pinned strategy and again count the completions
408 ansible-playbook -vv main.yml -i ../../inventory -e test_strategy=host_pinned | tee block_test.out
409 -env python -c \
410 +env python3 -c \
411 'import sys, re; sys.stdout.write(re.sub(r"\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
412 <block_test.out >block_test_wo_colors.out
413 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
414 @@ -33,7 +33,7 @@
415 # run test that includes tasks that fail inside a block with always
416 rm -f block_test.out block_test_wo_colors.out
417 ansible-playbook -vv block_fail.yml -i ../../inventory | tee block_test.out
418 -env python -c \
419 +env python3 -c \
420 'import sys, re; sys.stdout.write(re.sub(r"\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]", "", sys.stdin.read()))' \
421 <block_test.out >block_test_wo_colors.out
422 [ "$(grep -c 'TEST COMPLETE' block_test.out)" = "$(grep -E '^[0-9]+ plays in' block_test_wo_colors.out | cut -f1 -d' ')" ]
423 --- a/test/integration/targets/inventory_script/script_inventory_fixture.py
424 +++ b/test/integration/targets/inventory_script/script_inventory_fixture.py
425 @@ -1,4 +1,4 @@
426 -#!/usr/bin/env python
427 +#!/usr/bin/env python3
428
429 from __future__ import annotations
430
431 --- a/test/integration/targets/playbook_output_validator/filter.py
432 +++ b/test/integration/targets/playbook_output_validator/filter.py
433 @@ -1,4 +1,4 @@
434 -#!/usr/bin/env python
435 +#!/usr/bin/env python3
436
437 from __future__ import annotations
438