From 219232f488159aa313a1ff3bee9776ba2b8f60c1 Mon Sep 17 00:00:00 2001 From: Andrii Yurchuk Date: Sun, 29 Sep 2024 13:24:20 +0200 Subject: [PATCH] Fix CI (#437) --- django_prometheus/cache/backends/redis.py | 2 +- django_prometheus/tests/end2end/testapp/settings.py | 1 - django_prometheus/tests/end2end/testapp/test_caches.py | 2 +- pyproject.toml | 6 +++--- requirements.txt | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/django_prometheus/cache/backends/redis.py b/django_prometheus/cache/backends/redis.py index 94e4d01f..bc982dac 100644 --- a/django_prometheus/cache/backends/redis.py +++ b/django_prometheus/cache/backends/redis.py @@ -1,5 +1,6 @@ from django import VERSION as DJANGO_VERSION from django_redis import cache, exceptions + from django_prometheus.cache.metrics import ( django_cache_get_fail_total, django_cache_get_total, @@ -36,7 +37,6 @@ def get(self, key, default=None, version=None, client=None): from django.core.cache.backends.redis import RedisCache as DjangoRedisCache class NativeRedisCache(DjangoRedisCache): - def get(self, key, default=None, version=None): django_cache_get_total.labels(backend="native_redis").inc() try: diff --git a/django_prometheus/tests/end2end/testapp/settings.py b/django_prometheus/tests/end2end/testapp/settings.py index 60254d8d..cb4c4dde 100644 --- a/django_prometheus/tests/end2end/testapp/settings.py +++ b/django_prometheus/tests/end2end/testapp/settings.py @@ -2,7 +2,6 @@ import tempfile from django import VERSION as DJANGO_VERSION - from testapp.helpers import get_middleware # SECURITY WARNING: keep the secret key used in production secret! diff --git a/django_prometheus/tests/end2end/testapp/test_caches.py b/django_prometheus/tests/end2end/testapp/test_caches.py index 389dc5ae..713fd2fb 100644 --- a/django_prometheus/tests/end2end/testapp/test_caches.py +++ b/django_prometheus/tests/end2end/testapp/test_caches.py @@ -1,6 +1,6 @@ import pytest -from django.core.cache import caches from django import VERSION as DJANGO_VERSION +from django.core.cache import caches from redis import RedisError from django_prometheus.testutils import assert_metric_equal, get_metric diff --git a/pyproject.toml b/pyproject.toml index 1ddd9f3a..84b8029d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = [ "setuptools >= 67.7.2", "wheel >= 0.40.0"] +requires = ["setuptools >= 67.7.2, < 72.0.0", "wheel >= 0.40.0"] build-backend = "setuptools.build_meta" [tool.pytest.ini_options] @@ -24,8 +24,8 @@ legacy_tox_ini = """ min_version = 4.4 envlist = {py37,py38,py39,py310,py311}-django{320}-{end2end,unittests} - {py38,py39,py310,py311,312}-django{400,410,420}-{end2end,unittests} - {py310,py311,312}-django{500}-{end2end,unittests} + {py38,py39,py310,py311,py312}-django{400,410,420}-{end2end,unittests} + {py310,py311,py312}-django{500}-{end2end,unittests} py39-lint [gh-actions] diff --git a/requirements.txt b/requirements.txt index 3cd82f19..50787ea8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ pytest-django pylibmc pymemcache python-memcached -setuptools +setuptools<72.0.0 wheel