Skip to content

Commit d55df8b

Browse files
committed
WIP
1 parent 2f301ef commit d55df8b

File tree

5 files changed

+86
-75
lines changed

5 files changed

+86
-75
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -24,57 +24,6 @@ jobs:
2424
fail-fast: false
2525
matrix:
2626
include:
27-
- name: Ans_27_210
28-
tox_env: py27-mode_ansible-ansible2.10
29-
- name: Ans_27_4
30-
tox_env: py27-mode_ansible-ansible4
31-
32-
- name: Ans_36_210
33-
python_version: '3.6'
34-
tox_env: py36-mode_ansible-ansible2.10
35-
- name: Ans_36_4
36-
python_version: '3.6'
37-
tox_env: py36-mode_ansible-ansible4
38-
39-
- name: Ans_311_210
40-
python_version: '3.11'
41-
tox_env: py311-mode_ansible-ansible2.10
42-
- name: Ans_311_3
43-
python_version: '3.11'
44-
tox_env: py311-mode_ansible-ansible3
45-
- name: Ans_311_4
46-
python_version: '3.11'
47-
tox_env: py311-mode_ansible-ansible4
48-
- name: Ans_311_5
49-
python_version: '3.11'
50-
tox_env: py311-mode_ansible-ansible5
51-
- name: Ans_313_6
52-
python_version: '3.13'
53-
tox_env: py313-mode_ansible-ansible6
54-
- name: Ans_313_7
55-
python_version: '3.13'
56-
tox_env: py313-mode_ansible-ansible7
57-
- name: Ans_313_8
58-
python_version: '3.13'
59-
tox_env: py313-mode_ansible-ansible8
60-
- name: Ans_313_9
61-
python_version: '3.13'
62-
tox_env: py313-mode_ansible-ansible9
63-
- name: Ans_313_10
64-
python_version: '3.13'
65-
tox_env: py313-mode_ansible-ansible10
66-
- name: Ans_313_11
67-
python_version: '3.13'
68-
tox_env: py313-mode_ansible-ansible11
69-
- name: Van_313_11
70-
python_version: '3.13'
71-
tox_env: py313-mode_ansible-ansible11-strategy_linear
72-
73-
- name: Mito_27
74-
tox_env: py27-mode_mitogen
75-
- name: Mito_36
76-
python_version: '3.6'
77-
tox_env: py36-mode_mitogen
7827
- name: Mito_313
7928
python_version: '3.13'
8029
tox_env: py313-mode_mitogen
@@ -167,15 +116,9 @@ jobs:
167116
fail-fast: false
168117
matrix:
169118
include:
170-
- name: Mito_313
171-
tox_env: py313-mode_mitogen
172-
173119
- name: Loc_313_11
174120
tox_env: py313-mode_localhost-ansible11
175121

176-
- name: Van_313_11
177-
tox_env: py313-mode_localhost-ansible11-strategy_linear
178-
179122
steps:
180123
- uses: actions/checkout@v4
181124
- uses: actions/setup-python@v5

mitogen/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def _path_importer_cache(cls, path):
5555
return None
5656
return super()._path_importer_cache(path)
5757

58-
if sys.version_info[:2] <= (3, 12):
58+
if sys.version_info[:2] <= (3, 13): # I don't expect this workaround to work on 3.13, just ruling it out.
5959
for i, mpf in enumerate(sys.meta_path):
6060
if mpf is _frozen_importlib_external.PathFinder:
6161
sys.meta_path[i] = MonkeyPatchedPathFinder

tests/ansible/integration/action/make_tmp_path.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,13 @@
142142
# readonly homedir
143143
#
144144

145+
- name: Confirm readonly_homedir state
146+
become: true
147+
shell: stat ~mitogen__readonly_homedir
148+
register: stat_home_mitogen__readonly_homedir
149+
- debug:
150+
var: stat_home_mitogen__readonly_homedir
151+
145152
- name: Try writing to temp directory for the readonly_homedir user
146153
become: true
147154
become_user: mitogen__readonly_homedir
@@ -152,6 +159,11 @@
152159
result['path'] = path
153160
open(path, 'w').write("bar")
154161
register: tmp_path
162+
# Possibly hitting https://github.com/python/cpython/issues/115911
163+
# with Python 3.13 + macOS + Ansible 11
164+
when:
165+
- ansible_version.full is version('2.18', '<', strict=True)
166+
or not is_mitogen
155167

156168
#
157169
# modules get the same base dir

tests/ansible/integration/become/su_password.yml

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,51 @@
5555
vars:
5656
ansible_become_pass: user1_password
5757
when:
58-
# CI containers lack `setfacl` for unpriv -> unpriv
58+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
59+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
5960
# https://github.com/mitogen-hq/mitogen/issues/1118
60-
- is_mitogen
61-
or (ansible_facts.distribution in ["MacOSX"]
62-
and ansible_version.full is version("2.11", ">=", strict=True))
61+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
62+
# but Ansible >= 11 (ansible-core >= 2.18) tries to use Python 3.13
63+
# which hits https://github.com/python/cpython/issues/115911 on macOS
64+
- (
65+
not is_mitogen
66+
and ansible_facts.distribution in ["MacOSX"]
67+
and ansible_version.full is version("2.11", ">=", strict=True)
68+
)
69+
or (
70+
is_mitogen
71+
and not ansible_facts.distribution in ["MacOSX"]
72+
)
73+
or (
74+
is_mitogen
75+
and ansible_version.full is version("2.18", "<", strict=True)
76+
)
6377

6478
- assert:
6579
that:
6680
- out.stdout == 'mitogen__user1'
6781
fail_msg: |
6882
out={{ out }}
6983
when:
70-
# CI containers lack `setfacl` for unpriv -> unpriv
84+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
85+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
7186
# https://github.com/mitogen-hq/mitogen/issues/1118
72-
- is_mitogen
73-
or (ansible_facts.distribution in ["MacOSX"]
74-
and ansible_version.full is version("2.11", ">=", strict=True))
87+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
88+
# but Ansible >= 11 (ansible-core >= 2.18) tries to use Python 3.13
89+
# which hits https://github.com/python/cpython/issues/115911 on macOS
90+
- (
91+
not is_mitogen
92+
and ansible_facts.distribution in ["MacOSX"]
93+
and ansible_version.full is version("2.11", ">=", strict=True)
94+
)
95+
or (
96+
is_mitogen
97+
and not ansible_facts.distribution in ["MacOSX"]
98+
)
99+
or (
100+
is_mitogen
101+
and ansible_version.full is version("2.18", "<", strict=True)
102+
)
75103

76104
- name: Ensure password su without chdir succeeds
77105
shell: whoami
@@ -81,23 +109,51 @@
81109
vars:
82110
ansible_become_pass: user1_password
83111
when:
84-
# CI containers lack `setfacl` for unpriv -> unpriv
112+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
113+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
85114
# https://github.com/mitogen-hq/mitogen/issues/1118
86-
- is_mitogen
87-
or (ansible_facts.distribution in ["MacOSX"]
88-
and ansible_version.full is version("2.11", ">=", strict=True))
115+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
116+
# but Ansible >= 11 (ansible-core >= 2.18) tries to use Python 3.13
117+
# which hits https://github.com/python/cpython/issues/115911 on macOS
118+
- (
119+
not is_mitogen
120+
and ansible_facts.distribution in ["MacOSX"]
121+
and ansible_version.full is version("2.11", ">=", strict=True)
122+
)
123+
or (
124+
is_mitogen
125+
and not ansible_facts.distribution in ["MacOSX"]
126+
)
127+
or (
128+
is_mitogen
129+
and ansible_version.full is version("2.18", "<", strict=True)
130+
)
89131

90132
- assert:
91133
that:
92134
- out.stdout == 'mitogen__user1'
93135
fail_msg: |
94136
out={{ out }}
95137
when:
96-
# CI containers lack `setfacl` for unpriv -> unpriv
138+
# Vanilla Ansible >= 4 (ansible-core >= 2.11) can use `setfacl` for
139+
# unpriv -> unpriv, but Mitogen test containers lack setfacl
97140
# https://github.com/mitogen-hq/mitogen/issues/1118
98-
- is_mitogen
99-
or (ansible_facts.distribution in ["MacOSX"]
100-
and ansible_version.full is version("2.11", ">=", strict=True))
141+
# Mitogen + Ansible can do unpriv -> unpriv without temporary files,
142+
# but Ansible >= 11 (ansible-core >= 2.18) tries to use Python 3.13
143+
# which hits https://github.com/python/cpython/issues/115911 on macOS
144+
- (
145+
not is_mitogen
146+
and ansible_facts.distribution in ["MacOSX"]
147+
and ansible_version.full is version("2.11", ">=", strict=True)
148+
)
149+
or (
150+
is_mitogen
151+
and not ansible_facts.distribution in ["MacOSX"]
152+
)
153+
or (
154+
is_mitogen
155+
and ansible_version.full is version("2.18", "<", strict=True)
156+
)
101157

102158
tags:
103159
- su

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ deps =
8585
ansible8: ansible~=8.0
8686
ansible9: ansible~=9.0
8787
ansible10: ansible~=10.0
88-
ansible11: ansible>=11.0.0a2
88+
ansible11: ansible>=11.0
8989
install_command =
9090
python -m pip --no-python-version-warning --disable-pip-version-check install {opts} {packages}
9191
commands_pre =

0 commit comments

Comments
 (0)