Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

Fix the ordering of imports #143

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ include_package_data = True
# NOTE(mhayden): pycodestyle 2.4.0 has a bug that causes flake8 to fail.
# Remove the pycodestyle constraint once upstream is fixed.
install_requires = flake8
flake8-import-order
junit_xml
mock
pycodestyle!=2.4.0
Expand Down
5 changes: 3 additions & 2 deletions skt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,20 @@
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

from email.errors import HeaderParseError
import email.header
import email.parser
import io
import logging
import multiprocessing
import os
import re
import shutil
import subprocess
import sys
import io
import time
from email.errors import HeaderParseError
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving this introduces pylint error C: 26, 0: Imports from package email are not grouped (ungrouped-imports).

from threading import Timer

import requests


Expand Down
9 changes: 5 additions & 4 deletions skt/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@
# along with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from __future__ import print_function
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText

import StringIO
import gzip
import logging
import os
import re
import smtplib
import StringIO
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 doesn't say anything about the actual order in the groupings, but lexical order is usually used because of readability and orientation reasons. This breaks the lexical order while actually not fixing anything and making the orientation around imports more confusing?


import requests

Expand Down
9 changes: 6 additions & 3 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@
# this program; if not, write to the Free Software Foundation, Inc., 51
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
from __future__ import division
import unittest
import tempfile
import shutil

import os
import shutil
import subprocess
import tempfile
import unittest

import mock
from mock import Mock

from requests.exceptions import RequestException

import skt
Expand Down
1 change: 0 additions & 1 deletion tests/test_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
import re
import unittest

from contextlib import contextmanager

import mock
Expand Down
2 changes: 1 addition & 1 deletion tests/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import os
import tempfile
import unittest

import xml.etree.ElementTree as etree

import mock

from skt import runner
Expand Down