From 6decfc8bd31c81dc977d19e2a17df70f33df3ca8 Mon Sep 17 00:00:00 2001 From: Dima Kryukov Date: Wed, 3 Jan 2024 13:45:35 +0300 Subject: [PATCH] Add python 3.12 support --- .github/workflows/tests.yml | 2 +- Makefile | 2 +- setup.cfg | 1 + tests/test_middleware.py | 2 +- tox.ini | 46 ++++++++++++++++++------------------- 5 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0704f3a..ed5fcd9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,7 @@ jobs: strategy: max-parallel: 5 matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index 4eb7267..4f396ec 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ clean: upload: clean python setup.py sdist bdist_wheel - twine upload -u krukov dist/* + twine upload dist/* LENGTH=120 diff --git a/setup.cfg b/setup.cfg index ee0298b..239472e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,6 +22,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 [options] python_requires = >=3.8 diff --git a/tests/test_middleware.py b/tests/test_middleware.py index 2ec8be4..fb10917 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -33,7 +33,7 @@ async def test_memory_limit(cache: Cache, target): await cache.set(key="key", value="v") target.set.assert_not_called() - await cache.set(key="key", value="v" * 31) + await cache.set(key="key", value="v" * 35) target.set.assert_not_called() await cache.set(key="key", value="v" * 15) diff --git a/tox.ini b/tox.ini index 8cd7910..43dec31 100644 --- a/tox.ini +++ b/tox.ini @@ -1,10 +1,10 @@ [tox] envlist = - {py38,py39,py310,py311} - {py38,py39,py310,py311}-redis - {py38,py39,py310,py311}-redis4 - {py38,py39,py310,py311}-diskcache - {py38,py39,py310,py311}-integration + {py38,py39,py310,py311,py312} + {py38,py39,py310,py311,py312}-redis + {py38,py39,py310,py311,py312}-redis4 + {py38,py39,py310,py311,py312}-diskcache + {py38,py39,py310,py311,py312}-integration coverage skip_missing_interpreters = true @@ -15,26 +15,26 @@ setenv = PYTHONPATH = {toxinidir}/tests COVERAGE_FILE = {toxworkdir}/.coverage.{envname} MARKER = not redis and not integration and not diskcache - {py,py38,py39,py310,py311}-redis: MARKER = redis and not diskcache - {py,py38,py39,py310,py311}-redis4: MARKER = redis and not diskcache - {py,py38,py39,py310,py311}-diskcache: MARKER = diskcache and not redis - {py,py38,py39,py310,py311}-integration: MARKER = integration + {py,py38,py39,py310,py311,py312}-redis: MARKER = redis and not diskcache + {py,py38,py39,py310,py311,py312}-redis4: MARKER = redis and not diskcache + {py,py38,py39,py310,py311,py312}-diskcache: MARKER = diskcache and not redis + {py,py38,py39,py310,py311,py312}-integration: MARKER = integration deps = pytest pytest-asyncio==0.21.1 pytest-cov pytest-rerunfailures hypothesis - {py,py38,py39,py310,py311}-redis4: redis==4.6.0 - {py,py38,py39,py310,py311}-integration: aiohttp - {py,py38,py39,py310,py311}-integration: fastapi - {py,py38,py39,py310,py311}-integration: httpx - {py,py38,py39,py310,py311}-integration: SQLAlchemy - {py,py38,py39,py310,py311}-integration: prometheus-client + {py,py38,py39,py310,py311,py312}-redis4: redis==4.6.0 + {py,py38,py39,py310,py311,py312}-integration: aiohttp + {py,py38,py39,py310,py311,py312}-integration: fastapi + {py,py38,py39,py310,py311,py312}-integration: httpx + {py,py38,py39,py310,py311,py312}-integration: SQLAlchemy + {py,py38,py39,py310,py311,py312}-integration: prometheus-client extras = - {py,py38,py39,py310,py311}-redis: redis,speedup - {py,py38,py39,py310,py311}-diskcache: diskcache - {py,py37,py38,py39,py310,py311}-integration: redis,speedup,diskcache,dill + {py,py38,py39,py310,py311,py312}-redis: redis,speedup + {py,py38,py39,py310,py311,py312}-diskcache: diskcache + {py,py37,py38,py39,py310,py311,py312}-integration: redis,speedup,diskcache,dill commands = pytest --cov --cov-fail-under=0 --reruns 5 --reruns-delay 1 \ -m "{env:MARKER}" \ @@ -52,8 +52,8 @@ commands = coverage report coverage xml -o {toxworkdir}/coverage.xml depends = - {py38,py39,py310,py311} - {py38,py39,py310,py311}-redis - {py38,py39,py310,py311}-redis4 - {py38,py39,py310,py311}-diskcache - {py38,py39,py310,py311}-integration + {py38,py39,py310,py311,py312} + {py38,py39,py310,py311,py312}-redis + {py38,py39,py310,py311,py312}-redis4 + {py38,py39,py310,py311,py312}-diskcache + {py38,py39,py310,py311,py312}-integration