From 3eddcfccd848c0737efcbbcbf7ad2f307ecd7872 Mon Sep 17 00:00:00 2001 From: Haibo Lin Date: Thu, 6 Feb 2020 10:21:54 +0800 Subject: [PATCH] Fix flake8 complaints - F401 F401 'dnf' imported but unused F401 'imp' imported but unused F401 'os' imported but unused F401 'subprocess' imported but unused F401 'sys' imported but unused F401 'yum' imported but unused JIRA: COMPOSE-4108 Signed-off-by: Haibo Lin --- pungi/scripts/create_unified_isos.py | 2 -- pungi/scripts/patch_iso.py | 1 - tests/helpers.py | 1 - tests/test_arch.py | 3 --- tests/test_buildinstall.py | 1 - tests/test_checks.py | 1 - tests/test_compose.py | 1 - tests/test_comps_wrapper.py | 1 - tests/test_config.py | 2 -- tests/test_config_utils.py | 2 -- tests/test_config_validate_script.py | 2 -- tests/test_createiso_phase.py | 1 - tests/test_createiso_script.py | 1 - tests/test_createrepo_wrapper.py | 3 --- tests/test_createrepophase.py | 1 - tests/test_extra_files_phase.py | 1 - tests/test_extra_isos_phase.py | 1 - tests/test_fus_wrapper.py | 1 - tests/test_gather_method_deps.py | 2 -- tests/test_gather_method_hybrid.py | 1 - tests/test_gather_method_nodeps.py | 1 - tests/test_gather_phase.py | 1 - tests/test_gather_source_module.py | 2 -- tests/test_graph.py | 3 --- tests/test_imagebuildphase.py | 1 - tests/test_imagechecksumphase.py | 1 - tests/test_initphase.py | 1 - tests/test_koji_wrapper.py | 1 - tests/test_linker.py | 1 - tests/test_liveimagesphase.py | 3 --- tests/test_livemediaphase.py | 1 - tests/test_lorax_wrapper.py | 3 --- tests/test_media_split.py | 2 -- tests/test_metadata.py | 1 - tests/test_notifier.py | 2 -- tests/test_orchestrator.py | 1 - tests/test_osbs_phase.py | 1 - tests/test_ostree_installer_phase.py | 1 - tests/test_ostree_phase.py | 1 - tests/test_ostree_script.py | 1 - tests/test_ostree_utils.py | 1 - tests/test_patch_iso.py | 1 - tests/test_pathmatch.py | 2 -- tests/test_phase_base.py | 2 -- tests/test_pkgset_common.py | 1 - tests/test_pkgset_pkgsets.py | 1 - tests/test_pkgset_source_koji.py | 1 - tests/test_repoclosure_wrapper.py | 1 - tests/test_runroot.py | 1 - tests/test_scm.py | 1 - tests/test_test_phase.py | 5 ++--- tests/test_unified_isos.py | 1 - tests/test_util.py | 1 - tests/test_variant_wrapper.py | 2 -- 54 files changed, 2 insertions(+), 77 deletions(-) diff --git a/pungi/scripts/create_unified_isos.py b/pungi/scripts/create_unified_isos.py index 86a677e2..6dcf8186 100644 --- a/pungi/scripts/create_unified_isos.py +++ b/pungi/scripts/create_unified_isos.py @@ -7,8 +7,6 @@ repos. """ import argparse -import os -import sys from pungi_utils.unified_isos import UnifiedISO diff --git a/pungi/scripts/patch_iso.py b/pungi/scripts/patch_iso.py index e2bd14cb..40d7f858 100644 --- a/pungi/scripts/patch_iso.py +++ b/pungi/scripts/patch_iso.py @@ -14,7 +14,6 @@ import argparse import logging -import os import sys from pungi_utils import patch_iso diff --git a/tests/helpers.py b/tests/helpers.py index 662bbd14..8ea06ca4 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -2,7 +2,6 @@ import difflib import errno -import imp import os import shutil import tempfile diff --git a/tests/test_arch.py b/tests/test_arch.py index 9be23050..5112caea 100644 --- a/tests/test_arch.py +++ b/tests/test_arch.py @@ -3,9 +3,6 @@ import mock import unittest -import os -import sys - from pungi.arch import ( get_compatible_arches, get_valid_arches, diff --git a/tests/test_buildinstall.py b/tests/test_buildinstall.py index 9a6df8b9..f1c87896 100644 --- a/tests/test_buildinstall.py +++ b/tests/test_buildinstall.py @@ -5,7 +5,6 @@ import mock import six import os -import sys from pungi.phases.buildinstall import ( BuildinstallPhase, diff --git a/tests/test_checks.py b/tests/test_checks.py index ccac53ae..5b895d27 100644 --- a/tests/test_checks.py +++ b/tests/test_checks.py @@ -7,7 +7,6 @@ try: except ImportError: import unittest import os -import sys from six import StringIO import kobo.conf diff --git a/tests/test_compose.py b/tests/test_compose.py index 4419f6a0..ea20dd1e 100644 --- a/tests/test_compose.py +++ b/tests/test_compose.py @@ -9,7 +9,6 @@ except ImportError: import unittest import os import six -import sys import tempfile import shutil diff --git a/tests/test_comps_wrapper.py b/tests/test_comps_wrapper.py index 2692a242..47d323bf 100644 --- a/tests/test_comps_wrapper.py +++ b/tests/test_comps_wrapper.py @@ -7,7 +7,6 @@ except ImportError: import tempfile import os -import sys from pungi.wrappers.comps import CompsWrapper, CompsFilter, CompsValidationError from tests.helpers import BaseTestCase, FIXTURE_DIR diff --git a/tests/test_config.py b/tests/test_config.py index 6493c8f1..0aac0621 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -6,9 +6,7 @@ try: except ImportError: import unittest -import os import six -import sys import mock from pungi import checks diff --git a/tests/test_config_utils.py b/tests/test_config_utils.py index ea6a978a..571de650 100644 --- a/tests/test_config_utils.py +++ b/tests/test_config_utils.py @@ -5,8 +5,6 @@ try: except ImportError: import unittest import argparse -import os -import sys from parameterized import parameterized diff --git a/tests/test_config_validate_script.py b/tests/test_config_validate_script.py index 542f35b3..afafceaf 100644 --- a/tests/test_config_validate_script.py +++ b/tests/test_config_validate_script.py @@ -3,8 +3,6 @@ import mock import os -import subprocess -import sys import six from pungi.scripts.config_validate import cli_main diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 54838fe7..bf35beaf 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -5,7 +5,6 @@ import mock import six import os -import sys from tests import helpers from pungi.createiso import CreateIsoOpts diff --git a/tests/test_createiso_script.py b/tests/test_createiso_script.py index caad3229..45de02fe 100644 --- a/tests/test_createiso_script.py +++ b/tests/test_createiso_script.py @@ -3,7 +3,6 @@ import mock import os -import sys from six.moves import StringIO from tests import helpers diff --git a/tests/test_createrepo_wrapper.py b/tests/test_createrepo_wrapper.py index b9015b5a..9d968bb2 100644 --- a/tests/test_createrepo_wrapper.py +++ b/tests/test_createrepo_wrapper.py @@ -7,9 +7,6 @@ except ImportError: import six -import os -import sys - from pungi.wrappers.createrepo import CreaterepoWrapper diff --git a/tests/test_createrepophase.py b/tests/test_createrepophase.py index 355aaa2b..2c76689f 100644 --- a/tests/test_createrepophase.py +++ b/tests/test_createrepophase.py @@ -10,7 +10,6 @@ import mock import glob import os import six -import sys from pungi.phases.createrepo import ( CreaterepoPhase, diff --git a/tests/test_extra_files_phase.py b/tests/test_extra_files_phase.py index 21d67dab..a05dcc44 100644 --- a/tests/test_extra_files_phase.py +++ b/tests/test_extra_files_phase.py @@ -2,7 +2,6 @@ import mock import os -import sys from productmd.extra_files import ExtraFiles diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index ee3a62ba..f99c6535 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -5,7 +5,6 @@ import mock import six import os -import sys from tests import helpers from pungi.phases import extra_isos diff --git a/tests/test_fus_wrapper.py b/tests/test_fus_wrapper.py index d8bf9e43..2fccd44b 100644 --- a/tests/test_fus_wrapper.py +++ b/tests/test_fus_wrapper.py @@ -10,7 +10,6 @@ from textwrap import dedent import six import os -import sys from pungi.wrappers import fus diff --git a/tests/test_gather_method_deps.py b/tests/test_gather_method_deps.py index e6c1324e..b28c16f3 100644 --- a/tests/test_gather_method_deps.py +++ b/tests/test_gather_method_deps.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- import mock -import os -import sys from pungi.phases.gather.methods import method_deps as deps from tests import helpers diff --git a/tests/test_gather_method_hybrid.py b/tests/test_gather_method_hybrid.py index 34a8b913..80db2913 100644 --- a/tests/test_gather_method_hybrid.py +++ b/tests/test_gather_method_hybrid.py @@ -4,7 +4,6 @@ from collections import namedtuple import copy import mock import os -import sys import six diff --git a/tests/test_gather_method_nodeps.py b/tests/test_gather_method_nodeps.py index 94822791..b337fe96 100644 --- a/tests/test_gather_method_nodeps.py +++ b/tests/test_gather_method_nodeps.py @@ -2,7 +2,6 @@ import mock import os -import sys import six diff --git a/tests/test_gather_phase.py b/tests/test_gather_phase.py index c2e9cc52..fcdcc55b 100644 --- a/tests/test_gather_phase.py +++ b/tests/test_gather_phase.py @@ -3,7 +3,6 @@ import copy import mock import os -import sys try: import unittest2 as unittest diff --git a/tests/test_gather_source_module.py b/tests/test_gather_source_module.py index 201ca49c..7b87400a 100644 --- a/tests/test_gather_source_module.py +++ b/tests/test_gather_source_module.py @@ -7,8 +7,6 @@ except ImportError: import mock import six -import os -import sys from pungi.phases.gather.sources.source_module import GatherSourceModule from tests import helpers diff --git a/tests/test_graph.py b/tests/test_graph.py index ad8ebd3d..c5a5f496 100644 --- a/tests/test_graph.py +++ b/tests/test_graph.py @@ -5,9 +5,6 @@ try: except ImportError: import unittest -import os -import sys - from pungi.graph import SimpleAcyclicOrientedGraph diff --git a/tests/test_imagebuildphase.py b/tests/test_imagebuildphase.py index 9fba191e..c82e6bf3 100644 --- a/tests/test_imagebuildphase.py +++ b/tests/test_imagebuildphase.py @@ -5,7 +5,6 @@ import mock import six import os -import sys from pungi.phases.image_build import ImageBuildPhase, CreateImageBuildThread from tests.helpers import DummyCompose, PungiTestCase, boom diff --git a/tests/test_imagechecksumphase.py b/tests/test_imagechecksumphase.py index 2ec81d3d..b761f035 100644 --- a/tests/test_imagechecksumphase.py +++ b/tests/test_imagechecksumphase.py @@ -7,7 +7,6 @@ except ImportError: import mock import os -import sys import tempfile import shutil diff --git a/tests/test_initphase.py b/tests/test_initphase.py index e401d597..5f06a08e 100644 --- a/tests/test_initphase.py +++ b/tests/test_initphase.py @@ -10,7 +10,6 @@ import mock import six import os -import sys from pungi.module_util import Modulemd from pungi.phases import init diff --git a/tests/test_koji_wrapper.py b/tests/test_koji_wrapper.py index c566e21b..fd0889d3 100644 --- a/tests/test_koji_wrapper.py +++ b/tests/test_koji_wrapper.py @@ -10,7 +10,6 @@ except ImportError: import tempfile import os -import sys import six diff --git a/tests/test_linker.py b/tests/test_linker.py index 5d7ca1a4..e81ca2f2 100644 --- a/tests/test_linker.py +++ b/tests/test_linker.py @@ -5,7 +5,6 @@ import mock import errno import os import stat -import sys from pungi import linker from tests import helpers diff --git a/tests/test_liveimagesphase.py b/tests/test_liveimagesphase.py index 12252c2f..82965e4b 100644 --- a/tests/test_liveimagesphase.py +++ b/tests/test_liveimagesphase.py @@ -3,9 +3,6 @@ import mock -import os -import sys - import six from pungi.phases.live_images import LiveImagesPhase, CreateLiveImageThread diff --git a/tests/test_livemediaphase.py b/tests/test_livemediaphase.py index 9cdb4a6e..6f02fbcc 100644 --- a/tests/test_livemediaphase.py +++ b/tests/test_livemediaphase.py @@ -2,7 +2,6 @@ import mock -import sys import os import six diff --git a/tests/test_lorax_wrapper.py b/tests/test_lorax_wrapper.py index dd8acf5b..5eb4fb16 100644 --- a/tests/test_lorax_wrapper.py +++ b/tests/test_lorax_wrapper.py @@ -5,9 +5,6 @@ try: except ImportError: import unittest -import os -import sys - import six from pungi.wrappers.lorax import LoraxWrapper diff --git a/tests/test_media_split.py b/tests/test_media_split.py index 3cc3a403..f286f658 100644 --- a/tests/test_media_split.py +++ b/tests/test_media_split.py @@ -4,8 +4,6 @@ try: import unittest2 as unittest except ImportError: import unittest -import os -import sys import mock from pungi import media_split diff --git a/tests/test_metadata.py b/tests/test_metadata.py index b94fe778..a5fa10a2 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -1,6 +1,5 @@ import mock import os -import sys import six diff --git a/tests/test_notifier.py b/tests/test_notifier.py index 1ebfaed4..28c0fe55 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -3,8 +3,6 @@ from datetime import datetime import json import mock -import os -import sys try: import unittest2 as unittest diff --git a/tests/test_orchestrator.py b/tests/test_orchestrator.py index a92d9fde..b26fcc67 100644 --- a/tests/test_orchestrator.py +++ b/tests/test_orchestrator.py @@ -7,7 +7,6 @@ import operator import os import shutil import subprocess -import sys from textwrap import dedent import mock diff --git a/tests/test_osbs_phase.py b/tests/test_osbs_phase.py index 43d06430..18ef6f64 100644 --- a/tests/test_osbs_phase.py +++ b/tests/test_osbs_phase.py @@ -5,7 +5,6 @@ import json import copy import os -import sys from tests import helpers from pungi import checks diff --git a/tests/test_ostree_installer_phase.py b/tests/test_ostree_installer_phase.py index 7f870fe6..cf34970b 100644 --- a/tests/test_ostree_installer_phase.py +++ b/tests/test_ostree_installer_phase.py @@ -3,7 +3,6 @@ import mock import os -import sys from kobo.shortcuts import force_list diff --git a/tests/test_ostree_phase.py b/tests/test_ostree_phase.py index 3ec8dde1..a98d471a 100644 --- a/tests/test_ostree_phase.py +++ b/tests/test_ostree_phase.py @@ -5,7 +5,6 @@ import json import mock import os -import sys from tests import helpers from pungi.phases import ostree diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py index 9bdaae1b..484cb0a5 100644 --- a/tests/test_ostree_script.py +++ b/tests/test_ostree_script.py @@ -3,7 +3,6 @@ import json import os -import sys import mock import six diff --git a/tests/test_ostree_utils.py b/tests/test_ostree_utils.py index 087e22c4..76541017 100644 --- a/tests/test_ostree_utils.py +++ b/tests/test_ostree_utils.py @@ -3,7 +3,6 @@ import mock import os -import sys from tests import helpers from pungi.ostree import utils diff --git a/tests/test_patch_iso.py b/tests/test_patch_iso.py index ff266ca6..9bea141b 100644 --- a/tests/test_patch_iso.py +++ b/tests/test_patch_iso.py @@ -2,7 +2,6 @@ import mock import os -import sys try: import unittest2 as unittest diff --git a/tests/test_pathmatch.py b/tests/test_pathmatch.py index e8129f50..979a1520 100644 --- a/tests/test_pathmatch.py +++ b/tests/test_pathmatch.py @@ -2,8 +2,6 @@ import unittest -import os -import sys from pungi.pathmatch import PathMatch, head_tail_split diff --git a/tests/test_phase_base.py b/tests/test_phase_base.py index 1db7fe79..5a45df39 100644 --- a/tests/test_phase_base.py +++ b/tests/test_phase_base.py @@ -6,9 +6,7 @@ try: import unittest2 as unittest except ImportError: import unittest -import os import random -import sys import time from pungi.phases import weaver diff --git a/tests/test_pkgset_common.py b/tests/test_pkgset_common.py index 39c5c845..bb0b5d11 100755 --- a/tests/test_pkgset_common.py +++ b/tests/test_pkgset_common.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import os -import sys import mock import six diff --git a/tests/test_pkgset_pkgsets.py b/tests/test_pkgset_pkgsets.py index 94118331..b372a59d 100644 --- a/tests/test_pkgset_pkgsets.py +++ b/tests/test_pkgset_pkgsets.py @@ -3,7 +3,6 @@ import mock import os import six -import sys try: import unittest2 as unittest diff --git a/tests/test_pkgset_source_koji.py b/tests/test_pkgset_source_koji.py index bb6ae1cf..6d547024 100644 --- a/tests/test_pkgset_source_koji.py +++ b/tests/test_pkgset_source_koji.py @@ -5,7 +5,6 @@ import mock import os import re import six -import sys try: import unittest2 as unittest diff --git a/tests/test_repoclosure_wrapper.py b/tests/test_repoclosure_wrapper.py index 61207ae3..a7edefba 100755 --- a/tests/test_repoclosure_wrapper.py +++ b/tests/test_repoclosure_wrapper.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import os -import sys import six from pungi.wrappers import repoclosure as rc diff --git a/tests/test_runroot.py b/tests/test_runroot.py index aa23783c..2328904d 100644 --- a/tests/test_runroot.py +++ b/tests/test_runroot.py @@ -2,7 +2,6 @@ import mock import os -import sys from pungi.runroot import Runroot from tests import helpers diff --git a/tests/test_scm.py b/tests/test_scm.py index 1238b04d..b5d2bc71 100644 --- a/tests/test_scm.py +++ b/tests/test_scm.py @@ -10,7 +10,6 @@ import shutil import tempfile import os -import sys import six from pungi.wrappers import scm diff --git a/tests/test_test_phase.py b/tests/test_test_phase.py index 90738c04..481e8503 100644 --- a/tests/test_test_phase.py +++ b/tests/test_test_phase.py @@ -9,20 +9,19 @@ except ImportError: import mock import os import six -import sys import pungi.phases.test as test_phase from tests.helpers import DummyCompose, PungiTestCase, touch, mk_boom try: - import dnf + import dnf # noqa: F401 HAS_DNF = True except ImportError: HAS_DNF = False try: - import yum + import yum # noqa: F401 HAS_YUM = True except ImportError: diff --git a/tests/test_unified_isos.py b/tests/test_unified_isos.py index 30b510ed..634eb8bf 100755 --- a/tests/test_unified_isos.py +++ b/tests/test_unified_isos.py @@ -3,7 +3,6 @@ import mock import os import shutil -import sys import six from six.moves.configparser import SafeConfigParser diff --git a/tests/test_util.py b/tests/test_util.py index 00cbf931..15d442a4 100644 --- a/tests/test_util.py +++ b/tests/test_util.py @@ -3,7 +3,6 @@ import argparse import mock import os -import sys try: import unittest2 as unittest diff --git a/tests/test_variant_wrapper.py b/tests/test_variant_wrapper.py index 26041edc..83f2d251 100644 --- a/tests/test_variant_wrapper.py +++ b/tests/test_variant_wrapper.py @@ -4,8 +4,6 @@ try: import unittest2 as unittest except ImportError: import unittest -import os -import sys from six.moves import cStringIO from pungi.wrappers.variants import VariantsXmlParser