diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9fa616..a5aafd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,11 @@ jobs: matrix: python: ['3.10', '3.11'] django: ['3.2', '4.1', '4.2'] - zdsclient: ['1.0', '2.0'] exclude: - python: '3.11' django: '3.2' - name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }}, zds-client ${{ matrix.zdsclient }}) + name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }} services: postgres: @@ -54,13 +53,12 @@ jobs: - name: Run tests run: | - export TOXENV=py${PYTHON_VERSION/./}-django${DJANGO/./}-zdsclient${ZDS_CLIENT/./} + export TOXENV=py${PYTHON_VERSION/./}-django${DJANGO/./} tox - codecov -e TOXENV,DJANGO,ZDS_CLIENT --file reports/coverage-${TOXENV}.xml + codecov -e TOXENV,DJANGO --file reports/coverage-${TOXENV}.xml env: PYTHON_VERSION: ${{ matrix.python }} DJANGO: ${{ matrix.django }} - ZDS_CLIENT: ${{ matrix.zdsclient }} publish: name: Publish package to PyPI diff --git a/setup.cfg b/setup.cfg index 059767a..4bc8081 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,7 @@ install_requires = django>=3.2.0 django-relativedelta>=2.0.0 django-solo - gemma-zds-client>=1.0.1 + gemma-zds-client>=2.0.0 django-simple-certmanager>=1.4.1 requests pyopenssl diff --git a/tox.ini b/tox.ini index 3abe578..df31824 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,7 @@ [tox] envlist = - py37-django32-zdsclient{10,20} - py{310,311}-django{32,41,42}-zdsclient{10,20} - py311-django{41,42}-zdsclient{10,20} + py{310,311}-django{32,41,42} + py311-django{41,42} isort black flake8 @@ -19,9 +18,6 @@ DJANGO = 3.2: django32 4.1: django41 4.2: django42 -ZDS_CLIENT = - 1.0: zdsclient10 - 2.0: zdsclient20 [testenv] setenv = @@ -42,8 +38,6 @@ deps = django32: Django~=3.2.0 django41: Django~=4.1.0 django42: Django~=4.2.0 - zdsclient10: gemma-zds-client~=1.0.0 - zdsclient20: gemma-zds-client~=2.0.0 commands = py.test -s tests \ --junitxml=reports/junit.xml \ diff --git a/zgw_consumers/legacy/client.py b/zgw_consumers/legacy/client.py index a56841e..a6227c3 100644 --- a/zgw_consumers/legacy/client.py +++ b/zgw_consumers/legacy/client.py @@ -6,7 +6,6 @@ from django.utils.module_loading import import_string import yaml -import zds_client from zds_client import Client from zds_client.oas import schema_fetcher @@ -14,8 +13,6 @@ logger = logging.getLogger(__name__) -IS_OLD_ZDS_CLIENT = zds_client.__version__ < "2.0.0" - Object = Dict[str, Any] @@ -67,28 +64,17 @@ def fetch_schema(self) -> None: logger.info("Fetching schema at '%s'", url) self._schema = schema_fetcher.fetch(url, {"v": "3"}) - def pre_request( - self, method: str, url: str, kwargs: Optional[dict] = None, **old_kwargs - ): + def pre_request(self, method: str, url: str, kwargs: Optional[dict] = None): """ Add authorization header to requests for APIs without jwt. """ kwargs = kwargs or {} - if old_kwargs: - warnings.warn( - "Keyword argument unpacking is removed in zds-client 2.0.", - DeprecationWarning, - ) - kwargs.update(old_kwargs) if not self.auth and self.auth_value: headers = kwargs.get("headers", {}) headers.update(self.auth_value) - if IS_OLD_ZDS_CLIENT: - super_kwargs = kwargs - else: - super_kwargs = {"kwargs": kwargs} + super_kwargs = {"kwargs": kwargs} return super().pre_request(method, url, **super_kwargs) diff --git a/zgw_consumers/models/services.py b/zgw_consumers/models/services.py index 8e423f3..fbe45c2 100644 --- a/zgw_consumers/models/services.py +++ b/zgw_consumers/models/services.py @@ -140,17 +140,7 @@ def build_client(self, **claims): api_root = api_root.replace(self.api_root, self.nlx, 1) Client = get_client_class() - # legacy flow - if hasattr(Client, "from_url"): - warnings.warn( - "Support for zds-client < 2.0 is deprecated", DeprecationWarning - ) - dummy_detail_url = f"{api_root}dummy/{_uuid}" - client = Client.from_url(dummy_detail_url) - client.schema_url = self.oas - client.schema_file = self.oas_file - else: # 2.0.0+ - client = Client(api_root, schema_url=self.oas, schema_file=self.oas_file) + client = Client(api_root, schema_url=self.oas, schema_file=self.oas_file) if self.server_certificate: client.server_certificate_path = (