Skip to content

Commit

Permalink
Merge pull request #214 from mcpeak/fix-flake8-import-order
Browse files Browse the repository at this point in the history
Fix flake8 import orders
  • Loading branch information
Patrick Kelley committed Mar 22, 2019
2 parents 5f8f910 + 3586282 commit ea37f65
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 33 deletions.
2 changes: 2 additions & 0 deletions .flake8
@@ -0,0 +1,2 @@
[flake8]
import-order-style = google
3 changes: 1 addition & 2 deletions repokid/cli/dispatcher_cli.py
Expand Up @@ -3,8 +3,7 @@
import json

from cloudaux.aws.sts import sts_conn
from marshmallow import Schema, fields, post_load

from marshmallow import fields, post_load, Schema
from repokid import CONFIG
import repokid.dispatcher
import repokid.utils.dynamo as dynamo
Expand Down
17 changes: 8 additions & 9 deletions repokid/cli/repokid_cli.py
Expand Up @@ -40,7 +40,6 @@
import json
import pprint
import re
import requests
import sys
import time

Expand All @@ -50,19 +49,19 @@
from cloudaux.aws.sts import sts_conn
from docopt import docopt
import import_string
from tabulate import tabulate
import tabview as t
from tqdm import tqdm

from repokid import LOGGER
from repokid import CONFIG
from repokid import _get_hooks
from repokid import __version__ as __version__
from repokid.role import Role, Roles
from repokid import _get_hooks
from repokid import CONFIG
from repokid import LOGGER
import repokid.hooks
from repokid.role import Role, Roles
from repokid.utils.dynamo import (dynamo_get_or_create_table, find_role_in_cache, get_role_data, role_ids_for_account,
role_ids_for_all_accounts, set_role_data)
import repokid.utils.roledata as roledata
import requests
from tabulate import tabulate
import tabview as t
from tqdm import tqdm


# http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html
Expand Down
2 changes: 1 addition & 1 deletion repokid/dispatcher/__init__.py
Expand Up @@ -2,8 +2,8 @@
import datetime
import time

from repokid import CONFIG
from repokid import _get_hooks
from repokid import CONFIG
import repokid.cli.repokid_cli as cli
import repokid.utils.dynamo as dynamo
import repokid.utils.roledata as roledata
Expand Down
4 changes: 2 additions & 2 deletions repokid/filters/age/__init__.py
@@ -1,8 +1,8 @@
import datetime
from dateutil.tz import tzlocal

from repokid.cli.repokid_cli import Filter
from dateutil.tz import tzlocal
from repokid import LOGGER
from repokid.cli.repokid_cli import Filter


class AgeFilter(Filter):
Expand Down
3 changes: 1 addition & 2 deletions repokid/filters/blacklist/__init__.py
Expand Up @@ -3,9 +3,8 @@

import botocore
from cloudaux.aws.sts import boto3_cached_conn

from repokid.cli.repokid_cli import Filter
from repokid import LOGGER
from repokid.cli.repokid_cli import Filter


def get_blacklist_from_bucket(bucket_config):
Expand Down
4 changes: 2 additions & 2 deletions repokid/tests/test_dispatcher_cli.py
@@ -1,9 +1,9 @@
import copy
import datetime
from mock import call, patch

import repokid.dispatcher as dispatcher
from mock import call, patch
import repokid.cli.dispatcher_cli as dispatcher_cli
import repokid.dispatcher as dispatcher


DYNAMO_TABLE = None
Expand Down
3 changes: 1 addition & 2 deletions repokid/tests/test_hooks.py
@@ -1,7 +1,6 @@
import pytest

import repokid.hooks
import repokid.cli.repokid_cli
import repokid.hooks
from repokid.tests.artifacts.hook import function_1, function_2


Expand Down
3 changes: 1 addition & 2 deletions repokid/tests/test_repokid_cli.py
Expand Up @@ -14,10 +14,9 @@
import datetime
import logging
import time
from mock import call, patch

from dateutil.tz import tzlocal

from mock import call, patch
import repokid.cli.repokid_cli
from repokid.role import Role, Roles
import repokid.utils.roledata
Expand Down
3 changes: 1 addition & 2 deletions repokid/tests/test_roledata.py
Expand Up @@ -14,10 +14,9 @@
import time

from mock import patch

import repokid.utils.roledata
from repokid.role import Role
from repokid.tests.test_repokid_cli import ROLE_POLICIES, ROLES
import repokid.utils.roledata


AARDVARK_DATA = {
Expand Down
1 change: 0 additions & 1 deletion repokid/utils/dynamo.py
Expand Up @@ -5,7 +5,6 @@
import boto3
from botocore.exceptions import ClientError as BotoClientError
from cloudaux.aws.sts import boto3_cached_conn as boto3_cached_conn

from repokid import LOGGER as LOGGER

# used as a placeholder for empty SID to work around this: https://github.com/aws/aws-sdk-js/issues/833
Expand Down
10 changes: 5 additions & 5 deletions repokid/utils/roledata.py
Expand Up @@ -14,17 +14,17 @@
from collections import defaultdict
import copy
import datetime
from dateutil.tz import tzlocal
import time

from policyuniverse import expand_policy, get_actions_from_statement, all_permissions

from repokid.utils.dynamo import (add_to_end_of_list, get_role_data, role_ids_for_account, set_role_data,
store_initial_role_data)
from dateutil.tz import tzlocal
from policyuniverse import all_permissions, expand_policy, get_actions_from_statement
from repokid import CONFIG as CONFIG
from repokid import LOGGER as LOGGER
import repokid.hooks
from repokid.role import Role
from repokid.utils.dynamo import (add_to_end_of_list, get_role_data, role_ids_for_account, set_role_data,
store_initial_role_data)

BEGINNING_OF_2015_MILLI_EPOCH = 1420113600000
IAM_ACCESS_ADVISOR_UNSUPPORTED_SERVICES = frozenset([''])
Expand Down Expand Up @@ -371,7 +371,7 @@ def _get_epoch_authenticated(service_authenticated):

# we have an odd timestamp, try to check
elif BEGINNING_OF_2015_MILLI_EPOCH < service_authenticated < (current_time * 1000):
return (service_authenticated/1000, True)
return (service_authenticated / 1000, True)

elif (BEGINNING_OF_2015_MILLI_EPOCH / 1000) < service_authenticated < current_time:
return (service_authenticated, True)
Expand Down
6 changes: 4 additions & 2 deletions setup.py
Expand Up @@ -11,9 +11,11 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import re

import ast
from setuptools import setup, find_packages
import re

from setuptools import find_packages, setup

with open('requirements.txt') as f:
REQUIRED = f.read().splitlines()
Expand Down
3 changes: 2 additions & 1 deletion test-requirements.txt
@@ -1,4 +1,5 @@
flake8
flake8==3.5.0
flake8-import-order==0.18.1
python-dateutil==2.6.0
mock==2.0.0
pytest==3.2.3

0 comments on commit ea37f65

Please sign in to comment.