summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2017-03-27 14:02:00 -0700
committerTodd Gamblin <tgamblin@llnl.gov>2017-04-21 23:35:02 -0700
commit9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273 (patch)
treeccd9bff4c28f3a749e26f4d8e05f7e0bcd2d1c94 /lib
parent0b002c2911845005c9c5f181f1cd5d77b8db1ec0 (diff)
downloadspack-9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273.tar.gz
spack-9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273.tar.bz2
spack-9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273.tar.xz
spack-9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273.zip
PythonPackage builds flat installs instead of egg directories.
- Spack doesn't need eggs -- it manages its own directories - Simplify install layout and reduce sys.path searches by installing all packages flat (eggs are deprecated for wheels, and this is also what wheels do). - We now supply the --single-version-externally-managed argument to `setup.py install` for setuptools packages and setuptools. - modify packages to only use setuptools args if setuptools is an immediate dependency - Remove setuptools from packages that do not need it. - Some packages use setuptools *only* when certain args (likeb 'develop' or 'bdist') are supplied to setup.py, and they specifically do not use setuptools for installation. - Spack never calls setup.py this way, so just removing the setuptools dependency works for these packages.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/python.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/spack/spack/build_systems/python.py b/lib/spack/spack/build_systems/python.py
index 904f0dbaa0..7a8650bfce 100644
--- a/lib/spack/spack/build_systems/python.py
+++ b/lib/spack/spack/build_systems/python.py
@@ -222,7 +222,24 @@ class PythonPackage(PackageBase):
def install_args(self, spec, prefix):
"""Arguments to pass to install."""
- return ['--prefix={0}'.format(prefix)]
+ args = ['--prefix={0}'.format(prefix)]
+
+ # This option causes python packages (including setuptools) NOT
+ # to create eggs or easy-install.pth files. Instead, they
+ # install naturally into $prefix/pythonX.Y/site-packages.
+ #
+ # Eggs add an extra level of indirection to sys.path, slowing
+ # down large HPC runs. They are also deprecated in favor of
+ # wheels, which use a normal layout when installed.
+ #
+ # Spack manages the package directory on its own by symlinking
+ # extensions into the site-packages directory, so we don't really
+ # need the .pth files or egg directories, anyway.
+ if ('py-setuptools' == spec.name or # this is setuptools, or
+ 'py-setuptools' in spec._dependencies): # it's an immediate dep
+ args += ['--single-version-externally-managed', '--root=/']
+
+ return args
def install_lib(self, spec, prefix):
"""Install all Python modules (extensions and pure Python)."""