Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete zds-client usage #89

Merged
merged 10 commits into from
Mar 26, 2024
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies = [
"django-simple-certmanager>=1.4.1",
"requests",
"ape-pie",
"typing_extensions>=4.5.0",
]

[project.urls]
Expand Down
13 changes: 12 additions & 1 deletion zgw_consumers/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.core.cache import caches

from zds_client.oas import schema_fetcher
from typing_extensions import deprecated

from .settings import get_setting

Expand All @@ -13,6 +13,12 @@ class OASCache:
KEY_PREFIX = "oas"
DURATION = 60 * 60 * 24 # 24 hours

@deprecated(
"zds_client support is deprecated and scheduled for removal in 1.0. OpenAPI "
"specification integration will be dropped as we don't require it anymore.",
category=DeprecationWarning,
sergei-maertens marked this conversation as resolved.
Show resolved Hide resolved
stacklevel=2,
)
def __init__(self):
self.alias = get_setting("ZGW_CONSUMERS_OAS_CACHE")
self._local_cache = {} # in memory
Expand Down Expand Up @@ -45,4 +51,9 @@ def clear(self):


def install_schema_fetcher_cache():
try:
from zds_client.oas import schema_fetcher
except ImportError:
return

schema_fetcher.cache = OASCache()