Skip to content
Snippets Groups Projects
Commit 92ae6209 authored by Deaktivert bruker's avatar Deaktivert bruker
Browse files

Merge branch 'GREG-13/1' into 'master'

Fix Mypy static analysis problems

See merge request !4
parents f1f29679 1f263420
No related branches found
No related tags found
1 merge request!4Fix Mypy static analysis problems
MYPY ?= mypy
PIP ?= pip -q
POETRY ?= poetry
PYTHON ?= python3.9
VENV ?= venv
mypy = $(MYPY) --config-file mypy.ini
pip = python -m $(PIP)
poetry = python -m $(POETRY)
venv = . $(VENV)/bin/activate &&
......@@ -21,6 +23,7 @@ $(VENV)/touchfile:
.PHONY: test
test: $(VENV)
$(venv) $(mypy) -p greg
$(venv) python manage.py test
.PHONY: deps
......
......@@ -79,7 +79,7 @@ class PersonConsentAdmin(admin.ModelAdmin):
def get_consent_name_en(self, obj):
return obj.consent.consent_name_en
get_consent_name_en.short_description = "Consent name"
get_consent_name_en.short_description = "Consent name" # type: ignore
class OrganizationalUnitAdmin(admin.ModelAdmin):
......
from typing import (
Sequence,
Type,
)
from django.http import HttpResponse
from drf_spectacular.utils import extend_schema
from rest_framework.authentication import BaseAuthentication
from rest_framework.permissions import BasePermission
from rest_framework.status import HTTP_200_OK
from rest_framework.views import APIView
......@@ -7,12 +14,10 @@ from rest_framework.views import APIView
class Health(APIView):
"""Health checks."""
authentication_classes = []
permission_classes = []
authentication_classes: Sequence[Type[BaseAuthentication]] = []
permission_classes: Sequence[Type[BasePermission]] = []
@extend_schema(
responses={200: str},
)
@extend_schema(responses={200: str})
def get(self, request, *args, **kwargs):
"""Always gives a thumbs up by returning `OK` as plain text."""
return HttpResponse("OK", content_type="text/plain", status=HTTP_200_OK)
[mypy]
python_version = 3.8
python_version = 3.9
plugins = mypy_django_plugin.main, mypy_drf_plugin.main
warn_unused_ignores = True
warn_no_return = True
warn_return_any = True
warn_redundant_casts = True
no_error_summary = True
[mypy.plugins.django-stubs]
django_settings_module = gregsite.settings.dev
......@@ -18,3 +19,9 @@ ignore_missing_imports = True
[mypy-django_extensions.db.fields]
ignore_missing_imports = True
[mypy-django_filters.*]
ignore_missing_imports = True
[mypy-faker.*]
ignore_missing_imports = True
......@@ -868,8 +868,8 @@ python-versions = "*"
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "c6f2e2809e386b43757a434e55b6bf643405ad99d7e792650e2df4dabb3e5d82"
python-versions = "^3.9"
content-hash = "f91a1dbee67b9d5b3b034d6285509e900a47c07984dcdc50caf5532f2efd3ae0"
[metadata.files]
appdirs = [
......
......@@ -12,7 +12,7 @@ authors = [
]
[tool.poetry.dependencies]
python = "^3.8"
python = "^3.9"
django = "*"
django-dirtyfields = "*"
django-extensions = "*"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment