Skip to content

Commit

Permalink
⬆️ Bump to Python 3.10
Browse files Browse the repository at this point in the history
Run pyupgrade again
  • Loading branch information
Viicos committed Jan 18, 2024
1 parent b1c81dc commit 6942c58
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions requirements/base.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
24 changes: 10 additions & 14 deletions requirements/ci.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
30 changes: 10 additions & 20 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/objects/api/utils.py
Original file line number Diff line number Diff line change
@@ -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):
Expand Down
8 changes: 4 additions & 4 deletions src/objects/typing.py
Original file line number Diff line number Diff line change
@@ -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]
4 changes: 1 addition & 3 deletions src/objects/utils/client.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6942c58

Please sign in to comment.