extends: add type kwarg (#20045)
* extends: add type kwarg * Flake8 fix
This commit is contained in:
		| @@ -120,8 +120,6 @@ so ``PerlPackage`` contains: | ||||
|  | ||||
|    extends('perl') | ||||
|  | ||||
|    depends_on('perl', type=('build', 'run')) | ||||
|  | ||||
|  | ||||
| If your package requires a specific version of Perl, you should | ||||
| specify this. | ||||
|   | ||||
| @@ -138,7 +138,6 @@ every R package needs this, the ``RPackage`` base class contains: | ||||
| .. code-block:: python | ||||
|  | ||||
|    extends('r') | ||||
|    depends_on('r', type=('build', 'run')) | ||||
|  | ||||
|  | ||||
| Take a close look at the homepage for ``caret``. If you look at the | ||||
|   | ||||
| @@ -113,7 +113,6 @@ the base class contains: | ||||
| .. code-block:: python | ||||
|  | ||||
|    extends('ruby') | ||||
|    depends_on('ruby', type=('build', 'run')) | ||||
|  | ||||
|  | ||||
| The ``*.gemspec`` file may contain something like: | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
| 
 | ||||
| import inspect | ||||
| 
 | ||||
| from spack.directives import depends_on, extends | ||||
| from spack.directives import extends | ||||
| from spack.package import PackageBase, run_after | ||||
| 
 | ||||
| 
 | ||||
| @@ -27,7 +27,6 @@ class OctavePackage(PackageBase): | ||||
|     build_system_class = 'OctavePackage' | ||||
| 
 | ||||
|     extends('octave') | ||||
|     depends_on('octave', type=('build', 'run')) | ||||
| 
 | ||||
|     def setup_build_environment(self, env): | ||||
|         # octave does not like those environment variables to be set: | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
| import inspect | ||||
| import os | ||||
| 
 | ||||
| from spack.directives import depends_on, extends | ||||
| from spack.directives import extends | ||||
| from spack.package import PackageBase, run_after | ||||
| from spack.util.executable import Executable | ||||
| from llnl.util.filesystem import filter_file | ||||
| @@ -45,8 +45,6 @@ class PerlPackage(PackageBase): | ||||
| 
 | ||||
|     extends('perl') | ||||
| 
 | ||||
|     depends_on('perl', type=('build', 'run')) | ||||
| 
 | ||||
|     def configure_args(self): | ||||
|         """Produces a list containing the arguments that must be passed to | ||||
|         :py:meth:`~.PerlPackage.configure`. Arguments should not include | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
| import os | ||||
| import shutil | ||||
| 
 | ||||
| from spack.directives import depends_on, extends | ||||
| from spack.directives import extends | ||||
| from spack.package import PackageBase, run_after | ||||
| 
 | ||||
| from llnl.util.filesystem import (working_dir, get_filetype, filter_file, | ||||
| @@ -87,8 +87,6 @@ def configure(self, spec, prefix): | ||||
| 
 | ||||
|     extends('python') | ||||
| 
 | ||||
|     depends_on('python', type=('build', 'run')) | ||||
| 
 | ||||
|     py_namespace = None | ||||
| 
 | ||||
|     @property | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
| 
 | ||||
| import inspect | ||||
| 
 | ||||
| from spack.directives import depends_on, extends | ||||
| from spack.directives import extends | ||||
| from spack.package import PackageBase, run_after | ||||
| 
 | ||||
| 
 | ||||
| @@ -31,8 +31,6 @@ class RPackage(PackageBase): | ||||
| 
 | ||||
|     extends('r') | ||||
| 
 | ||||
|     depends_on('r', type=('build', 'run')) | ||||
| 
 | ||||
|     def configure_args(self): | ||||
|         """Arguments to pass to install via ``--configure-args``.""" | ||||
|         return [] | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
| import glob | ||||
| import inspect | ||||
| 
 | ||||
| from spack.directives import depends_on, extends | ||||
| from spack.directives import extends | ||||
| from spack.package import PackageBase, run_after | ||||
| 
 | ||||
| 
 | ||||
| @@ -27,8 +27,6 @@ class RubyPackage(PackageBase): | ||||
| 
 | ||||
|     extends('ruby') | ||||
| 
 | ||||
|     depends_on('ruby', type=('build', 'run')) | ||||
| 
 | ||||
|     def build(self, spec, prefix): | ||||
|         """Build a Ruby gem.""" | ||||
| 
 | ||||
|   | ||||
| @@ -393,7 +393,7 @@ def _execute_depends_on(pkg): | ||||
| 
 | ||||
| 
 | ||||
| @directive(('extendees', 'dependencies')) | ||||
| def extends(spec, **kwargs): | ||||
| def extends(spec, type=('build', 'run'), **kwargs): | ||||
|     """Same as depends_on, but allows symlinking into dependency's | ||||
|     prefix tree. | ||||
| 
 | ||||
| @@ -414,7 +414,7 @@ def _execute_extends(pkg): | ||||
|         if not when_spec: | ||||
|             return | ||||
| 
 | ||||
|         _depends_on(pkg, spec, when=when) | ||||
|         _depends_on(pkg, spec, when=when, type=type) | ||||
|         pkg.extendees[spec] = (spack.spec.Spec(spec), kwargs) | ||||
|     return _execute_extends | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Adam J. Stewart
					Adam J. Stewart