*: bump pyright version

This commit is contained in:
Jens Langhammer 2021-02-12 10:19:38 +01:00
parent 417b5d61a4
commit 5417d0a90c
7 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ def get_events_per_1h(**filter_kwargs) -> List[Dict[str, int]]:
.annotate(count=Count("pk")) .annotate(count=Count("pk"))
.order_by("age_hours") .order_by("age_hours")
) )
data = Counter({d["age_hours"]: d["count"] for d in result}) data = Counter({int(d["age_hours"]): d["count"] for d in result})
results = [] results = []
_now = now() _now = now()
for hour in range(0, -24, -1): for hour in range(0, -24, -1):

View File

@ -5,7 +5,6 @@ from typing import Optional, Union
from uuid import uuid4 from uuid import uuid4
from django.conf import settings from django.conf import settings
from django.core.exceptions import ValidationError
from django.db import models from django.db import models
from django.http import HttpRequest from django.http import HttpRequest
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _

View File

@ -2,7 +2,7 @@
from contextlib import contextmanager from contextlib import contextmanager
from copy import deepcopy from copy import deepcopy
from json import loads from json import loads
from typing import Any, Dict from typing import Any, Dict, Type
from dacite import from_dict from dacite import from_dict
from dacite.exceptions import DaciteError from dacite.exceptions import DaciteError
@ -90,7 +90,7 @@ class FlowImporter:
def _validate_single(self, entry: FlowBundleEntry) -> BaseSerializer: def _validate_single(self, entry: FlowBundleEntry) -> BaseSerializer:
"""Validate a single entry""" """Validate a single entry"""
model_app_label, model_name = entry.model.split(".") model_app_label, model_name = entry.model.split(".")
model: SerializerModel = apps.get_model(model_app_label, model_name) model: Type[SerializerModel] = apps.get_model(model_app_label, model_name)
if not isinstance(model(), ALLOWED_MODELS): if not isinstance(model(), ALLOWED_MODELS):
raise EntryInvalidError(f"Model {model} not allowed") raise EntryInvalidError(f"Model {model} not allowed")

View File

@ -2,6 +2,8 @@
from typing import TYPE_CHECKING, Generic, TypeVar from typing import TYPE_CHECKING, Generic, TypeVar
from kubernetes.client import V1ObjectMeta from kubernetes.client import V1ObjectMeta
from kubernetes.client.models.v1_deployment import V1Deployment
from kubernetes.client.models.v1_pod import V1Pod
from kubernetes.client.rest import ApiException from kubernetes.client.rest import ApiException
from structlog.stdlib import get_logger from structlog.stdlib import get_logger
@ -12,7 +14,7 @@ if TYPE_CHECKING:
from authentik.outposts.controllers.kubernetes import KubernetesController from authentik.outposts.controllers.kubernetes import KubernetesController
# pylint: disable=invalid-name # pylint: disable=invalid-name
T = TypeVar("T") T = TypeVar("T", V1Pod, V1Deployment)
class ReconcileTrigger(SentryIgnoredException): class ReconcileTrigger(SentryIgnoredException):

View File

@ -11,7 +11,6 @@ from sentry_sdk.tracing import Span
from structlog.stdlib import BoundLogger, get_logger from structlog.stdlib import BoundLogger, get_logger
from authentik.core.models import User from authentik.core.models import User
from authentik.lib.utils.http import get_client_ip
from authentik.policies.models import Policy, PolicyBinding, PolicyBindingModel from authentik.policies.models import Policy, PolicyBinding, PolicyBindingModel
from authentik.policies.process import PolicyProcess, cache_key from authentik.policies.process import PolicyProcess, cache_key
from authentik.policies.types import PolicyRequest, PolicyResult from authentik.policies.types import PolicyRequest, PolicyResult

View File

@ -23,7 +23,7 @@ def config_loggers(*args, **kwags):
# pylint: disable=unused-argument # pylint: disable=unused-argument
@after_task_publish.connect @after_task_publish.connect
def after_task_publish(sender=None, headers=None, body=None, **kwargs): def after_task_publish_hook(sender=None, headers=None, body=None, **kwargs):
"""Log task_id after it was published""" """Log task_id after it was published"""
info = headers if "task" in headers else body info = headers if "task" in headers else body
LOGGER.debug( LOGGER.debug(
@ -33,14 +33,14 @@ def after_task_publish(sender=None, headers=None, body=None, **kwargs):
# pylint: disable=unused-argument # pylint: disable=unused-argument
@task_prerun.connect @task_prerun.connect
def task_prerun(task_id, task, *args, **kwargs): def task_prerun_hook(task_id, task, *args, **kwargs):
"""Log task_id on worker""" """Log task_id on worker"""
LOGGER.debug("Task started", task_id=task_id, task_name=task.__name__) LOGGER.debug("Task started", task_id=task_id, task_name=task.__name__)
# pylint: disable=unused-argument # pylint: disable=unused-argument
@task_postrun.connect @task_postrun.connect
def task_postrun(task_id, task, *args, retval=None, state=None, **kwargs): def task_postrun_hook(task_id, task, *args, retval=None, state=None, **kwargs):
"""Log task_id on worker""" """Log task_id on worker"""
LOGGER.debug("Task finished", task_id=task_id, task_name=task.__name__, state=state) LOGGER.debug("Task finished", task_id=task_id, task_name=task.__name__, state=state)

View File

@ -93,7 +93,7 @@ stages:
versionSpec: '3.9' versionSpec: '3.9'
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: npm install -g pyright@1.1.79 script: npm install -g pyright@1.1.109
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: | script: |