Skip to content

Commit 55c9d94

Browse files
committed
Add Python 3.13 testing
1 parent c3e8cdb commit 55c9d94

File tree

4 files changed

+20
-14
lines changed

4 files changed

+20
-14
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
- name: '3.12'
6666
tox_env: integration-py312
6767

68+
- name: '3.13.0-alpha - 3.13.0'
69+
tox_env: integration-py313
70+
6871
steps:
6972
- name: Checkout
7073
uses: actions/checkout@v4
@@ -122,6 +125,9 @@ jobs:
122125
- name: '3.12'
123126
tox_env: unit-py312
124127

128+
- name: '3.13.0-alpha - 3.13.0'
129+
tox_env: unit-py313
130+
125131
steps:
126132
- name: Checkout
127133
uses: actions/checkout@v4

src/ansible_runner/utils/base64io.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ def __init__(self, wrapped: IO) -> None:
7878
7979
:raises TypeError: if ``wrapped`` does not have attributes needed to determine the stream's state
8080
"""
81+
# set before the attr check as we may reach close() after that check fails
82+
self.__read_buffer = b""
83+
self.__write_buffer = b""
84+
8185
required_attrs = ("read", "write", "close", "closed", "flush")
8286
if not all(hasattr(wrapped, attr) for attr in required_attrs):
8387
raise TypeError(
8488
f"Base64IO wrapped object must have attributes: {repr(sorted(required_attrs))}"
8589
)
8690
super().__init__()
8791
self.__wrapped = wrapped
88-
self.__read_buffer = b""
89-
self.__write_buffer = b""
9092

9193
def __enter__(self):
9294
"""Return self on enter."""

test/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--pre
12
mypy==1.6.0
23
pylint==3.0.1
34
pytest==8.1.1
@@ -8,4 +9,5 @@ pytest-xdist==2.5.0
89
types-pyyaml
910
flake8==6.1.0
1011
yamllint==1.32.0
12+
cffi
1113
cryptography

tox.ini

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = linters, ansible{27, 28, 29, -base}
2+
envlist = linters
33
requires =
44
tox>4
55
setuptools>=64
@@ -9,21 +9,17 @@ pytest_cov_args = --cov --cov-report html --cov-report term --cov-report xml
99

1010
[testenv]
1111
description = Run tests with {basepython}
12-
deps = ansible27: ansible<2.8
13-
ansible28: ansible<2.9
14-
ansible29: ansible<2.10
15-
ansible-base: ansible-base
16-
py{,3,39,310,311}: ansible-core
17-
integration{,-py39,-py310,-py311,-py312}: ansible-core
18-
build
19-
-r {toxinidir}/test/requirements.txt
12+
deps =
13+
ansible-core
14+
integration{,-py39,-py310,-py311,-py312}: build
15+
-r {toxinidir}/test/requirements.txt
2016
passenv =
2117
HOME
2218
RUNNER_TEST_IMAGE_NAME
2319
usedevelop = True
2420
commands = pytest -vv -n auto {posargs}
2521

26-
[testenv:linters{,-py39,-py310,-py311,-py312}]
22+
[testenv:linters{,-py39,-py310,-py311,-py312,-py313}]
2723
description = Run code linters
2824
commands =
2925
flake8 --version
@@ -33,11 +29,11 @@ commands =
3329
mypy src/ansible_runner
3430
pylint src/ansible_runner test
3531

36-
[testenv:unit{,-py39,-py310,-py311,-py312}]
32+
[testenv:unit{,-py39,-py310,-py311,-py312,-py313}]
3733
description = Run unit tests
3834
commands = pytest -vv -n auto {posargs:test/unit} {[shared]pytest_cov_args}
3935

40-
[testenv:integration{,-py39,-py310,-py311,-py312}]
36+
[testenv:integration{,-py39,-py310,-py311,-py312,-py313}]
4137
description = Run integration tests
4238
commands = pytest -vv -n auto {posargs:test/integration} {[shared]pytest_cov_args}
4339

0 commit comments

Comments
 (0)