Merge pull request #838 from public/import-order-lint
Enable import order linter
diff --git a/dev-requirements.txt b/dev-requirements.txt
index 9dabba1..092b991 100644
--- a/dev-requirements.txt
+++ b/dev-requirements.txt
@@ -1,5 +1,6 @@
coverage
flake8
+flake8-import-order
invoke
iso8601
pep8-naming
@@ -7,8 +8,8 @@
pytest
requests
sphinx
-sphinxcontrib-spelling
sphinx_rtd_theme
+sphinxcontrib-spelling
tox
twine
-e .
diff --git a/setup.py b/setup.py
index c1a6d64..c841911 100644
--- a/setup.py
+++ b/setup.py
@@ -14,9 +14,9 @@
from __future__ import absolute_import, division, print_function
import os
+import subprocess
import sys
from distutils.command.build import build
-import subprocess
import pkg_resources
diff --git a/tests/hazmat/primitives/test_dsa.py b/tests/hazmat/primitives/test_dsa.py
index 2b5d4bb..bc3b1db 100644
--- a/tests/hazmat/primitives/test_dsa.py
+++ b/tests/hazmat/primitives/test_dsa.py
@@ -23,7 +23,7 @@
from cryptography.utils import bit_length
from ...utils import (
- load_vectors_from_file, load_fips_dsa_key_pair_vectors,
+ load_fips_dsa_key_pair_vectors, load_vectors_from_file,
raises_unsupported_algorithm
)
diff --git a/tests/hazmat/primitives/test_pbkdf2hmac.py b/tests/hazmat/primitives/test_pbkdf2hmac.py
index 62ca092..e928fc6 100644
--- a/tests/hazmat/primitives/test_pbkdf2hmac.py
+++ b/tests/hazmat/primitives/test_pbkdf2hmac.py
@@ -14,6 +14,7 @@
from __future__ import absolute_import, division, print_function
import pytest
+
import six
from cryptography import utils
diff --git a/tests/utils.py b/tests/utils.py
index c38ba7f..6356039 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -15,8 +15,8 @@
import binascii
import collections
-from contextlib import contextmanager
import re
+from contextlib import contextmanager
import pytest
diff --git a/tox.ini b/tox.ini
index 78b8b4c..da95995 100644
--- a/tox.ini
+++ b/tox.ini
@@ -17,8 +17,8 @@
deps =
pyenchant
sphinx
- sphinxcontrib-spelling
sphinx_rtd_theme
+ sphinxcontrib-spelling
basepython = python2.7
commands =
sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
@@ -42,6 +42,7 @@
[testenv:pep8]
deps =
flake8
+ flake8-import-order
pep8-naming
commands = flake8 .
@@ -49,9 +50,11 @@
basepython = python3.3
deps =
flake8
+ flake8-import-order
pep8-naming
commands = flake8 .
[flake8]
exclude = .tox,*.egg
-select = E,W,F,N
+select = E,W,F,N,I
+application-import-names = cryptography,cryptography_vectors,tests
diff --git a/vectors/cryptography_vectors/__init__.py b/vectors/cryptography_vectors/__init__.py
index 02d748d..25df6b3 100644
--- a/vectors/cryptography_vectors/__init__.py
+++ b/vectors/cryptography_vectors/__init__.py
@@ -16,8 +16,8 @@
import os
from cryptography_vectors.__about__ import (
- __title__, __summary__, __uri__, __version__, __author__, __email__,
- __license__, __copyright__
+ __author__, __copyright__, __email__, __license__, __summary__, __title__,
+ __uri__, __version__
)
diff --git a/vectors/setup.py b/vectors/setup.py
index ce01e13..66841de 100644
--- a/vectors/setup.py
+++ b/vectors/setup.py
@@ -15,7 +15,7 @@
import os
-from setuptools import setup, find_packages
+from setuptools import find_packages, setup
base_dir = os.path.dirname(__file__)