Add PythonPackage base class

- Add a PythonPackage class with build system support.
  - Support build phases in PythonPackage
  - Add a custom sanity check for PythonPackages
  - Get rid of nolink dependencies in python packages

- Update spack create to use new PythonPackage class

- Port most of Python packages to new PythonPackage class

- Conducted a massive install and activate of Python packages.
  - Fixed bugs introduced by install and activate.

- Update API docs on PythonPackage
This commit is contained in:
Adam J. Stewart
2017-01-16 18:13:37 -08:00
committed by Todd Gamblin
parent 1f49493fee
commit c0aaa8fcea
169 changed files with 849 additions and 1011 deletions

View File

@@ -25,7 +25,7 @@
from spack import *
class PyH5py(Package):
class PyH5py(PythonPackage):
"""The h5py package provides both a high- and low-level interface to the
HDF5 library from Python."""
@@ -38,8 +38,6 @@ class PyH5py(Package):
variant('mpi', default=True, description='Build with MPI support')
extends('python')
# Build dependencies
depends_on('py-cython@0.19:', type='build')
depends_on('pkg-config', type='build')
@@ -55,11 +53,11 @@ class PyH5py(Package):
# Runtime dependencies
depends_on('py-six', type=('build', 'run'))
def install(self, spec, prefix):
setup_py('configure', '--hdf5={0}'.format(spec['hdf5'].prefix))
phases = ['configure', 'install']
def configure(self, spec, prefix):
self.setup_py('configure', '--hdf5={0}'.format(spec['hdf5'].prefix))
if '+mpi' in spec:
env['CC'] = spec['mpi'].mpicc
setup_py('configure', '--mpi')
setup_py('install', '--prefix={0}'.format(prefix))
self.setup_py('configure', '--mpi')