Remove from __future__ imports (#38703)

This commit is contained in:
Adam J. Stewart 2023-07-04 01:30:29 -05:00 committed by GitHub
parent 65288566e5
commit 33c5959e23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
62 changed files with 1 additions and 127 deletions

View file

@ -25,8 +25,6 @@ exit 1
# Line above is a shell no-op, and ends a python multi-line comment. # Line above is a shell no-op, and ends a python multi-line comment.
# The code above runs this file with our preferred python interpreter. # The code above runs this file with our preferred python interpreter.
from __future__ import print_function
import os import os
import os.path import os.path
import sys import sys

View file

@ -65,9 +65,6 @@
up to date with CTest, just make sure the ``*_matches`` and up to date with CTest, just make sure the ``*_matches`` and
``*_exceptions`` lists are kept up to date with CTest's build handler. ``*_exceptions`` lists are kept up to date with CTest's build handler.
""" """
from __future__ import print_function
from __future__ import division
import re import re
import math import math
import multiprocessing import multiprocessing

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import errno import errno
import io import io

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import division
import collections.abc import collections.abc
import contextlib import contextlib
import functools import functools

View file

@ -5,8 +5,6 @@
"""LinkTree class for setting up trees of symbolic links.""" """LinkTree class for setting up trees of symbolic links."""
from __future__ import print_function
import filecmp import filecmp
import os import os
import shutil import shutil

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import unicode_literals
import contextlib import contextlib
import io import io
import os import os

View file

@ -6,8 +6,6 @@
""" """
Routines for printing columnar output. See ``colify()`` for more information. Routines for printing columnar output. See ``colify()`` for more information.
""" """
from __future__ import division, unicode_literals
import io import io
import os import os
import sys import sys

View file

@ -59,8 +59,6 @@
To output an @, use '@@'. To output a } inside braces, use '}}'. To output an @, use '@@'. To output a } inside braces, use '}}'.
""" """
from __future__ import unicode_literals
import re import re
import sys import sys
from contextlib import contextmanager from contextlib import contextmanager

View file

@ -5,8 +5,6 @@
"""Utility classes for logging the output of blocks of code. """Utility classes for logging the output of blocks of code.
""" """
from __future__ import unicode_literals
import atexit import atexit
import ctypes import ctypes
import errno import errno

View file

@ -13,8 +13,6 @@
Note: The functionality in this module is unsupported on Windows Note: The functionality in this module is unsupported on Windows
""" """
from __future__ import print_function
import multiprocessing import multiprocessing
import os import os
import re import re

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import os import os
import re import re

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import collections import collections
import archspec.cpu import archspec.cpu

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os.path import os.path
import shutil import shutil
import tempfile import tempfile

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import copy import copy
import os import os

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import os import os

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import sys import sys

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import collections import collections
import os import os
import shutil import shutil

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import re import re
import urllib.parse import urllib.parse

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import platform import platform
import re import re

View file

@ -13,8 +13,6 @@
It is up to the user to ensure binary compatibility between the deprecated It is up to the user to ensure binary compatibility between the deprecated
installation and its deprecator. installation and its deprecator.
""" """
from __future__ import print_function
import argparse import argparse
import os import os

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import errno import errno
import os import os

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import copy import copy
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import textwrap import textwrap
from itertools import zip_longest from itertools import zip_longest

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import re import re
from collections import defaultdict from collections import defaultdict

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import division, print_function
import argparse import argparse
import fnmatch import fnmatch
import json import json

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import llnl.util.tty as tty import llnl.util.tty as tty

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
from collections import defaultdict from collections import defaultdict

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import sys import sys
from llnl.util import tty from llnl.util import tty

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import itertools import itertools
import os import os

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import code import code
import os import os

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import llnl.util.tty as tty import llnl.util.tty as tty

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import re import re
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import sys import sys
import llnl.util.lang as lang import llnl.util.lang as lang

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import fnmatch import fnmatch
import os import os

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os.path import os.path
import shutil import shutil

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import sys import sys
from typing import Dict, List, Optional from typing import Dict, List, Optional

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import division, print_function
import argparse import argparse
import collections import collections
import io import io

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import division, print_function
import urllib.parse import urllib.parse
from collections import defaultdict from collections import defaultdict

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import argparse import argparse
import llnl.util.tty as tty import llnl.util.tty as tty

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import sys import sys
import llnl.util.tty as tty import llnl.util.tty as tty

View file

@ -14,8 +14,6 @@
TODO: make this customizable and allow users to configure TODO: make this customizable and allow users to configure
concretization policies. concretization policies.
""" """
from __future__ import print_function
import functools import functools
import platform import platform
import tempfile import tempfile

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import inspect import inspect
import sys import sys

View file

@ -8,8 +8,6 @@
In a normal Spack installation, this is invoked from the bin/spack script In a normal Spack installation, this is invoked from the bin/spack script
after the system path is set up. after the system path is set up.
""" """
from __future__ import print_function
import argparse import argparse
import inspect import inspect
import io import io

View file

@ -7,8 +7,6 @@
include Tcl non-hierarchical modules, Lua hierarchical modules, and others. include Tcl non-hierarchical modules, Lua hierarchical modules, and others.
""" """
from __future__ import absolute_import
from .common import disable_modules, ensure_modules_are_enabled_or_warn from .common import disable_modules, ensure_modules_are_enabled_or_warn
from .lmod import LmodModulefileWriter from .lmod import LmodModulefileWriter
from .tcl import TclModulefileWriter from .tcl import TclModulefileWriter

View file

@ -105,7 +105,7 @@ class RepoLoader(_PrependFileLoader):
#: Spack packages are expected to call `from spack.package import *` #: Spack packages are expected to call `from spack.package import *`
#: themselves, but we are allowing a deprecation period before breaking #: themselves, but we are allowing a deprecation period before breaking
#: external repos that don't do this yet. #: external repos that don't do this yet.
_package_prepend = "from __future__ import absolute_import;" "from spack.package import *" _package_prepend = "from spack.package import *"
def __init__(self, fullname, repo, package_name): def __init__(self, fullname, repo, package_name):
self.repo = repo self.repo = repo

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import division, print_function
import collections import collections
import collections.abc import collections.abc
import copy import copy

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import errno import errno
import getpass import getpass
import glob import glob

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import os import os
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import re import re
import pytest import pytest

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import re import re
import shutil import shutil
import sys import sys

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import contextlib import contextlib
import multiprocessing import multiprocessing
import os import os

View file

@ -8,8 +8,6 @@
The YAML and JSON formats preserve DAG information in the spec. The YAML and JSON formats preserve DAG information in the spec.
""" """
from __future__ import print_function
import ast import ast
import collections import collections
import collections.abc import collections.abc

View file

@ -28,7 +28,6 @@ def test_read_unicode(tmpdir, working_env):
with open(script_name, "w") as f: with open(script_name, "w") as f:
f.write( f.write(
"""#!{0} """#!{0}
from __future__ import print_function
print(u'\\xc3') print(u'\\xc3')
""".format( """.format(
sys.executable sys.executable

View file

@ -2,10 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
# Need this because of spack.util.string
from __future__ import absolute_import
import inspect import inspect
import llnl.util.tty as tty import llnl.util.tty as tty

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import io import io
import sys import sys

View file

@ -3,9 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
# Need this because of spack.util.string
from __future__ import absolute_import
import io import io
import itertools import itertools
import re import re

View file

@ -2,8 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details. # Spack Project Developers. See the top-level COPYRIGHT file for details.
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import contextlib import contextlib
import multiprocessing import multiprocessing
import os import os

View file

@ -1,9 +1,6 @@
# Copyright (c) 2014-2021, Simon Percivall and Spack Project Developers. # Copyright (c) 2014-2021, Simon Percivall and Spack Project Developers.
# #
# SPDX-License-Identifier: Python-2.0 # SPDX-License-Identifier: Python-2.0
# coding: utf-8
from __future__ import absolute_import
import io import io
from .unparser import Unparser from .unparser import Unparser

View file

@ -2,8 +2,6 @@
# #
# SPDX-License-Identifier: Python-2.0 # SPDX-License-Identifier: Python-2.0
"Usage: unparse.py <path to source file>" "Usage: unparse.py <path to source file>"
from __future__ import print_function, unicode_literals
import ast import ast
import sys import sys
from contextlib import contextmanager from contextlib import contextmanager

View file

@ -3,8 +3,6 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
from __future__ import print_function
import codecs import codecs
import errno import errno
import multiprocessing.pool import multiprocessing.pool