From f84030eedbbb54fb015a47b23860ddaaad23f7ca Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Thu, 18 Jan 2024 14:09:45 +0100 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20to=20Python=203.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run pyupgrade again --- .github/workflows/ci.yml | 2 +- .github/workflows/code-quality.yml | 4 ++-- requirements/base.txt | 10 +++++----- requirements/ci.txt | 24 ++++++++++-------------- requirements/dev.txt | 30 ++++++++++-------------------- src/objects/api/utils.py | 3 +-- src/objects/typing.py | 8 ++++---- src/objects/utils/client.py | 4 +--- 8 files changed, 34 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df59bb08..f003dbe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - uses: actions/setup-node@v4 with: node-version: '12' diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index c7da6b2c..2af193f9 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - uses: isort/isort-action@v1 with: requirementsFiles: requirements/dev.txt @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: '3.9' + python-version: '3.10' - name: Install dependencies run: | pip install -r requirements/dev.txt diff --git a/requirements/base.txt b/requirements/base.txt index 52579bad..3a1d66d3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --no-emit-index-url requirements/base.in @@ -230,8 +230,6 @@ requests-mock==1.8.0 # via zgw-consumers ruamel-yaml==0.17.4 # via drf-yasg -ruamel-yaml-clib==0.2.7 - # via ruamel-yaml sentry-sdk==1.0.0 # via -r requirements/base.in six==1.15.0 @@ -260,8 +258,10 @@ urllib3==1.26.6 # sentry-sdk uwsgi==2.0.21 # via -r requirements/base.in -vng-api-common[markdown_docs]==1.8.0 - # via -r requirements/base.in +vng-api-common[markdown-docs]==1.8.0 + # via + # -r requirements/base.in + # vng-api-common zgw-consumers==0.27.0 # via -r requirements/base.in diff --git a/requirements/ci.txt b/requirements/ci.txt index cac6f59f..8085aa14 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --no-emit-index-url --output-file=requirements/ci.txt requirements/base.txt requirements/test-tools.in @@ -109,9 +109,7 @@ django-jsonform==2.21.4 # -r requirements/base.txt # mozilla-django-oidc-db django-markup==1.3 - # via - # -r requirements/base.txt - # vng-api-common + # via -r requirements/base.txt django-ordered-model==3.7.4 # via # -r requirements/base.txt @@ -240,15 +238,15 @@ jsonschema==3.2.0 lxml==4.7.1 # via pyquery markdown==3.3.4 - # via - # -r requirements/base.txt - # vng-api-common + # via -r requirements/base.txt markupsafe==2.1.3 # via # -r requirements/base.txt # jinja2 maykin-django-two-factor-auth[phonenumbers]==2.0.3 - # via -r requirements/base.txt + # via + # -r requirements/base.txt + # maykin-django-two-factor-auth mozilla-django-oidc==4.0.0 # via # -r requirements/base.txt @@ -344,10 +342,6 @@ ruamel-yaml==0.17.4 # via # -r requirements/base.txt # drf-yasg -ruamel-yaml-clib==0.2.7 - # via - # -r requirements/base.txt - # ruamel-yaml sentry-sdk==1.0.0 # via -r requirements/base.txt six==1.15.0 @@ -390,8 +384,10 @@ urllib3==1.26.6 # sentry-sdk uwsgi==2.0.21 # via -r requirements/base.txt -vng-api-common[markdown_docs]==1.8.0 - # via -r requirements/base.txt +vng-api-common[markdown-docs]==1.8.0 + # via + # -r requirements/base.txt + # vng-api-common waitress==2.1.1 # via webtest webob==1.8.7 diff --git a/requirements/dev.txt b/requirements/dev.txt index 0dd1cdac..c1531f93 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -1,5 +1,5 @@ # -# This file is autogenerated by pip-compile with Python 3.9 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile --no-emit-index-url --output-file=requirements/dev.txt requirements/ci.txt requirements/dev.in @@ -137,9 +137,7 @@ django-jsonform==2.21.4 # -r requirements/ci.txt # mozilla-django-oidc-db django-markup==1.3 - # via - # -r requirements/ci.txt - # vng-api-common + # via -r requirements/ci.txt django-ordered-model==3.7.4 # via # -r requirements/ci.txt @@ -246,10 +244,6 @@ idna==2.10 # requests imagesize==1.4.1 # via sphinx -importlib-metadata==7.0.1 - # via - # build - # sphinx inflection==0.5.1 # via # -r requirements/ci.txt @@ -287,15 +281,15 @@ lxml==4.7.1 # -r requirements/ci.txt # pyquery markdown==3.3.4 - # via - # -r requirements/ci.txt - # vng-api-common + # via -r requirements/ci.txt markupsafe==2.1.3 # via # -r requirements/ci.txt # jinja2 maykin-django-two-factor-auth[phonenumbers]==2.0.3 - # via -r requirements/ci.txt + # via + # -r requirements/ci.txt + # maykin-django-two-factor-auth mccabe==0.7.0 # via flake8 mozilla-django-oidc==4.0.0 @@ -417,10 +411,6 @@ ruamel-yaml==0.17.4 # via # -r requirements/ci.txt # drf-yasg -ruamel-yaml-clib==0.2.7 - # via - # -r requirements/ci.txt - # ruamel-yaml sentry-sdk==1.0.0 # via -r requirements/ci.txt six==1.15.0 @@ -500,8 +490,10 @@ urllib3==1.26.6 # sentry-sdk uwsgi==2.0.21 # via -r requirements/ci.txt -vng-api-common[markdown_docs]==1.8.0 - # via -r requirements/ci.txt +vng-api-common[markdown-docs]==1.8.0 + # via + # -r requirements/ci.txt + # vng-api-common waitress==2.1.1 # via # -r requirements/ci.txt @@ -518,8 +510,6 @@ wheel==0.42.0 # via pip-tools zgw-consumers==0.27.0 # via -r requirements/ci.txt -zipp==3.17.0 - # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: # pip diff --git a/src/objects/api/utils.py b/src/objects/api/utils.py index 40385aff..143999cb 100644 --- a/src/objects/api/utils.py +++ b/src/objects/api/utils.py @@ -1,12 +1,11 @@ from datetime import date -from typing import Union from django.db import models from objects.typing import JSONValue -def string_to_value(value: str) -> Union[str, float, date]: +def string_to_value(value: str) -> str | float | date: if is_number(value): return float(value) elif is_date(value): diff --git a/src/objects/typing.py b/src/objects/typing.py index 1ffa8c1a..62d5dd9f 100644 --- a/src/objects/typing.py +++ b/src/objects/typing.py @@ -1,7 +1,7 @@ -from typing import Union +from typing import TypeAlias -JSONPrimitive = Union[str, int, None, float, bool] +JSONPrimitive: TypeAlias = "str | int | None | float | bool" -JSONValue = Union[JSONPrimitive, "JSONObject", list["JSONValue"]] +JSONValue: TypeAlias = "JSONPrimitive | JSONObject | list[JSONValue]" -JSONObject = dict[str, JSONValue] +JSONObject: TypeAlias = dict[str, JSONValue] diff --git a/src/objects/utils/client.py b/src/objects/utils/client.py index d5573454..9e1b8d21 100644 --- a/src/objects/utils/client.py +++ b/src/objects/utils/client.py @@ -1,9 +1,7 @@ -from typing import Optional - from zgw_consumers.client import ZGWClient from zgw_consumers.models import Service -def get_client(url: str) -> Optional[ZGWClient]: +def get_client(url: str) -> ZGWClient | None: client = Service.get_client(url) return client