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.
This commit is contained in:
Todd Gamblin
2017-03-27 14:02:00 -07:00
parent 0b002c2911
commit 9f0b94b4e1
19 changed files with 63 additions and 27 deletions

View File

@@ -222,7 +222,24 @@ def install(self, spec, prefix):
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)."""