Our import sorting is now automated via isort [1] and checked in ci.
You may see an error like so:
Given:
$ git diff
diff --git a/src/python/pants/binary_util.py b/src/python/pants/binary_util.py
index ab5df55..590c1db 100644
--- a/src/python/pants/binary_util.py
+++ b/src/python/pants/binary_util.py
@@ -5,10 +5,10 @@
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
-import os
import posixpath
import subprocess
from contextlib import closing, contextmanager
+import os
from twitter.common import log
from twitter.common.collections import OrderedSet
A CI run will say:
$ ./build-support/bin/ci.sh
...
ERROR: /home/jsirois/dev/3rdparty/pants/src/python/pants/binary_util.py Imports are incorrectly sorted.
To fix import sort order, run `build-support/bin/isort.sh -f`
And you just follow the instructions and run`build-support/bin/isort.sh -f` to fix imports up.
So you may want to get in the habit or running the isort fix early and often before even posting RBs or pushing pull request CI branches.