added Python 3.12 in the CI (#1812)

* added Python 3.12 in the CI

* try to make kafka work on py3.12

* skip kafka for the time being as it seems not woring with py3.12 yet

* using assert_called_once()
This commit is contained in:
Asif Saif Uddin 2023-10-18 15:50:39 +06:00 committed by GitHub
parent 3ad075a536
commit 6c8e7e6b28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 9 deletions

View File

@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [3.8,3.9,"3.10","3.11"] python-version: [3.8,3.9,"3.10","3.11","3.12"]
steps: steps:
- name: Install system packages - name: Install system packages
run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev run: sudo apt-get update && sudo apt-get install libcurl4-openssl-dev libssl-dev
@ -29,7 +29,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
python-version: [3.8,3.9,"3.10","3.11"] python-version: [3.8,3.9,"3.10","3.11","3.12"]
experimental: [false] experimental: [false]
include: include:
- python-version: pypy3.9 - python-version: pypy3.9

View File

@ -193,7 +193,7 @@ class test_Hub:
callback = Mock(name='callback') callback = Mock(name='callback')
with patch.object(self.hub, '_ready_lock', autospec=True) as lock: with patch.object(self.hub, '_ready_lock', autospec=True) as lock:
self.hub.call_soon(callback) self.hub.call_soon(callback)
assert lock.__enter__.called_once() lock.__enter__.assert_called_once()
def test_call_soon__promise_argument(self): def test_call_soon__promise_argument(self):
callback = promise(Mock(name='callback'), (1, 2, 3)) callback = promise(Mock(name='callback'), (1, 2, 3))

12
tox.ini
View File

@ -1,7 +1,7 @@
[tox] [tox]
envlist = envlist =
{pypy3.9,3.8,3.9,3.10,3.11}-unit {pypy3.9,3.8,3.9,3.10,3.11,3.12}-unit
{pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-py-amqp {pypy3.9,3.8,3.9,3.10,3.11,3.12}-linux-integration-py-amqp
{pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-redis {pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-redis
{pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-mongodb {pypy3.9,3.8,3.9,3.10,3.11}-linux-integration-mongodb
{3.8,3.9,3.10,3.11}-linux-integration-kafka {3.8,3.9,3.10,3.11}-linux-integration-kafka
@ -17,6 +17,7 @@ python =
3.9: py39 3.9: py39
3.10: py310, mypy 3.10: py310, mypy
3.11: py311 3.11: py311
3.12: py312
[testenv] [testenv]
sitepackages = False sitepackages = False
@ -25,9 +26,9 @@ passenv =
DISTUTILS_USE_SDK DISTUTILS_USE_SDK
deps= deps=
-r{toxinidir}/requirements/dev.txt -r{toxinidir}/requirements/dev.txt
apicheck,pypy3.9,3.8,3.9,3.10,3.11: -r{toxinidir}/requirements/default.txt apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/default.txt
apicheck,pypy3.9,3.8,3.9,3.10,3.11: -r{toxinidir}/requirements/test.txt apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test.txt
apicheck,pypy3.9,3.8,3.9,3.10,3.11: -r{toxinidir}/requirements/test-ci.txt apicheck,pypy3.9,3.8,3.9,3.10,3.11,3.12: -r{toxinidir}/requirements/test-ci.txt
apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt apicheck,3.8-linux,3.9-linux,3.10-linux,3.11-linux: -r{toxinidir}/requirements/extras/confluentkafka.txt
apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt apicheck,linkcheck: -r{toxinidir}/requirements/docs.txt
flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt flake8,pydocstyle,mypy: -r{toxinidir}/requirements/pkgutils.txt
@ -46,6 +47,7 @@ basepython =
3.9: python3.9 3.9: python3.9
3.10,apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.10 3.10,apicheck,pydocstyle,flake8,linkcheck,cov,mypy: python3.10
3.11: python3.11 3.11: python3.11
3.12: python3.12
install_command = python -m pip --disable-pip-version-check install {opts} {packages} install_command = python -m pip --disable-pip-version-check install {opts} {packages}