From 9f0b94b4e190365b00df3d7ccfcc77d6b4ee4273 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Mon, 27 Mar 2017 14:02:00 -0700 Subject: 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. --- lib/spack/spack/build_systems/python.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib') 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).""" -- cgit v1.2.3-60-g2f50