From 905ced21f235922fea2314e87ec2309a7eb62180 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: Sep 09 2019 12:21:32 +0000 Subject: Sorting imports Code quality minor improvement Signed-off-by: Ondrej Nosek --- diff --git a/bin/rpkg b/bin/rpkg index 68adf19..363a011 100755 --- a/bin/rpkg +++ b/bin/rpkg @@ -10,14 +10,16 @@ # option) any later version. See http://www.gnu.org/copyleft/gpl.html for # the full text of the license. -import pyrpkg -import pyrpkg.cli -import pyrpkg.utils +import argparse +import logging import os import sys -import logging + from six.moves import configparser -import argparse + +import pyrpkg +import pyrpkg.cli +import pyrpkg.utils # Setup an argparser and parse the known commands to get the config file parser = argparse.ArgumentParser(add_help=False) diff --git a/doc/source/conf.py b/doc/source/conf.py index 1d8ed25..f092170 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -18,6 +18,7 @@ # import os import sys + sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('.')) diff --git a/pyrpkg/cli.py b/pyrpkg/cli.py index 73fff43..eaaa93b 100644 --- a/pyrpkg/cli.py +++ b/pyrpkg/cli.py @@ -20,13 +20,13 @@ import logging import os import random import re -import rpm import string import sys import time from gettext import gettext as _ # For `_ArgumentParser' import requests +import rpm import six from requests.auth import HTTPBasicAuth from six.moves import configparser diff --git a/tests/commands/test_check_repo.py b/tests/commands/test_check_repo.py index e0018f1..b782ea6 100644 --- a/tests/commands/test_check_repo.py +++ b/tests/commands/test_check_repo.py @@ -5,9 +5,9 @@ import subprocess import sys import tempfile +from mock import patch from six.moves import StringIO -from mock import patch from pyrpkg.errors import rpkgError from . import CommandTestCase diff --git a/tests/commands/test_clone.py b/tests/commands/test_clone.py index 9376181..c530689 100644 --- a/tests/commands/test_clone.py +++ b/tests/commands/test_clone.py @@ -3,6 +3,7 @@ import shutil import tempfile import git + import pyrpkg from . import CommandTestCase diff --git a/tests/test_cli.py b/tests/test_cli.py index c6b2f7a..70cb1df 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -11,14 +11,14 @@ import subprocess import sys import tempfile +import git import six +from mock import ANY, Mock, PropertyMock, call, mock_open, patch from six.moves import StringIO, configparser, http_client -import git import koji_cli.lib import pyrpkg.cli import utils -from mock import ANY, Mock, PropertyMock, call, mock_open, patch from pyrpkg import Commands, Modulemd, rpkgError from utils import CommandTestCase, FakeThreadPool diff --git a/tests/test_commands.py b/tests/test_commands.py index 53509b2..40e64ce 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -8,11 +8,11 @@ import subprocess import tempfile from datetime import datetime +import git import rpm import six - -import git from mock import Mock, PropertyMock, call, mock_open, patch + from pyrpkg import rpkgError from utils import CommandTestCase diff --git a/tests/test_flatpak_build.py b/tests/test_flatpak_build.py index 28d37f6..a8a0109 100644 --- a/tests/test_flatpak_build.py +++ b/tests/test_flatpak_build.py @@ -3,8 +3,8 @@ import subprocess from textwrap import dedent import requests - from mock import Mock, patch + from pyrpkg import Modulemd from utils import CommandTestCase diff --git a/tests/test_lookaside.py b/tests/test_lookaside.py index 07d5bb2..413d8f6 100644 --- a/tests/test_lookaside.py +++ b/tests/test_lookaside.py @@ -14,6 +14,7 @@ import tempfile import unittest import mock + import pycurl from pyrpkg.errors import DownloadError, InvalidHashType, UploadError from pyrpkg.lookaside import CGILookasideCache diff --git a/tests/test_module_build.py b/tests/test_module_build.py index 8e6b5d1..266ba81 100644 --- a/tests/test_module_build.py +++ b/tests/test_module_build.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- import copy -import six import sys -from mock import patch, PropertyMock +import six +from mock import PropertyMock, patch + from utils import CommandTestCase diff --git a/tests/test_retire.py b/tests/test_retire.py index 3f3a0b2..4bfe96e 100644 --- a/tests/test_retire.py +++ b/tests/test_retire.py @@ -2,11 +2,12 @@ import os import shutil -import mock -import tempfile import subprocess +import tempfile +import mock from six.moves import configparser + import pyrpkg.cli from pyrpkg.errors import rpkgError diff --git a/tests/test_side_tag.py b/tests/test_side_tag.py index c654cde..e4dbe3a 100644 --- a/tests/test_side_tag.py +++ b/tests/test_side_tag.py @@ -3,13 +3,12 @@ import logging import os -import koji import mock import six from six.moves import StringIO, configparser +import koji import pyrpkg.cli - from utils import CommandTestCase if six.PY2: diff --git a/tests/test_utils.py b/tests/test_utils.py index 78ca55a..2f9d2cc 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2,6 +2,7 @@ import unittest import warnings import mock + from pyrpkg.utils import cached_property, log_result, warn_deprecated