diff options
author | alalazo <massimiliano.culpo@googlemail.com> | 2016-03-17 18:11:23 +0100 |
---|---|---|
committer | alalazo <massimiliano.culpo@googlemail.com> | 2016-03-17 18:11:23 +0100 |
commit | e673127263a03e63d6a64840d1071a788f0c099e (patch) | |
tree | 062c1edbfe91f11d10f5ea719fee9e020b88d387 | |
parent | 38c3c84969c25aaee8f643ff9770759c7e6d9c35 (diff) | |
download | spack-e673127263a03e63d6a64840d1071a788f0c099e.tar.gz spack-e673127263a03e63d6a64840d1071a788f0c099e.tar.bz2 spack-e673127263a03e63d6a64840d1071a788f0c099e.tar.xz spack-e673127263a03e63d6a64840d1071a788f0c099e.zip |
package : added documentation
-rw-r--r-- | lib/spack/spack/package.py | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py index 680b26d69a..d0b94dbbeb 100644 --- a/lib/spack/spack/package.py +++ b/lib/spack/spack/package.py @@ -976,32 +976,41 @@ class Package(object): return __import__(self.__class__.__module__, fromlist=[self.__class__.__name__]) - def setup_environment(self, env): """ + Appends in `env` the list of environment modifications needed to use this package outside of spack. + + Default implementation does nothing, but this can be overridden if the package needs a particular environment. + + Example : + + 1. A lot of Qt extensions need `QTDIR` set. This can be used to do that. + + Args: + env: list of environment modifications to be updated + """ + pass + def setup_dependent_environment(self, env, dependent_spec): + """ Called before the install() method of dependents. - Return the list of environment modifications needed by dependents (or extensions). Default implementation does - nothing, but this can be overridden by an extendable package to set up the install environment for its - extensions. This is useful if there are some common steps to installing all extensions for a certain package. + Appends in `env` the list of environment modifications needed by dependents (or extensions) during the + installation of a package. The default implementation delegates to `setup_environment`, but can be overridden + if the modifications to the environment happen to be different from the one needed to use the package outside + of spack. + + This is useful if there are some common steps to installing all extensions for a certain package. Example : 1. Installing python modules generally requires `PYTHONPATH` to point to the lib/pythonX.Y/site-packages directory in the module's install prefix. This could set that variable. - 2. A lot of Qt extensions need `QTDIR` set. This can be used to do that. - Args: + env: list of environment modifications to be updated dependent_spec: dependent (or extension) of this spec - - Returns: - instance of environment modifications """ - pass - - def setup_dependent_environment(self, env, dependent_spec): self.setup_environment(env) def modify_module(self, module, spec, dependent_spec): @@ -1020,12 +1029,10 @@ class Package(object): """ pass - def install(self, spec, prefix): """Package implementations override this with their own build configuration.""" raise InstallError("Package %s provides no install method!" % self.name) - def do_uninstall(self, force=False): if not self.installed: raise InstallError(str(self.spec) + " is not installed.") |