Skip to content

Commit 6d7b26d

Browse files
committed
Insert lib/spack/external into sys.path. This avoids cases where the system
python install and lib/spack/external have the same library installed. This requires modifying the names of some modules in lib/spack/external in cases where both the system python and backported features of future python versions (i.e. after 2.6) are used (previously distinguished by "from external import X" and "import X").
1 parent 9474b8c commit 6d7b26d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+46
-44
lines changed

bin/spack

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ SPACK_PREFIX = os.path.dirname(os.path.dirname(SPACK_FILE))
3838
# Allow spack libs to be imported in our scripts
3939
SPACK_LIB_PATH = os.path.join(SPACK_PREFIX, "lib", "spack")
4040
sys.path.insert(0, SPACK_LIB_PATH)
41+
SPACK_EXTERNAL_LIBS = os.path.join(SPACK_LIB_PATH, "external")
42+
sys.path.insert(0, SPACK_EXTERNAL_LIBS)
4143

4244
# If there is no working directory, use the spack prefix.
4345
try:
File renamed without changes.

lib/spack/spack/cmd/activate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# along with this program; if not, write to the Free Software Foundation,
2323
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424
##############################################################################
25-
from external import argparse
25+
import argparse
2626
import llnl.util.tty as tty
2727
import spack
2828
import spack.cmd

lib/spack/spack/cmd/checksum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
##############################################################################
2525
import os
2626
import re
27-
from external import argparse
27+
import argparse
2828
import hashlib
2929
from pprint import pprint
3030
from subprocess import CalledProcessError

lib/spack/spack/cmd/clean.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# along with this program; if not, write to the Free Software Foundation,
2323
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424
##############################################################################
25-
from external import argparse
25+
import argparse
2626

2727
import llnl.util.tty as tty
2828

lib/spack/spack/cmd/compiler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# along with this program; if not, write to the Free Software Foundation,
2323
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424
##############################################################################
25-
from external import argparse
25+
import argparse
2626

2727
import llnl.util.tty as tty
2828
from llnl.util.tty.color import colorize

lib/spack/spack/cmd/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424
##############################################################################
2525
import sys
26-
from external import argparse
26+
import argparse
2727

2828
import llnl.util.tty as tty
2929

lib/spack/spack/cmd/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
import hashlib
2828
import re
2929

30-
from external.ordereddict import OrderedDict
30+
from ordereddict_backport import OrderedDict
3131
import llnl.util.tty as tty
3232
from llnl.util.filesystem import mkdirp
3333

lib/spack/spack/cmd/deactivate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# along with this program; if not, write to the Free Software Foundation,
2323
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424
##############################################################################
25-
from external import argparse
25+
import argparse
2626
import llnl.util.tty as tty
2727

2828
import spack

0 commit comments

Comments
 (0)