From a11de1d29d3742d3546e605525885c41680301f9 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 14 Apr 2020 19:54:53 +0200 Subject: Package extensions: fixed a link in docs (#16040) * Moved link to the right place in the docs * Fixed a few minor issues in extensions docs Fixed a typo, added a subsubsection for better navigation, reworded "modules in Python" as "Python packages" --- lib/spack/docs/basic_usage.rst | 5 +++-- lib/spack/docs/module_file_support.rst | 2 -- lib/spack/docs/packaging_guide.rst | 9 ++++++--- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/spack/docs/basic_usage.rst b/lib/spack/docs/basic_usage.rst index 2f047c0785..8acebeb0e6 100644 --- a/lib/spack/docs/basic_usage.rst +++ b/lib/spack/docs/basic_usage.rst @@ -1234,6 +1234,8 @@ add a version specifier to the spec: Notice that the package versions that provide insufficient MPI versions are now filtered out. +.. _extensions: + --------------------------- Extensions & Python support --------------------------- @@ -1241,8 +1243,7 @@ Extensions & Python support Spack's installation model assumes that each package will live in its own install prefix. However, certain packages are typically installed *within* the directory hierarchy of other packages. For example, -modules in interpreted languages like `Python -`_ are typically installed in the +`Python `_ packages are typically installed in the ``$prefix/lib/python-2.7/site-packages`` directory. Spack has support for this type of installation as well. In Spack, diff --git a/lib/spack/docs/module_file_support.rst b/lib/spack/docs/module_file_support.rst index aa7eb57653..01a13cdf3e 100644 --- a/lib/spack/docs/module_file_support.rst +++ b/lib/spack/docs/module_file_support.rst @@ -165,8 +165,6 @@ used ``gcc``. You could therefore just type: To identify just the one built with the Intel compiler. -.. _extensions: - .. _cmd-spack-module-loads: ^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/spack/docs/packaging_guide.rst b/lib/spack/docs/packaging_guide.rst index 88b7814838..26f843aa0e 100644 --- a/lib/spack/docs/packaging_guide.rst +++ b/lib/spack/docs/packaging_guide.rst @@ -2197,7 +2197,7 @@ property to ``True``, e.g.: extendable = True ... -To make a package into an extension, simply add simply add an +To make a package into an extension, simply add an ``extends`` call in the package definition, and pass it the name of an extendable package: @@ -2212,6 +2212,10 @@ Now, the ``py-numpy`` package can be used as an argument to ``spack activate``. When it is activated, all the files in its prefix will be symbolically linked into the prefix of the python package. +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Adding additional constraints +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + Some packages produce a Python extension, but are only compatible with Python 3, or with Python 2. In those cases, a ``depends_on()`` declaration should be made in addition to the ``extends()`` @@ -2231,8 +2235,7 @@ variant(s) are selected. This may be accomplished with conditional .. code-block:: python class FooLib(Package): - variant('python', default=True, description= \ - 'Build the Python extension Module') + variant('python', default=True, description='Build the Python extension Module') extends('python', when='+python') ... -- cgit v1.2.3-70-g09d2