diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-23 14:23:00 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-24 10:05:36 +0200 |
commit | 7dd79094b05172cfcd2b594326eb22bf8e3c83cd (patch) | |
tree | edea4bb04934e4a47e56b0d8c4903363e7c72d9b /var | |
parent | 7757ebc0bc5b46cb3cfa41e5bebd4754978fd3b0 (diff) | |
download | spack-7dd79094b05172cfcd2b594326eb22bf8e3c83cd.tar.gz spack-7dd79094b05172cfcd2b594326eb22bf8e3c83cd.tar.bz2 spack-7dd79094b05172cfcd2b594326eb22bf8e3c83cd.tar.xz spack-7dd79094b05172cfcd2b594326eb22bf8e3c83cd.zip |
remove wildcards from make spack core and packages
- This removes all wildcard imports EXCEPT `from spack import *` in packages
Diffstat (limited to 'var')
9 files changed, 36 insertions, 32 deletions
diff --git a/var/spack/repos/builtin/packages/atlas/package.py b/var/spack/repos/builtin/packages/atlas/package.py index 1676d7126f..3eee7816f6 100644 --- a/var/spack/repos/builtin/packages/atlas/package.py +++ b/var/spack/repos/builtin/packages/atlas/package.py @@ -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): diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py index 550cdc1bff..987ce3548a 100644 --- a/var/spack/repos/builtin/packages/foam-extend/package.py +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -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): diff --git a/var/spack/repos/builtin/packages/of-adios-write/package.py b/var/spack/repos/builtin/packages/of-adios-write/package.py index cd25fbe654..c615e55807 100644 --- a/var/spack/repos/builtin/packages/of-adios-write/package.py +++ b/var/spack/repos/builtin/packages/of-adios-write/package.py @@ -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): diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 4baeecdf83..a64615a78b 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -22,10 +22,11 @@ # 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.package_test import compare_output_file, compile_c_and_execute import spack.architecture -import os class Openblas(MakefilePackage): diff --git a/var/spack/repos/builtin/packages/openfoam-com/package.py b/var/spack/repos/builtin/packages/openfoam-com/package.py index 555242f459..e32d7a6c10 100644 --- a/var/spack/repos/builtin/packages/openfoam-com/package.py +++ b/var/spack/repos/builtin/packages/openfoam-com/package.py @@ -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', diff --git a/var/spack/repos/builtin/packages/openfoam-org/package.py b/var/spack/repos/builtin/packages/openfoam-org/package.py index 98e1ba5602..b46df164d5 100644 --- a/var/spack/repos/builtin/packages/openfoam-org/package.py +++ b/var/spack/repos/builtin/packages/openfoam-org/package.py @@ -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): diff --git a/var/spack/repos/builtin/packages/pocl/package.py b/var/spack/repos/builtin/packages/pocl/package.py index 79a7ebff0b..f4facac86b 100644 --- a/var/spack/repos/builtin/packages/pocl/package.py +++ b/var/spack/repos/builtin/packages/pocl/package.py @@ -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): diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index e68870b412..15f2974328 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -27,14 +27,13 @@ import os 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 @@ class Python(AutotoolsPackage): 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 @@ class Python(AutotoolsPackage): 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)) diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py index 07ad38da98..c993a0f067 100644 --- a/var/spack/repos/builtin/packages/r/package.py +++ b/var/spack/repos/builtin/packages/r/package.py @@ -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): |