diff options
author | Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> | 2023-10-23 00:15:03 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-23 09:15:03 +0200 |
commit | cfc5363053d4ee063273e3d69d658590920657dc (patch) | |
tree | a02e7b4941fa983ab57ced5cccc25956b98f5e94 /lib/spack/docs/build_systems/sconspackage.rst | |
parent | d9167834c48c416fb0d777816913d360cbb2cb8e (diff) | |
download | spack-cfc5363053d4ee063273e3d69d658590920657dc.tar.gz spack-cfc5363053d4ee063273e3d69d658590920657dc.tar.bz2 spack-cfc5363053d4ee063273e3d69d658590920657dc.tar.xz spack-cfc5363053d4ee063273e3d69d658590920657dc.zip |
Docs: Update spec variant checks plus python quotes and string formatting (#40643)
Diffstat (limited to 'lib/spack/docs/build_systems/sconspackage.rst')
-rw-r--r-- | lib/spack/docs/build_systems/sconspackage.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/spack/docs/build_systems/sconspackage.rst b/lib/spack/docs/build_systems/sconspackage.rst index 18002586a0..a17e1271b8 100644 --- a/lib/spack/docs/build_systems/sconspackage.rst +++ b/lib/spack/docs/build_systems/sconspackage.rst @@ -57,7 +57,7 @@ overridden like so: .. code-block:: python def test(self): - scons('check') + scons("check") ^^^^^^^^^^^^^^^ @@ -88,7 +88,7 @@ base class already contains: .. code-block:: python - depends_on('scons', type='build') + depends_on("scons", type="build") If you want to specify a particular version requirement, you can override @@ -96,7 +96,7 @@ this in your package: .. code-block:: python - depends_on('scons@2.3.0:', type='build') + depends_on("scons@2.3.0:", type="build") ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -238,14 +238,14 @@ the package build phase. This is done by overriding ``build_args`` like so: def build_args(self, spec, prefix): args = [ - 'PREFIX={0}'.format(prefix), - 'ZLIB={0}'.format(spec['zlib'].prefix), + f"PREFIX={prefix}", + f"ZLIB={spec['zlib'].prefix}", ] - if '+debug' in spec: - args.append('DEBUG=yes') + if spec.satisfies("+debug"): + args.append("DEBUG=yes") else: - args.append('DEBUG=no') + args.append("DEBUG=no") return args @@ -275,8 +275,8 @@ environment variables. For example, cantera has the following option: * env_vars: [ string ] Environment variables to propagate through to SCons. Either the string "all" or a comma separated list of variable names, e.g. - 'LD_LIBRARY_PATH,HOME'. - - default: 'LD_LIBRARY_PATH,PYTHONPATH' + "LD_LIBRARY_PATH,HOME". + - default: "LD_LIBRARY_PATH,PYTHONPATH" In the case of cantera, using ``env_vars=all`` allows us to use |