From 5562df8de607f5f2523e6e29d44e51c1d16e4d67 Mon Sep 17 00:00:00 2001 From: Faustin Lammler Date: Fri, 26 Apr 2024 13:25:04 +0200 Subject: [PATCH] Isort linting --- buildbot.tac | 3 ++- ci_build_images/buildbot.tac | 6 ++---- common_factories.py | 15 ++++++++------- cross-reference/crossreference/cr/admin.py | 2 +- cross-reference/crossreference/cr/models.py | 8 ++++---- cross-reference/crossreference/cr/router.py | 2 +- cross-reference/crossreference/cr/views.py | 3 +-- .../crossreference/crossreference/settings.py | 1 + define_masters.py | 1 + locks.py | 11 ++++++----- master-bintars/buildbot.tac | 3 ++- master-docker-nonstandard-2/buildbot.tac | 3 ++- master-docker-nonstandard/buildbot.tac | 3 ++- master-galera/buildbot.tac | 3 ++- master-libvirt/buildbot.tac | 3 ++- master-nonlatent/buildbot.tac | 3 ++- master-protected-branches/buildbot.tac | 3 ++- master-web/buildbot.tac | 3 ++- schedulers_definition.py | 1 - utils.py | 15 +++++++++------ 20 files changed, 52 insertions(+), 40 deletions(-) diff --git a/buildbot.tac b/buildbot.tac index 39c8f8b1..9fe307cb 100644 --- a/buildbot.tac +++ b/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "%s"), diff --git a/ci_build_images/buildbot.tac b/ci_build_images/buildbot.tac index 7d300058..232761fc 100644 --- a/ci_build_images/buildbot.tac +++ b/ci_build_images/buildbot.tac @@ -2,11 +2,9 @@ import fnmatch import os import sys -from twisted.application import service -from twisted.python.log import FileLogObserver -from twisted.python.log import ILogObserver - from buildbot_worker.bot import Worker +from twisted.application import service +from twisted.python.log import FileLogObserver, ILogObserver # setup worker basedir = os.path.abspath(os.path.dirname(__file__)) diff --git a/common_factories.py b/common_factories.py index 33758dcc..b39555e5 100644 --- a/common_factories.py +++ b/common_factories.py @@ -1,15 +1,16 @@ +from twisted.internet import defer + from buildbot.plugins import * from buildbot.process import results -from buildbot.process.properties import Property, Properties -from buildbot.steps.package.rpm.rpmlint import RpmLint -from buildbot.steps.shell import ShellCommand, Compile, Test, SetPropertyFromCommand +from buildbot.process.properties import Properties, Property +from buildbot.process.remotecommand import RemoteCommand from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver +from buildbot.steps.package.rpm.rpmlint import RpmLint +from buildbot.steps.shell import (Compile, SetPropertyFromCommand, + ShellCommand, Test) from buildbot.steps.source.github import GitHub -from buildbot.process.remotecommand import RemoteCommand -from twisted.internet import defer - -from utils import * from constants import * +from utils import * # TODO for FetchTestData/getLastNFailedBuildsFactory diff --git a/cross-reference/crossreference/cr/admin.py b/cross-reference/crossreference/cr/admin.py index 56d47cf0..6a0433c9 100644 --- a/cross-reference/crossreference/cr/admin.py +++ b/cross-reference/crossreference/cr/admin.py @@ -1,5 +1,5 @@ -from django.contrib import admin from cr.models import TestFailure, TestRun +from django.contrib import admin admin.site.register(TestFailure) admin.site.register(TestRun) diff --git a/cross-reference/crossreference/cr/models.py b/cross-reference/crossreference/cr/models.py index 775568d8..96d862d0 100644 --- a/cross-reference/crossreference/cr/models.py +++ b/cross-reference/crossreference/cr/models.py @@ -1,9 +1,9 @@ -from django.db import models, connections -from django.db.models import Q -from pprint import pprint import re -from django.db import connection from datetime import datetime +from pprint import pprint + +from django.db import connection, connections, models +from django.db.models import Q class Builder(models.Model): diff --git a/cross-reference/crossreference/cr/router.py b/cross-reference/crossreference/cr/router.py index fede9d79..7aeb966c 100644 --- a/cross-reference/crossreference/cr/router.py +++ b/cross-reference/crossreference/cr/router.py @@ -1,4 +1,4 @@ -from .models import TestRun, TestFailure, Builder +from .models import Builder, TestFailure, TestRun class MariaDBRouter: diff --git a/cross-reference/crossreference/cr/views.py b/cross-reference/crossreference/cr/views.py index 08ad30d5..0335f159 100644 --- a/cross-reference/crossreference/cr/views.py +++ b/cross-reference/crossreference/cr/views.py @@ -1,7 +1,6 @@ -from django.shortcuts import render - # Create your views here. from django.http import HttpResponse +from django.shortcuts import render from .models import select_test_failures diff --git a/cross-reference/crossreference/crossreference/settings.py b/cross-reference/crossreference/crossreference/settings.py index c2ab77b2..9dbf149a 100644 --- a/cross-reference/crossreference/crossreference/settings.py +++ b/cross-reference/crossreference/crossreference/settings.py @@ -1,4 +1,5 @@ import os + from dotenv import load_dotenv # Load environment variables from .env file diff --git a/define_masters.py b/define_masters.py index ea650cd0..a3983f95 100755 --- a/define_masters.py +++ b/define_masters.py @@ -2,6 +2,7 @@ import os import shutil + import yaml BASE_PATH = "autogen/" diff --git a/locks.py b/locks.py index d806a07b..0236bd24 100644 --- a/locks.py +++ b/locks.py @@ -1,11 +1,12 @@ +from twisted.internet import defer + from buildbot.plugins import * -from buildbot.process.properties import Property, Properties -from buildbot.steps.shell import ShellCommand, Compile, Test, SetPropertyFromCommand +from buildbot.process.properties import Properties, Property +from buildbot.process.remotecommand import RemoteCommand from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver +from buildbot.steps.shell import (Compile, SetPropertyFromCommand, + ShellCommand, Test) from buildbot.steps.source.github import GitHub -from buildbot.process.remotecommand import RemoteCommand -from twisted.internet import defer - from constants import * ####### LOCKS diff --git a/master-bintars/buildbot.tac b/master-bintars/buildbot.tac index 00493553..f41c9ee9 100644 --- a/master-bintars/buildbot.tac +++ b/master-bintars/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-bintars.log"), diff --git a/master-docker-nonstandard-2/buildbot.tac b/master-docker-nonstandard-2/buildbot.tac index e4a023b6..a06fa24f 100644 --- a/master-docker-nonstandard-2/buildbot.tac +++ b/master-docker-nonstandard-2/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-docker-non-standard-2.log"), diff --git a/master-docker-nonstandard/buildbot.tac b/master-docker-nonstandard/buildbot.tac index 03a5b4bd..feaa05c6 100644 --- a/master-docker-nonstandard/buildbot.tac +++ b/master-docker-nonstandard/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-docker-non-standard.log"), diff --git a/master-galera/buildbot.tac b/master-galera/buildbot.tac index 8575d61f..78171070 100644 --- a/master-galera/buildbot.tac +++ b/master-galera/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-galera.log"), diff --git a/master-libvirt/buildbot.tac b/master-libvirt/buildbot.tac index 5ed58777..3282a746 100644 --- a/master-libvirt/buildbot.tac +++ b/master-libvirt/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-libvirt.log"), diff --git a/master-nonlatent/buildbot.tac b/master-nonlatent/buildbot.tac index 8eeb3696..326ebdd6 100644 --- a/master-nonlatent/buildbot.tac +++ b/master-nonlatent/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-nonlatent.log"), diff --git a/master-protected-branches/buildbot.tac b/master-protected-branches/buildbot.tac index 2a3b12c3..d71c6215 100644 --- a/master-protected-branches/buildbot.tac +++ b/master-protected-branches/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-protected-branches.log"), diff --git a/master-web/buildbot.tac b/master-web/buildbot.tac index 7a765070..4a50d1a0 100644 --- a/master-web/buildbot.tac +++ b/master-web/buildbot.tac @@ -1,6 +1,7 @@ import os from twisted.application import service + from buildbot.master import BuildMaster basedir = "." @@ -22,8 +23,8 @@ if basedir == ".": # note: this line is matched against to check that this is a buildmaster # directory; do not edit it. application = service.Application("buildmaster") +from twisted.python.log import FileLogObserver, ILogObserver from twisted.python.logfile import LogFile -from twisted.python.log import ILogObserver, FileLogObserver logfile = LogFile.fromFullPath( os.path.join(log_basedir, "master-web.log"), diff --git a/schedulers_definition.py b/schedulers_definition.py index c0853972..7ca280ab 100644 --- a/schedulers_definition.py +++ b/schedulers_definition.py @@ -1,5 +1,4 @@ from buildbot.plugins import * - from utils import * diff --git a/utils.py b/utils.py index e6647e7d..cbb76f1a 100644 --- a/utils.py +++ b/utils.py @@ -1,18 +1,21 @@ +import fnmatch import os import re import sys -import fnmatch -from datetime import timedelta, datetime -from pyzabbix import ZabbixAPI +from datetime import datetime, timedelta + import docker +from pyzabbix import ZabbixAPI from twisted.internet import defer + from buildbot.plugins import * -from buildbot.process.properties import Property, Properties +from buildbot.process.properties import Properties, Property +from buildbot.process.remotecommand import RemoteCommand from buildbot.process.results import FAILURE -from buildbot.steps.shell import ShellCommand, Compile, Test, SetPropertyFromCommand from buildbot.steps.mtrlogobserver import MTR, MtrLogObserver +from buildbot.steps.shell import (Compile, SetPropertyFromCommand, + ShellCommand, Test) from buildbot.steps.source.github import GitHub -from buildbot.process.remotecommand import RemoteCommand from constants import * private_config = {"private": {}}