remove wildcards from make spack core and packages
- This removes all wildcard imports EXCEPT `from spack import *` in packages
This commit is contained in:
parent
7757ebc0bc
commit
7dd79094b0
85 changed files with 233 additions and 163 deletions
|
@ -26,7 +26,8 @@
|
|||
|
||||
import os
|
||||
import shutil
|
||||
from llnl.util.filesystem import *
|
||||
|
||||
from llnl.util.filesystem import traverse_tree, mkdirp, touch
|
||||
|
||||
__all__ = ['LinkTree']
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
from six import StringIO
|
||||
from six.moves import input
|
||||
|
||||
from llnl.util.tty.color import *
|
||||
from llnl.util.tty.color import cprint, cwrite, cescape, clen
|
||||
|
||||
_debug = False
|
||||
_verbose = False
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
from spack.concretize import DefaultConcretizer
|
||||
from spack.version import Version
|
||||
from spack.util.path import canonicalize_path
|
||||
|
||||
from spack.package_prefs import PackageTesting
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Initialize various data structures & objects at the core of Spack.
|
||||
|
@ -158,7 +158,8 @@
|
|||
build_jobs = _config.get('build_jobs', multiprocessing.cpu_count())
|
||||
|
||||
|
||||
package_testing = spack.package_prefs.PackageTesting()
|
||||
# Needed for test dependencies
|
||||
package_testing = PackageTesting()
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
|
|
@ -62,15 +62,15 @@
|
|||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.tty.color import colorize
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import join_path, mkdirp, install, install_tree
|
||||
|
||||
import spack
|
||||
import spack.store
|
||||
from spack.environment import EnvironmentModifications, validate
|
||||
from spack.util.environment import *
|
||||
from spack.util.environment import env_flag, filter_system_paths, get_path
|
||||
from spack.util.executable import Executable
|
||||
from spack.util.module_cmd import load_module, get_path_from_module
|
||||
from spack.util.log_parse import *
|
||||
from spack.util.log_parse import parse_log_events, make_log_context
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
import os
|
||||
import os.path
|
||||
import shutil
|
||||
from os import stat
|
||||
from stat import *
|
||||
import stat
|
||||
from subprocess import PIPE
|
||||
from subprocess import check_call
|
||||
|
||||
|
@ -153,7 +152,7 @@ def _do_patch_config_guess(self):
|
|||
if config_guess is not None:
|
||||
try:
|
||||
check_call([config_guess], stdout=PIPE, stderr=PIPE)
|
||||
mod = stat(my_config_guess).st_mode & 0o777 | S_IWUSR
|
||||
mod = os.stat(my_config_guess).st_mode & 0o777 | stat.S_IWUSR
|
||||
os.chmod(my_config_guess, mod)
|
||||
shutil.copyfile(config_guess, my_config_guess)
|
||||
return
|
||||
|
|
|
@ -29,9 +29,9 @@
|
|||
import sys
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.tty.colify import *
|
||||
from llnl.util.tty.color import *
|
||||
from llnl.util.lang import attr_setdefault, index_by
|
||||
from llnl.util.tty.colify import colify
|
||||
from llnl.util.tty.color import colorize
|
||||
from llnl.util.filesystem import working_dir
|
||||
|
||||
import spack
|
||||
|
|
|
@ -24,7 +24,13 @@
|
|||
##############################################################################
|
||||
import spack.cmd.configure as cfg
|
||||
|
||||
from spack import *
|
||||
from spack.build_systems.autotools import AutotoolsPackage
|
||||
from spack.build_systems.cmake import CMakePackage
|
||||
from spack.build_systems.qmake import QMakePackage
|
||||
from spack.build_systems.scons import SConsPackage
|
||||
from spack.build_systems.waf import WafPackage
|
||||
from spack.build_systems.python import PythonPackage
|
||||
from spack.build_systems.perl import PerlPackage
|
||||
|
||||
description = 'stops at build stage when installing a package, if possible'
|
||||
section = "build"
|
||||
|
|
|
@ -31,8 +31,8 @@
|
|||
import spack.cmd
|
||||
import spack.util.crypto
|
||||
import spack.util.web
|
||||
from spack.util.naming import *
|
||||
from spack.version import *
|
||||
from spack.util.naming import valid_fully_qualified_module_name
|
||||
from spack.version import ver, Version
|
||||
|
||||
description = "checksum available versions of a package"
|
||||
section = "packaging"
|
||||
|
|
|
@ -28,7 +28,12 @@
|
|||
import spack.cmd
|
||||
import spack.cmd.install as inst
|
||||
|
||||
from spack import *
|
||||
from spack.build_systems.autotools import AutotoolsPackage
|
||||
from spack.build_systems.cmake import CMakePackage
|
||||
from spack.build_systems.qmake import QMakePackage
|
||||
from spack.build_systems.waf import WafPackage
|
||||
from spack.build_systems.perl import PerlPackage
|
||||
from spack.build_systems.intel import IntelPackage
|
||||
|
||||
description = 'stage and configure a package but do not install'
|
||||
section = "build"
|
||||
|
|
|
@ -35,8 +35,10 @@
|
|||
from spack.repository import Repo
|
||||
from spack.spec import Spec
|
||||
from spack.util.executable import which
|
||||
from spack.util.naming import *
|
||||
from spack.url import *
|
||||
from spack.util.naming import mod_to_class
|
||||
from spack.util.naming import simplify_name, valid_fully_qualified_module_name
|
||||
from spack.url import UndetectableNameError, UndetectableVersionError
|
||||
from spack.url import parse_name, parse_version
|
||||
|
||||
description = "create a new package file"
|
||||
section = "packaging"
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
##############################################################################
|
||||
import argparse
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
import tempfile
|
||||
import argparse
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, mkdirp
|
||||
|
||||
import spack
|
||||
from spack.util.executable import *
|
||||
from spack.util.executable import which
|
||||
|
||||
|
||||
description = "runs source code style checks on Spack. requires flake8"
|
||||
|
|
|
@ -30,9 +30,8 @@
|
|||
import spack
|
||||
import spack.cmd
|
||||
import spack.store
|
||||
from spack.spec import *
|
||||
from spack.dependency import *
|
||||
from spack.graph import *
|
||||
from spack.dependency import all_deptypes, canonical_deptype
|
||||
from spack.graph import graph_dot, graph_ascii
|
||||
|
||||
description = "generate graphs of package dependency relationships"
|
||||
section = "basic"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import sys
|
||||
from llnl.util.tty import colorize
|
||||
from llnl.util.tty.color import colorize
|
||||
|
||||
description = "get help on spack and its commands"
|
||||
section = "help"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
from six.moves import zip_longest
|
||||
|
||||
from llnl.util.tty.colify import *
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import llnl.util.tty.color as color
|
||||
import spack
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
from llnl.util.filesystem import working_dir
|
||||
|
||||
import spack
|
||||
from spack.util.executable import *
|
||||
from spack.util.executable import which
|
||||
from spack.cmd import spack_is_git_repo
|
||||
|
||||
description = "query packages associated with particular git revisions"
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
import spack.spec
|
||||
import spack.config
|
||||
from spack.repository import *
|
||||
from spack.repository import Repo, create_repo, canonicalize_path, RepoError
|
||||
|
||||
description = "manage package source repositories"
|
||||
section = "config"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
import pytest
|
||||
from six import StringIO
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack
|
||||
|
|
|
@ -29,7 +29,11 @@
|
|||
import spack
|
||||
|
||||
from llnl.util import tty
|
||||
from spack.url import *
|
||||
from spack.url import parse_version_offset, parse_name_offset
|
||||
from spack.url import parse_name, parse_version, color_url
|
||||
from spack.url import substitute_version, substitution_offsets
|
||||
from spack.url import UndetectableNameError, UndetectableVersionError
|
||||
from spack.url import UrlParseError
|
||||
from spack.util.web import find_versions_of_archive
|
||||
from spack.util.naming import simplify_name
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
import spack.spec
|
||||
import spack.architecture
|
||||
from spack.util.multiproc import parmap
|
||||
from spack.util.executable import *
|
||||
from spack.util.executable import Executable, ProcessError
|
||||
from spack.util.environment import get_path
|
||||
|
||||
__all__ = ['Compiler', 'get_compiler_version']
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
|
||||
|
||||
class Cce(Compiler):
|
||||
|
|
|
@ -25,14 +25,15 @@
|
|||
import re
|
||||
import os
|
||||
import sys
|
||||
import spack
|
||||
import spack.compiler as cpr
|
||||
from spack.compiler import *
|
||||
from spack.util.executable import *
|
||||
import llnl.util.tty as tty
|
||||
from spack.version import ver
|
||||
from shutil import copytree, ignore_patterns
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack
|
||||
from spack.compiler import Compiler, _version_cache
|
||||
from spack.util.executable import Executable
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
class Clang(Compiler):
|
||||
# Subclasses use possible names of C compiler
|
||||
|
@ -138,7 +139,7 @@ def default_version(cls, comp):
|
|||
Target: x86_64-apple-darwin15.2.0
|
||||
Thread model: posix
|
||||
"""
|
||||
if comp not in cpr._version_cache:
|
||||
if comp not in _version_cache:
|
||||
compiler = Executable(comp)
|
||||
output = compiler('--version', output=str, error=str)
|
||||
|
||||
|
@ -153,9 +154,9 @@ def default_version(cls, comp):
|
|||
if match:
|
||||
ver = match.group(1)
|
||||
|
||||
cpr._version_cache[comp] = ver
|
||||
_version_cache[comp] = ver
|
||||
|
||||
return cpr._version_cache[comp]
|
||||
return _version_cache[comp]
|
||||
|
||||
def _find_full_path(self, path):
|
||||
basename = os.path.basename(path)
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import llnl.util.tty as tty
|
||||
from spack.compiler import *
|
||||
|
||||
import spack
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
|
|
|
@ -22,8 +22,9 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
|
||||
|
||||
class Nag(Compiler):
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
|
||||
|
||||
class Pgi(Compiler):
|
||||
|
|
|
@ -22,8 +22,9 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack.compiler import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
from spack.compiler import Compiler, get_compiler_version
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
|
|
|
@ -34,17 +34,17 @@
|
|||
concretization policies.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
from six import iteritems
|
||||
from spack.version import *
|
||||
from itertools import chain
|
||||
from functools_backport import reverse_order
|
||||
from six import iteritems
|
||||
|
||||
import spack
|
||||
import spack.spec
|
||||
import spack.compilers
|
||||
import spack.architecture
|
||||
import spack.error
|
||||
from spack.package_prefs import *
|
||||
from spack.version import ver, Version, VersionList, VersionRange
|
||||
from spack.package_prefs import PackagePrefs, spec_externals, is_spec_buildable
|
||||
|
||||
|
||||
class DefaultConcretizer(object):
|
||||
|
@ -65,7 +65,8 @@ def _valid_virtuals_and_externals(self, spec):
|
|||
if spec.virtual:
|
||||
candidates = spack.repo.providers_for(spec)
|
||||
if not candidates:
|
||||
raise UnsatisfiableProviderSpecError(candidates[0], spec)
|
||||
raise spack.spec.UnsatisfiableProviderSpecError(
|
||||
candidates[0], spec)
|
||||
|
||||
# Find nearest spec in the DAG (up then down) that has prefs.
|
||||
spec_w_prefs = find_spec(
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
from yaml.error import MarkedYAMLError, YAMLError
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.lock import *
|
||||
from llnl.util.filesystem import join_path, mkdirp
|
||||
from llnl.util.lock import Lock, WriteTransaction, ReadTransaction
|
||||
|
||||
import spack.store
|
||||
import spack.repository
|
||||
|
|
|
@ -60,7 +60,7 @@ class OpenMpi(Package):
|
|||
import spack.error
|
||||
import spack.spec
|
||||
import spack.url
|
||||
from spack.dependency import *
|
||||
from spack.dependency import Dependency, default_deptype, canonical_deptype
|
||||
from spack.fetch_strategy import from_kwargs
|
||||
from spack.patch import Patch
|
||||
from spack.resource import Resource
|
||||
|
|
|
@ -46,17 +46,17 @@
|
|||
import shutil
|
||||
import copy
|
||||
from functools import wraps
|
||||
from six import string_types
|
||||
from six import with_metaclass
|
||||
from six import string_types, with_metaclass
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, mkdirp, join_path
|
||||
|
||||
import spack
|
||||
import spack.error
|
||||
import spack.util.crypto as crypto
|
||||
import spack.util.pattern as pattern
|
||||
from spack.util.executable import *
|
||||
from spack.util.string import *
|
||||
from spack.util.executable import which
|
||||
from spack.util.string import comma_or
|
||||
from spack.version import Version, ver
|
||||
from spack.util.compression import decompressor_for, extension
|
||||
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
import os
|
||||
import shutil
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.lock import *
|
||||
from llnl.util.filesystem import mkdirp, join_path
|
||||
from llnl.util.lock import Lock, ReadTransaction, WriteTransaction
|
||||
|
||||
from spack.error import SpackError
|
||||
|
||||
|
|
|
@ -61,15 +61,16 @@
|
|||
can take a number of specs as input.
|
||||
|
||||
"""
|
||||
import sys
|
||||
|
||||
from heapq import *
|
||||
from heapq import heapify, heappop, heappush
|
||||
from six import iteritems
|
||||
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.tty.color import *
|
||||
from llnl.util.tty.color import ColorStream
|
||||
|
||||
from spack.spec import Spec
|
||||
from spack.dependency import all_deptypes, canonical_deptype
|
||||
|
||||
from spack.spec import *
|
||||
from spack.dependency import *
|
||||
|
||||
__all__ = ['topological_sort', 'graph_ascii', 'AsciiGraph', 'graph_dot']
|
||||
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
import re
|
||||
import platform
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir
|
||||
|
||||
import spack
|
||||
from spack.cmd import spack_is_git_repo
|
||||
from spack.util.executable import *
|
||||
from spack.util.executable import which, ProcessError
|
||||
|
||||
|
||||
def pre_run():
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.tty.log import log_output
|
||||
from llnl.util.tty.color import *
|
||||
|
||||
import spack
|
||||
import spack.cmd
|
||||
|
|
|
@ -33,14 +33,14 @@
|
|||
import sys
|
||||
import os
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import mkdirp, join_path
|
||||
|
||||
import spack
|
||||
import spack.error
|
||||
import spack.url as url
|
||||
import spack.fetch_strategy as fs
|
||||
from spack.spec import Spec
|
||||
from spack.version import *
|
||||
from spack.version import VersionList
|
||||
from spack.util.compression import allowed_archive
|
||||
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
"""
|
||||
import functools
|
||||
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.lang import caller_locals, get_calling_module_name
|
||||
|
||||
import spack.architecture
|
||||
import spack.error
|
||||
|
|
|
@ -24,10 +24,12 @@
|
|||
##############################################################################
|
||||
import re
|
||||
|
||||
from spack.architecture import OperatingSystem
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import spack.spec
|
||||
from spack.util.multiproc import parmap
|
||||
import spack.compilers
|
||||
from spack.architecture import OperatingSystem
|
||||
from spack.util.multiproc import parmap
|
||||
from spack.util.module_cmd import get_module_cmd
|
||||
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import platform as py_platform
|
||||
|
||||
from spack.architecture import OperatingSystem
|
||||
from spack.version import *
|
||||
from spack.version import Version
|
||||
|
||||
|
||||
# FIXME: store versions inside OperatingSystem as a Version instead of string
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
import inspect
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import sys
|
||||
import textwrap
|
||||
import time
|
||||
|
@ -60,15 +61,16 @@
|
|||
import spack.util.web
|
||||
import spack.multimethod
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.filesystem import mkdirp, join_path, touch, ancestor
|
||||
from llnl.util.filesystem import working_dir, install_tree, install
|
||||
from llnl.util.lang import memoized
|
||||
from llnl.util.link_tree import LinkTree
|
||||
from llnl.util.tty.log import log_output
|
||||
from spack import directory_layout
|
||||
from spack.util.executable import which
|
||||
from spack.stage import Stage, ResourceStage, StageComposite
|
||||
from spack.util.environment import dump_environment
|
||||
from spack.version import *
|
||||
from spack.version import Version
|
||||
|
||||
"""Allowed URL schemes for spack packages."""
|
||||
_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"]
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
import spack
|
||||
import spack.error
|
||||
from spack.util.path import canonicalize_path
|
||||
from spack.version import *
|
||||
from spack.version import VersionList
|
||||
|
||||
|
||||
_lesser_spec_types = {'compiler': spack.spec.CompilerSpec,
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack import *
|
||||
import os
|
||||
from spack.util.executable import which, Executable
|
||||
|
||||
|
||||
def compile_c_and_execute(source_file, include_flags, link_flags):
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
##############################################################################
|
||||
import re
|
||||
import shlex
|
||||
import sys
|
||||
import itertools
|
||||
from six import string_types
|
||||
|
||||
|
|
|
@ -45,14 +45,15 @@
|
|||
|
||||
import llnl.util.lang
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import mkdirp, join_path, install
|
||||
|
||||
import spack
|
||||
import spack.error
|
||||
import spack.spec
|
||||
from spack.provider_index import ProviderIndex
|
||||
from spack.util.path import canonicalize_path
|
||||
from spack.util.naming import *
|
||||
from spack.util.naming import NamespaceTrie, valid_module_name
|
||||
from spack.util.naming import mod_to_class, possible_spack_module_names
|
||||
|
||||
#
|
||||
# Super-namespace for all packages.
|
||||
|
|
|
@ -102,6 +102,7 @@
|
|||
import hashlib
|
||||
import itertools
|
||||
import os
|
||||
import re
|
||||
|
||||
from operator import attrgetter
|
||||
from six import StringIO
|
||||
|
@ -109,8 +110,9 @@
|
|||
from six import iteritems
|
||||
|
||||
from llnl.util.filesystem import find_headers, find_libraries, is_exe
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.tty.color import *
|
||||
from llnl.util.lang import key_ordering, HashableMap, ObjectWrapper, dedupe
|
||||
from llnl.util.lang import check_kwargs
|
||||
from llnl.util.tty.color import cwrite, colorize, cescape, get_color_when
|
||||
|
||||
import spack
|
||||
import spack.architecture
|
||||
|
@ -121,7 +123,7 @@
|
|||
import spack.util.spack_json as sjson
|
||||
import spack.util.spack_yaml as syaml
|
||||
|
||||
from spack.dependency import *
|
||||
from spack.dependency import Dependency, all_deptypes, canonical_deptype
|
||||
from spack.util.module_cmd import get_path_from_module, load_module
|
||||
from spack.error import SpecError, UnsatisfiableSpecError
|
||||
from spack.provider_index import ProviderIndex
|
||||
|
@ -129,9 +131,13 @@
|
|||
from spack.util.executable import Executable
|
||||
from spack.util.prefix import Prefix
|
||||
from spack.util.spack_yaml import syaml_dict
|
||||
from spack.util.string import *
|
||||
from spack.variant import *
|
||||
from spack.version import *
|
||||
from spack.util.string import comma_or
|
||||
from spack.variant import MultiValuedVariant, AbstractVariant
|
||||
from spack.variant import BoolValuedVariant, substitute_abstract_variants
|
||||
from spack.variant import VariantMap, UnknownVariantError
|
||||
from spack.variant import DuplicateVariantError
|
||||
from spack.variant import UnsatisfiableVariantSpecError
|
||||
from spack.version import VersionList, VersionRange, Version, ver
|
||||
from yaml.error import MarkedYAMLError
|
||||
|
||||
__all__ = [
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
|
||||
import llnl.util.tty as tty
|
||||
import llnl.util.lock
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import mkdirp, join_path, can_access
|
||||
from llnl.util.filesystem import remove_if_dead_link, remove_linked_tree
|
||||
|
||||
import spack
|
||||
import spack.config
|
||||
import spack.error
|
||||
import spack.fetch_strategy as fs
|
||||
import spack.util.pattern as pattern
|
||||
from spack.version import *
|
||||
from spack.util.path import canonicalize_path
|
||||
from spack.util.crypto import prefix_bits, bit_length
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
import tempfile
|
||||
import shutil
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
import spack
|
||||
from spack.util.executable import *
|
||||
from llnl.util.filesystem import mkdirp, join_path
|
||||
from spack.util.executable import Executable
|
||||
|
||||
# Complicated compiler test command
|
||||
test_command = [
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
from llnl.util.filesystem import FileFilter
|
||||
|
||||
import spack
|
||||
from spack.cmd.flake8 import *
|
||||
from spack.cmd.flake8 import flake8, setup_parser, changed_files
|
||||
from spack.repository import Repo
|
||||
|
||||
from spack.util.executable import which
|
||||
|
||||
|
||||
@pytest.fixture(scope='module')
|
||||
|
|
|
@ -70,4 +70,4 @@ def test_list_with_filters(self, parser, pkg_names):
|
|||
|
||||
assert pkg_names
|
||||
assert 'cloverleaf3d' in pkg_names
|
||||
assert 'hdf5' not in pkg_names
|
||||
assert 'hdf5' not in pkg_names
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
import pytest
|
||||
from spack.url import UndetectableVersionError
|
||||
from spack.main import SpackCommand
|
||||
from spack.cmd.url import *
|
||||
from spack.cmd.url import name_parsed_correctly, version_parsed_correctly
|
||||
from spack.cmd.url import url_summary
|
||||
|
||||
url = SpackCommand('url')
|
||||
|
||||
|
|
|
@ -44,9 +44,10 @@
|
|||
import spack.stage
|
||||
import spack.util.executable
|
||||
import spack.util.pattern
|
||||
from spack.dependency import *
|
||||
from spack.dependency import Dependency
|
||||
from spack.package import PackageBase
|
||||
from spack.fetch_strategy import *
|
||||
from spack.fetch_strategy import FetchStrategyComposite, URLFetchStrategy
|
||||
from spack.fetch_strategy import FetchError
|
||||
from spack.spec import Spec
|
||||
from spack.version import Version
|
||||
|
||||
|
|
|
@ -27,14 +27,15 @@
|
|||
both in memory and in its file
|
||||
"""
|
||||
import multiprocessing
|
||||
import os.path
|
||||
|
||||
import os
|
||||
import pytest
|
||||
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
import spack
|
||||
import spack.store
|
||||
from spack.test.conftest import MockPackageMultiRepo
|
||||
from spack.util.executable import Executable
|
||||
from llnl.util.tty.colify import colify
|
||||
|
||||
|
||||
def _print_ref_counts():
|
||||
|
|
|
@ -26,11 +26,13 @@
|
|||
This test verifies that the Spack directory layout works properly.
|
||||
"""
|
||||
import os
|
||||
|
||||
import pytest
|
||||
|
||||
from llnl.util.filesystem import join_path
|
||||
|
||||
import spack
|
||||
from spack.directory_layout import (YamlDirectoryLayout,
|
||||
InvalidDirectoryLayoutParametersError)
|
||||
from spack.directory_layout import YamlDirectoryLayout
|
||||
from spack.directory_layout import InvalidDirectoryLayoutParametersError
|
||||
from spack.repository import RepoPath
|
||||
from spack.spec import Spec
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
import pytest
|
||||
import spack
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, join_path, touch
|
||||
from spack.spec import Spec
|
||||
from spack.version import ver
|
||||
from spack.fetch_strategy import GitFetchStrategy
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
import pytest
|
||||
import spack
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, join_path, touch
|
||||
from spack.spec import Spec
|
||||
from spack.version import ver
|
||||
from spack.util.executable import which
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
import pytest
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from llnl.util.lang import *
|
||||
from llnl.util.lang import pretty_date, match_predicate
|
||||
|
||||
|
||||
def test_pretty_date():
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
import os
|
||||
|
||||
import pytest
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, mkdirp, touchp
|
||||
from llnl.util.link_tree import LinkTree
|
||||
from spack.stage import Stage
|
||||
|
||||
|
|
|
@ -73,8 +73,8 @@
|
|||
import pytest
|
||||
|
||||
from llnl.util.filesystem import join_path, touch
|
||||
from llnl.util.lock import *
|
||||
from spack.util.multiproc import Barrier
|
||||
from llnl.util.lock import Lock, WriteTransaction, ReadTransaction, LockError
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
import tempfile
|
||||
import unittest
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import join_path
|
||||
from spack.build_environment import MakeExecutable
|
||||
from spack.util.environment import path_put_first
|
||||
|
||||
|
|
|
@ -25,7 +25,11 @@
|
|||
import pytest
|
||||
import subprocess
|
||||
import os
|
||||
from spack.util.module_cmd import *
|
||||
from spack.util.module_cmd import get_path_from_module
|
||||
from spack.util.module_cmd import get_argument_from_module_line
|
||||
from spack.util.module_cmd import get_module_cmd_from_bash
|
||||
from spack.util.module_cmd import get_module_cmd, ModuleError
|
||||
|
||||
|
||||
typeset_func = subprocess.Popen('module avail',
|
||||
stdout=subprocess.PIPE,
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
"""Test for multi_method dispatch."""
|
||||
import spack
|
||||
import pytest
|
||||
from spack.multimethod import *
|
||||
from spack.version import *
|
||||
from spack.multimethod import NoSuchMethodError
|
||||
|
||||
|
||||
def test_no_version_match(builtin_mock):
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
from llnl.util.filesystem import join_path
|
||||
from spack.repository import Repo
|
||||
from spack.util.naming import mod_to_class
|
||||
from spack.spec import *
|
||||
from spack.spec import Spec
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('config', 'builtin_mock')
|
||||
|
|
|
@ -40,8 +40,11 @@
|
|||
import spack.cmd.buildcache as buildcache
|
||||
from spack.spec import Spec
|
||||
from spack.fetch_strategy import URLFetchStrategy, FetchStrategyComposite
|
||||
from spack.relocate import *
|
||||
from spack.util.executable import ProcessError
|
||||
from spack.relocate import needs_binary_relocation, get_patchelf
|
||||
from spack.relocate import substitute_rpath, get_relative_rpaths
|
||||
from spack.relocate import macho_replace_paths, macho_make_paths_relative
|
||||
from spack.relocate import modify_macho_object, macho_get_paths
|
||||
|
||||
|
||||
@pytest.fixture(scope='function')
|
||||
|
|
|
@ -32,10 +32,10 @@
|
|||
import shutil
|
||||
import filecmp
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import mkdirp
|
||||
|
||||
import spack
|
||||
from spack.hooks.sbang import *
|
||||
from spack.hooks.sbang import shebang_too_long, filter_shebangs_in_directory
|
||||
from spack.util.executable import which
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
import spack.package
|
||||
|
||||
from spack.spec import Spec
|
||||
from spack.dependency import *
|
||||
from spack.dependency import all_deptypes, Dependency, canonical_deptype
|
||||
from spack.test.conftest import MockPackage, MockPackageMultiRepo
|
||||
|
||||
|
||||
|
|
|
@ -25,8 +25,10 @@
|
|||
import spack.architecture
|
||||
import pytest
|
||||
|
||||
from spack.spec import *
|
||||
from spack.variant import *
|
||||
from spack.spec import Spec, UnsatisfiableSpecError
|
||||
from spack.spec import substitute_abstract_variants, parse_anonymous_spec
|
||||
from spack.variant import InvalidVariantValueError
|
||||
from spack.variant import MultipleValuesInExclusiveVariantError
|
||||
|
||||
|
||||
def target_factory(spec_string, target_concrete):
|
||||
|
|
|
@ -28,7 +28,12 @@
|
|||
import spack
|
||||
import spack.spec as sp
|
||||
from spack.parse import Token
|
||||
from spack.spec import *
|
||||
from spack.spec import Spec, parse, parse_anonymous_spec
|
||||
from spack.spec import SpecParseError, RedundantSpecError
|
||||
from spack.spec import AmbiguousHashError, InvalidHashError, NoSuchHashError
|
||||
from spack.spec import DuplicateArchitectureError, DuplicateVariantError
|
||||
from spack.spec import DuplicateDependencyError, DuplicateCompilerSpecError
|
||||
|
||||
|
||||
# Sample output for a complex lexing.
|
||||
complex_lex = [Token(sp.ID, 'mvapich_foo'),
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
import pytest
|
||||
import spack
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import join_path, touch, working_dir
|
||||
from spack.spec import Spec
|
||||
from spack.version import ver
|
||||
from spack.util.executable import which
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
import os
|
||||
import pytest
|
||||
|
||||
from llnl.util.filesystem import *
|
||||
from llnl.util.filesystem import working_dir, is_exe
|
||||
|
||||
import spack
|
||||
from spack.spec import Spec
|
||||
|
|
|
@ -27,9 +27,13 @@
|
|||
"""
|
||||
|
||||
import os
|
||||
|
||||
import pytest
|
||||
from spack.url import *
|
||||
|
||||
from spack.url import parse_name_offset, parse_version_offset
|
||||
from spack.url import parse_name_and_version, substitute_version
|
||||
from spack.url import strip_name_suffixes, strip_version_suffixes
|
||||
from spack.url import UndetectableVersionError
|
||||
from spack.version import Version
|
||||
|
||||
|
||||
@pytest.mark.parametrize('url,expected', [
|
||||
|
|
|
@ -26,7 +26,12 @@
|
|||
import pytest
|
||||
import numbers
|
||||
|
||||
from spack.variant import *
|
||||
from spack.variant import Variant, SingleValuedVariant, VariantMap
|
||||
from spack.variant import MultiValuedVariant, BoolValuedVariant
|
||||
from spack.variant import UnsatisfiableVariantSpecError
|
||||
from spack.variant import InconsistentValidationError
|
||||
from spack.variant import MultipleValuesInExclusiveVariantError
|
||||
from spack.variant import InvalidVariantValueError, DuplicateVariantError
|
||||
|
||||
|
||||
class TestMultiValuedVariant(object):
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"""
|
||||
import pytest
|
||||
|
||||
from spack.version import *
|
||||
from spack.version import Version, ver
|
||||
|
||||
|
||||
def assert_ver_lt(a, b):
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
import spack
|
||||
from spack.util.web import spider, find_versions_of_archive
|
||||
from spack.version import *
|
||||
from spack.version import ver
|
||||
|
||||
|
||||
web_data_path = os.path.join(spack.test_path, 'data', 'web')
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
from six.moves.urllib.parse import urlsplit, urlunsplit
|
||||
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.tty.color import *
|
||||
from llnl.util.tty.color import colorize
|
||||
|
||||
import spack.error
|
||||
import spack.util.compression as comp
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
"""
|
||||
import yaml
|
||||
from yaml import Loader, Dumper
|
||||
from yaml.nodes import *
|
||||
from yaml.nodes import MappingNode, SequenceNode, ScalarNode
|
||||
from yaml.constructor import ConstructorError
|
||||
from ordereddict_backport import OrderedDict
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import os
|
||||
|
||||
from spack import *
|
||||
from spack.package_test import *
|
||||
from spack.util.executable import Executable
|
||||
import os.path
|
||||
from spack.package_test import compile_c_and_execute, compare_output_file
|
||||
|
||||
|
||||
class Atlas(Package):
|
||||
|
|
|
@ -52,14 +52,16 @@
|
|||
# - Combining +parmgridgen with +float32 probably won't work.
|
||||
#
|
||||
##############################################################################
|
||||
from spack import *
|
||||
from spack.environment import *
|
||||
|
||||
import glob
|
||||
import re
|
||||
import shutil
|
||||
import os
|
||||
from spack.pkg.builtin.openfoam_com import *
|
||||
|
||||
from spack import *
|
||||
from spack.pkg.builtin.openfoam_com import OpenfoamArch
|
||||
from spack.pkg.builtin.openfoam_com import add_extra_files
|
||||
from spack.pkg.builtin.openfoam_com import write_environ
|
||||
from spack.pkg.builtin.openfoam_com import rewrite_environ_files
|
||||
|
||||
|
||||
class FoamExtend(Package):
|
||||
|
|
|
@ -35,12 +35,12 @@
|
|||
# OpenFOAM distribution.
|
||||
#
|
||||
##############################################################################
|
||||
from spack import *
|
||||
from spack.environment import *
|
||||
import os
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import os
|
||||
from spack.pkg.builtin.openfoam_com import *
|
||||
from spack import *
|
||||
from spack.pkg.builtin.openfoam_com import add_extra_files
|
||||
|
||||
|
||||
class OfAdiosWrite(Package):
|
||||
|
|
|
@ -22,11 +22,12 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
from spack import *
|
||||
from spack.package_test import *
|
||||
import spack.architecture
|
||||
import os
|
||||
|
||||
from spack import *
|
||||
from spack.package_test import compare_output_file, compile_c_and_execute
|
||||
import spack.architecture
|
||||
|
||||
|
||||
class Openblas(MakefilePackage):
|
||||
"""OpenBLAS: An optimized BLAS library"""
|
||||
|
|
|
@ -58,15 +58,15 @@
|
|||
# WM_PROJECT_VERSION=plus naming internally.
|
||||
#
|
||||
##############################################################################
|
||||
from spack import *
|
||||
from spack.environment import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import glob
|
||||
import re
|
||||
import shutil
|
||||
import os
|
||||
|
||||
from spack import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
|
||||
# Not the nice way of doing things, but is a start for refactoring
|
||||
__all__ = [
|
||||
'add_extra_files',
|
||||
|
|
|
@ -53,15 +53,19 @@
|
|||
# - Combining +mgridgen with +int64 or +float32 probably won't work.
|
||||
#
|
||||
##############################################################################
|
||||
from spack import *
|
||||
from spack.environment import *
|
||||
import llnl.util.tty as tty
|
||||
|
||||
import glob
|
||||
import re
|
||||
import shutil
|
||||
import os
|
||||
from spack.pkg.builtin.openfoam_com import *
|
||||
|
||||
import llnl.util.tty as tty
|
||||
|
||||
from spack import *
|
||||
from spack.pkg.builtin.openfoam_com import add_extra_files
|
||||
from spack.pkg.builtin.openfoam_com import write_environ
|
||||
from spack.pkg.builtin.openfoam_com import rewrite_environ_files
|
||||
from spack.pkg.builtin.openfoam_com import mplib_content
|
||||
from spack.pkg.builtin.openfoam_com import OpenfoamArch
|
||||
|
||||
|
||||
class OpenfoamOrg(Package):
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
import os
|
||||
|
||||
from spack import *
|
||||
from spack.package_test import *
|
||||
import os
|
||||
from spack.package_test import compile_c_and_execute, compare_output_file
|
||||
|
||||
|
||||
class Pocl(CMakePackage):
|
||||
|
|
|
@ -27,14 +27,13 @@
|
|||
import platform
|
||||
import re
|
||||
import sys
|
||||
from contextlib import closing
|
||||
|
||||
import spack
|
||||
import llnl.util.tty as tty
|
||||
from llnl.util.lang import match_predicate
|
||||
from llnl.util.filesystem import force_remove
|
||||
|
||||
import spack
|
||||
from spack import *
|
||||
from spack.util.environment import *
|
||||
from spack.util.prefix import Prefix
|
||||
import spack.util.spack_json as sjson
|
||||
|
||||
|
@ -587,7 +586,7 @@ def write_easy_install_pth(self, exts):
|
|||
if not os.path.isfile(easy_pth):
|
||||
continue
|
||||
|
||||
with closing(open(easy_pth)) as f:
|
||||
with open(easy_pth) as f:
|
||||
for line in f:
|
||||
line = line.rstrip()
|
||||
|
||||
|
@ -610,7 +609,7 @@ def write_easy_install_pth(self, exts):
|
|||
os.remove(main_pth)
|
||||
|
||||
else:
|
||||
with closing(open(main_pth, 'w')) as f:
|
||||
with open(main_pth, 'w') as f:
|
||||
f.write("import sys; sys.__plen = len(sys.path)\n")
|
||||
for path in paths:
|
||||
f.write("{0}\n".format(path))
|
||||
|
|
|
@ -22,10 +22,8 @@
|
|||
# License along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
##############################################################################
|
||||
|
||||
from spack import *
|
||||
from spack.util.environment import *
|
||||
import shutil
|
||||
from spack import *
|
||||
|
||||
|
||||
class R(AutotoolsPackage):
|
||||
|
|
Loading…
Reference in a new issue