imports: sort imports everywhere in Spack (#24695)

* fix remaining flake8 errors

* imports: sort imports everywhere in Spack

We enabled import order checking in #23947, but fixing things manually drives
people crazy. This used `spack style --fix --all` from #24071 to automatically
sort everything in Spack so PR submitters won't have to deal with it.

This should go in after #24071, as it assumes we're using `isort`, not
`flake8-import-order` to order things. `isort` seems to be more flexible and
allows `llnl` mports to be in their own group before `spack` ones, so this
seems like a good switch.
This commit is contained in:
Todd Gamblin
2021-07-08 15:12:30 -07:00
committed by GitHub
parent 620836a809
commit 24c01d57cf
797 changed files with 2048 additions and 1442 deletions

View File

@@ -5,9 +5,9 @@
from __future__ import print_function
import re
import argparse
import errno
import re
import sys
from six import StringIO

View File

@@ -4,9 +4,9 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import collections
import errno
import hashlib
import glob
import grp
import hashlib
import itertools
import numbers
import os
@@ -19,10 +19,11 @@
from contextlib import contextmanager
import six
from llnl.util import tty
from llnl.util.lang import dedupe, memoized
from spack.util.executable import Executable
from spack.util.executable import Executable
if sys.version_info >= (3, 3):
from collections.abc import Sequence # novm

View File

@@ -5,14 +5,15 @@
from __future__ import division
import functools
import inspect
import multiprocessing
import os
import re
import functools
import inspect
from datetime import datetime, timedelta
from six import string_types
import sys
from datetime import datetime, timedelta
from six import string_types
if sys.version_info < (3, 0):
from itertools import izip_longest # novm

View File

@@ -7,12 +7,12 @@
from __future__ import print_function
import filecmp
import os
import shutil
import filecmp
from llnl.util.filesystem import traverse_tree, mkdirp, touch
import llnl.util.tty as tty
from llnl.util.filesystem import mkdirp, touch, traverse_tree
__all__ = ['LinkTree']

View File

@@ -3,16 +3,16 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import fcntl
import errno
import time
import fcntl
import os
import socket
import time
from datetime import datetime
import llnl.util.tty as tty
import spack.util.string
import spack.util.string
__all__ = ['Lock', 'LockTransaction', 'WriteTransaction', 'ReadTransaction',
'LockError', 'LockTimeoutError',

View File

@@ -12,12 +12,13 @@
import termios
import textwrap
import traceback
import six
from datetime import datetime
import six
from six import StringIO
from six.moves import input
from llnl.util.tty.color import cprint, cwrite, cescape, clen
from llnl.util.tty.color import cescape, clen, cprint, cwrite
# Globals
_debug = 0

View File

@@ -10,10 +10,11 @@
import os
import sys
from six import StringIO, text_type
from llnl.util.tty import terminal_size
from llnl.util.tty.color import clen, cextra
from llnl.util.tty.color import cextra, clen
class ColumnConfig:

View File

@@ -60,9 +60,9 @@
To output an @, use '@@'. To output a } inside braces, use '}}'.
"""
from __future__ import unicode_literals
import re
import sys
from contextlib import contextmanager
import six

View File

@@ -13,15 +13,14 @@
import os
import re
import select
import signal
import sys
import traceback
import signal
from contextlib import contextmanager
from six import string_types
from six import StringIO
from typing import Optional # novm
from types import ModuleType # novm
from typing import Optional # novm
from six import StringIO, string_types
import llnl.util.tty as tty

View File

@@ -14,10 +14,10 @@
"""
from __future__ import print_function
import os
import signal
import multiprocessing
import os
import re
import signal
import sys
import termios
import time