root: lock pyright version

This commit is contained in:
Jens Langhammer 2020-10-03 15:34:53 +02:00
parent 55a83abb26
commit 801bb90806
3 changed files with 5 additions and 6 deletions

View File

@ -11,7 +11,7 @@ lint-fix:
black passbook e2e lifecycle black passbook e2e lifecycle
lint: lint:
pyright pyright e2e lifecycle pyright passbook e2e lifecycle
bandit -r passbook e2e lifecycle bandit -r passbook e2e lifecycle
pylint passbook e2e lifecycle pylint passbook e2e lifecycle
prospector prospector

View File

@ -89,7 +89,7 @@ stages:
versionSpec: '3.8' versionSpec: '3.8'
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: npm install -g pyright script: npm install -g pyright@1.1.75
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: | script: |

View File

@ -3,7 +3,6 @@ from csv import DictWriter
from multiprocessing import Manager, Process, cpu_count from multiprocessing import Manager, Process, cpu_count
from sys import stdout from sys import stdout
from time import time from time import time
from typing import List
from django import db from django import db
from django.core.management.base import BaseCommand from django.core.management.base import BaseCommand
@ -63,7 +62,7 @@ class Command(BaseCommand): # pragma: no cover
help="Output results as CSV", help="Output results as CSV",
) )
def benchmark_flows(self, proc_count) -> str: def benchmark_flows(self, proc_count):
"""Get full recovery link""" """Get full recovery link"""
flow = Flow.objects.get(slug="default-authentication-flow") flow = Flow.objects.get(slug="default-authentication-flow")
user = User.objects.get(username="pbadmin") user = User.objects.get(username="pbadmin")
@ -90,7 +89,7 @@ class Command(BaseCommand): # pragma: no cover
else: else:
self.output_overview(all_values) self.output_overview(all_values)
def output_overview(self, values: List[List[int]]): def output_overview(self, values):
"""Output results human readable""" """Output results human readable"""
total_max = max([max(inner) for inner in values]) total_max = max([max(inner) for inner in values])
total_min = min([min(inner) for inner in values]) total_min = min([min(inner) for inner in values])
@ -104,7 +103,7 @@ class Command(BaseCommand): # pragma: no cover
print(f"\tMin: {total_min * 100}ms") print(f"\tMin: {total_min * 100}ms")
print(f"\tAvg: {total_avg * 100}ms") print(f"\tAvg: {total_avg * 100}ms")
def output_csv(self, values: List[List[int]]): def output_csv(self, values):
"""Output results as CSV""" """Output results as CSV"""
proc_count = len(values) proc_count = len(values)
fieldnames = [f"proc_{idx}" for idx in range(proc_count)] fieldnames = [f"proc_{idx}" for idx in range(proc_count)]