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