*: bump pyright version
This commit is contained in:
parent
417b5d61a4
commit
5417d0a90c
|
@ -32,7 +32,7 @@ def get_events_per_1h(**filter_kwargs) -> List[Dict[str, int]]:
|
|||
.annotate(count=Count("pk"))
|
||||
.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 = []
|
||||
_now = now()
|
||||
for hour in range(0, -24, -1):
|
||||
|
|
|
@ -5,7 +5,6 @@ from typing import Optional, Union
|
|||
from uuid import uuid4
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.db import models
|
||||
from django.http import HttpRequest
|
||||
from django.utils.translation import gettext as _
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
from contextlib import contextmanager
|
||||
from copy import deepcopy
|
||||
from json import loads
|
||||
from typing import Any, Dict
|
||||
from typing import Any, Dict, Type
|
||||
|
||||
from dacite import from_dict
|
||||
from dacite.exceptions import DaciteError
|
||||
|
@ -90,7 +90,7 @@ class FlowImporter:
|
|||
def _validate_single(self, entry: FlowBundleEntry) -> BaseSerializer:
|
||||
"""Validate a single entry"""
|
||||
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):
|
||||
raise EntryInvalidError(f"Model {model} not allowed")
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
from typing import TYPE_CHECKING, Generic, TypeVar
|
||||
|
||||
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 structlog.stdlib import get_logger
|
||||
|
||||
|
@ -12,7 +14,7 @@ if TYPE_CHECKING:
|
|||
from authentik.outposts.controllers.kubernetes import KubernetesController
|
||||
|
||||
# pylint: disable=invalid-name
|
||||
T = TypeVar("T")
|
||||
T = TypeVar("T", V1Pod, V1Deployment)
|
||||
|
||||
|
||||
class ReconcileTrigger(SentryIgnoredException):
|
||||
|
|
|
@ -11,7 +11,6 @@ from sentry_sdk.tracing import Span
|
|||
from structlog.stdlib import BoundLogger, get_logger
|
||||
|
||||
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.process import PolicyProcess, cache_key
|
||||
from authentik.policies.types import PolicyRequest, PolicyResult
|
||||
|
|
|
@ -23,7 +23,7 @@ def config_loggers(*args, **kwags):
|
|||
|
||||
# pylint: disable=unused-argument
|
||||
@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"""
|
||||
info = headers if "task" in headers else body
|
||||
LOGGER.debug(
|
||||
|
@ -33,14 +33,14 @@ def after_task_publish(sender=None, headers=None, body=None, **kwargs):
|
|||
|
||||
# pylint: disable=unused-argument
|
||||
@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"""
|
||||
LOGGER.debug("Task started", task_id=task_id, task_name=task.__name__)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
@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"""
|
||||
LOGGER.debug("Task finished", task_id=task_id, task_name=task.__name__, state=state)
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ stages:
|
|||
versionSpec: '3.9'
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: npm install -g pyright@1.1.79
|
||||
script: npm install -g pyright@1.1.109
|
||||
- task: CmdLine@2
|
||||
inputs:
|
||||
script: |
|
||||
|
|
Reference in New Issue