Target F401 - Unused imports

This commit is contained in:
Stephan Kulow
2022-02-18 18:29:27 +01:00
parent f86579642b
commit aaab4af930
49 changed files with 5 additions and 95 deletions

View File

@@ -1,4 +1,4 @@
[flake8]
exclude = abichecker
max-line-length = 140
ignore = W503,W504,F401
ignore = W503,W504

View File

@@ -138,7 +138,6 @@ class ReviewBot(object):
if e.code != 404:
self.logger.error('ERROR in URL %s [%s]' % (url, e))
raise
pass
return False
def staging_api(self, project):

View File

@@ -122,7 +122,6 @@ def main(args):
json_data.close()
except FileNotFoundError:
RemindedLoaded = {}
pass
seconds_to_remember = 7 * 86400
now = int(time.time())

View File

@@ -1,7 +1,6 @@
#!/usr/bin/python3
import sys
from lxml import etree as ET
import osc.conf
import osc.core
from urllib.error import HTTPError, URLError

View File

@@ -4,7 +4,6 @@
from __future__ import print_function
import sys
import os
import re
import solv

View File

@@ -5,7 +5,6 @@ import logging
import osc
import yaml
from osc.core import http_GET, makeurl, show_project_meta
from M2Crypto.SSL import SSLError as SSLError
from osclib.core import attribute_value_load
from lxml import etree as ET
from openqa_client.client import OpenQA_Client

View File

@@ -1,16 +1,13 @@
#!/usr/bin/python3
from pprint import pprint
import os
import sys
import re
import logging
import cmdln
from fnmatch import fnmatch
from configparser import SafeConfigParser
import solv
import rpm
logger = None

View File

@@ -2,7 +2,6 @@
import argparse
from datetime import datetime
import dateutil.parser
import sys
from lxml import etree as ET

View File

@@ -5,14 +5,11 @@ import re
from urllib.parse import urlparse, urljoin
import smtplib
from email.mime.text import MIMEText
import os
import sys
import email.utils
import argparse
import logging
import yaml
from xdg.BaseDirectory import save_data_path
from collections import namedtuple
logger = logging.getLogger()

View File

@@ -6,7 +6,6 @@ from flask import make_response
import re
import os
import sys
from urllib.parse import urlparse
digits_re = re.compile('^[0-9.]+$')

View File

@@ -7,7 +7,7 @@ import subprocess
from os.path import basename
import glob
from openqa_client.client import OpenQA_Client
from openqa_client.exceptions import ConnectionError, RequestError
from openqa_client.exceptions import RequestError
def old_filename(state):

View File

@@ -3,20 +3,15 @@
import argparse
import logging
import pika
import sys
import json
import osc
import re
from time import sleep
from osc.core import http_GET, http_POST, makeurl
from M2Crypto.SSL import SSLError as SSLError
from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from lxml import etree as ET
from openqa_client.client import OpenQA_Client
from openqa_client.exceptions import ConnectionError, RequestError
from urllib.error import HTTPError, URLError
from urllib.error import HTTPError
from urllib.parse import quote_plus
import requests

View File

@@ -1,12 +1,9 @@
#!/usr/bin/python3
import argparse
import datetime
import glob
import json
import logging
import os.path
import time
import subprocess
import osc

View File

@@ -7,8 +7,6 @@ import os.path
import sys
import re
import logging
from optparse import OptionParser
import cmdln
from dateutil.parser import parse
from datetime import timezone, timedelta
import requests as REQ
@@ -24,8 +22,6 @@ import osc.core
from osclib.cache_manager import CacheManager
import ReviewBot
from osclib.comments import CommentAPI
http_GET = osc.core.http_GET

View File

@@ -410,7 +410,6 @@ def dashboard_at(api, filename, datetime=None, revision=None):
if content:
# TODO re-use from osclib.conf.
from configparser import ConfigParser
import io
cp = ConfigParser()
config = '[remote]\n' + content

View File

@@ -1,7 +1,6 @@
import os
import os.path
import subprocess
import sys
import tempfile
import warnings
import yaml

View File

@@ -1,5 +1,3 @@
import json
from lxml import etree as ET
class CheckCommand(object):

View File

@@ -3,7 +3,6 @@ from __future__ import print_function
from osc import OscConfigParser
from collections import OrderedDict
import os
import operator
import re
from osc import conf

View File

@@ -87,7 +87,6 @@ class FreezeCommand(object):
for f in pkgmeta.find('build'):
if f.get('repository', None) == 'bootstrap_copy':
f.tag = state
pass
self.api.retried_PUT(url, ET.tostring(pkgmeta))
def verify_bootstrap_copy_codes(self, codes):

View File

@@ -1,4 +1,3 @@
from osc.core import get_request
from osclib.comments import CommentAPI
from osclib.request_finder import RequestFinder

View File

@@ -1,7 +1,6 @@
from __future__ import print_function
from colorama import Fore
from osc import oscerr
from osclib.request_splitter import RequestSplitter
from osclib.supersede_command import SupersedeCommand

View File

@@ -1,7 +1,6 @@
from copy import deepcopy
from collections import namedtuple
import logging
from osc.core import get_request_list
from osclib.conf import Config
from osclib.conf import str2bool
from osclib.core import attribute_value_load

View File

@@ -1,7 +1,5 @@
import json
import osc
from lxml import etree as ET
from urllib.error import HTTPError

View File

@@ -1,8 +1,5 @@
from colorama import Fore
from osc.core import get_request
from osclib.comments import CommentAPI
class RebuildCommand(object):
KEY_COLOR = {

View File

@@ -1,4 +1,3 @@
import re
from urllib.error import HTTPError
from osc import oscerr
from osc.core import change_review_state

View File

@@ -1,7 +1,6 @@
from io import StringIO
from datetime import datetime
import dateutil.parser
import json
import logging
import textwrap
from urllib.error import HTTPError, URLError
@@ -10,7 +9,6 @@ import time
import re
from lxml import etree as ET
import yaml
from osc import conf
from osc import oscerr
@@ -19,7 +17,6 @@ from osclib.core import attribute_value_save
from osc.core import show_package_meta
from osc.core import buildlog_strip_time
from osc.core import change_review_state
from osc.core import delete_package
from osc.core import delete_project
from osc.core import get_commitlog
from osc.core import get_group
@@ -40,7 +37,6 @@ from osc.util.helper import decode_it
from osclib.cache import Cache
from osclib.core import devel_project_get
from osclib.core import entity_exists
from osclib.core import project_list_prefix
from osclib.core import project_pseudometa_file_load
from osclib.core import project_pseudometa_file_save
from osclib.core import project_pseudometa_file_ensure
@@ -1519,4 +1515,3 @@ class StagingAPI(object):
delete_project(self.apiurl, project, force=True)
except HTTPError as e:
print(e)
pass

View File

@@ -7,7 +7,6 @@ import solv
import shutil
import subprocess
import yaml
import sys
import tempfile
from lxml import etree as ET
@@ -15,7 +14,6 @@ from lxml import etree as ET
from osc.core import checkout_package
from osc.core import http_GET
from osc.core import HTTPError
from osc.core import show_results_meta
from osc.core import Package
from osc.core import undelete_package

View File

@@ -9,15 +9,12 @@ import re
import random
import string
import subprocess
import sys
import shutil
import tempfile
from lxml import etree as ET
from osc import conf
import osc.core
from urllib.error import HTTPError
from osclib.cache_manager import CacheManager
import requests

View File

@@ -6,7 +6,6 @@ import hashlib
import logging
import os
import os.path
import re
import subprocess
import sys
import tempfile
@@ -20,8 +19,7 @@ from osc.core import http_request
import ToolBase
from osclib.conf import Config
from osclib.core import (http_GET, http_POST, makeurl,
project_pseudometa_file_ensure,
from osclib.core import (http_GET, makeurl,
repository_path_expand, repository_path_search,
target_archs, source_file_load, source_file_ensure)
from osclib.repochecks import mirror, parsed_installcheck, CorruptRepos

View File

@@ -4,17 +4,14 @@ import argparse
import logging
import sys
from urllib.error import HTTPError
import re
from lxml import etree as ET
from collections import namedtuple
import osc.conf
import osc.core
from osc.core import http_GET
from osc.core import makeurl
from osc import oscerr
import osclib
from osclib.core import source_file_ensure
from osclib.conf import Config

View File

@@ -3,12 +3,10 @@
import argparse
from datetime import datetime, timedelta
from collections import defaultdict
import json
from osclib.comments import CommentAPI
from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from lxml import etree as ET
import osc
MARGIN_HOURS = 4

View File

@@ -27,7 +27,7 @@ from osclib.core import request_state_change
from osclib.core import create_delete_request
from osclib.memoize import memoize_session_reset
from urllib.error import HTTPError, URLError
from urllib.error import HTTPError
from abc import ABC, abstractmethod
import re
@@ -330,12 +330,10 @@ class StagingWorkflow(ABC):
@abstractmethod
def initial_config(self):
"""Values to use to initialize the 'Config' attribute at :func:`setup_remote_config`"""
pass
@abstractmethod
def staging_group_name(self):
"""Name of the group in charge of the staging workflow"""
pass
def load_config(self, project=None):
"""Loads the corresponding :class:`osclib.Config` object into the attribute ``config``

View File

@@ -2,9 +2,7 @@ import unittest
from osclib.accept_command import AcceptCommand
from osclib.select_command import SelectCommand
from osclib.conf import Config
from osclib.comments import CommentAPI
from osclib.stagingapi import StagingAPI
from osclib.core import package_list
from mock import MagicMock

View File

@@ -1,12 +1,6 @@
import sys
import unittest
import re
import osc.core
from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from lxml import etree as ET
from mock import MagicMock
from . import OBSLocal

View File

@@ -1,4 +1,3 @@
import unittest
from . import OBSLocal

View File

@@ -3,7 +3,6 @@ from . import OBSLocal
from check_source import CheckSource
import random
import os
from osclib.core import request_action_list
from osc.core import get_request_list
PROJECT = 'openSUSE:Factory'

View File

@@ -1,9 +1,6 @@
import unittest
import json
from osclib.conf import Config
from osclib.check_command import CheckCommand
from osclib.stagingapi import StagingAPI
from lxml import etree
from mock import MagicMock

View File

@@ -11,7 +11,6 @@ from . import OBSLocal
from urllib.parse import urlparse, parse_qs
import sys
import re
from osclib.cache import Cache
from check_tags_in_requests import TagChecker

View File

@@ -154,7 +154,6 @@ class TestCommentOBS(OBSLocal.TestCase):
for user in users:
self.osc_user(user)
print('logged in as ', user)
from osc import conf
bot = '::'.join([self.bot, user])
comment = self.api.add_marker(COMMENT, bot)

View File

@@ -4,7 +4,6 @@ from osclib.conf import DEFAULT
from osclib.conf import Config
from osclib.core import attribute_value_save
from osclib.memoize import memoize_session_reset
from osclib.stagingapi import StagingAPI
from . import OBSLocal

View File

@@ -1,5 +1,4 @@
from . import OBSLocal
import unittest
class TestDevelProject(OBSLocal.TestCase):

View File

@@ -2,8 +2,6 @@ import os
import unittest
import logging
import httpretty
import osc
import re
from osclib.cache import Cache
from . import OBSLocal

View File

@@ -1,5 +1,4 @@
from . import OBSLocal
import random
import os
# Needed to mock LegalAuto

View File

@@ -1,12 +1,9 @@
import os
import unittest
import difflib
import subprocess
import tempfile
from osclib.conf import Config
from osclib.freeze_command import FreezeCommand
from osclib.stagingapi import StagingAPI
from . import OBSLocal

View File

@@ -1,5 +1,4 @@
from . import OBSLocal
import unittest
class TestMetrics(OBSLocal.TestCase):

View File

@@ -1,6 +1,5 @@
from datetime import datetime
import unittest
from osclib.conf import Config
from osclib.obslock import OBSLock
from . import OBSLocal

View File

@@ -1,6 +1,4 @@
import logging
from . import OBSLocal
import random
import os
# Needed to configure OriginManager

View File

@@ -1,6 +1,3 @@
import unittest
from osclib.conf import Config
from osclib.stagingapi import StagingAPI
from osclib.unselect_command import UnselectCommand
from . import OBSLocal

View File

@@ -1,7 +1,6 @@
from osclib.util import project_list_family
from osclib.util import project_list_family_prior
from osclib.util import project_list_family_sorter
from osclib.util import project_list_prefix
from osclib import util
import unittest