diff options
author | Christopher Christofi <77968333+ChristopherChristofi@users.noreply.github.com> | 2023-11-30 08:46:02 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-30 09:46:02 +0100 |
commit | 3bc8a7aa5fb0560312728ec7acfced222e1e30c1 (patch) | |
tree | 8c3e101cce6fad229a5171fd6530c89f5cd019f3 /lib | |
parent | 3b045c289dabda35a8c754a8683fb4214c206d04 (diff) | |
download | spack-3bc8a7aa5fb0560312728ec7acfced222e1e30c1.tar.gz spack-3bc8a7aa5fb0560312728ec7acfced222e1e30c1.tar.bz2 spack-3bc8a7aa5fb0560312728ec7acfced222e1e30c1.tar.xz spack-3bc8a7aa5fb0560312728ec7acfced222e1e30c1.zip |
use double quotes where spack style finds errors (#41349)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/docs/build_systems/cmakepackage.rst | 40 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/intelpackage.rst | 14 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/luapackage.rst | 2 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/mavenpackage.rst | 14 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/mesonpackage.rst | 10 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/perlpackage.rst | 12 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/qmakepackage.rst | 8 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/rpackage.rst | 38 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/rubypackage.rst | 12 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/sippackage.rst | 2 | ||||
-rw-r--r-- | lib/spack/docs/build_systems/wafpackage.rst | 8 |
11 files changed, 80 insertions, 80 deletions
diff --git a/lib/spack/docs/build_systems/cmakepackage.rst b/lib/spack/docs/build_systems/cmakepackage.rst index fc1de918fd..6134c1b946 100644 --- a/lib/spack/docs/build_systems/cmakepackage.rst +++ b/lib/spack/docs/build_systems/cmakepackage.rst @@ -82,7 +82,7 @@ class already contains: .. code-block:: python - depends_on('cmake', type='build') + depends_on("cmake", type="build") If you need to specify a particular version requirement, you can @@ -90,7 +90,7 @@ override this in your package: .. code-block:: python - depends_on('cmake@2.8.12:', type='build') + depends_on("cmake@2.8.12:", type="build") ^^^^^^^^^^^^^^^^^^^ @@ -137,10 +137,10 @@ and without the :meth:`~spack.build_systems.cmake.CMakeBuilder.define` and def cmake_args(self): args = [ - '-DWHATEVER:STRING=somevalue', - self.define('ENABLE_BROKEN_FEATURE', False), - self.define_from_variant('DETECT_HDF5', 'hdf5'), - self.define_from_variant('THREADS'), # True if +threads + "-DWHATEVER:STRING=somevalue", + self.define("ENABLE_BROKEN_FEATURE", False), + self.define_from_variant("DETECT_HDF5", "hdf5"), + self.define_from_variant("THREADS"), # True if +threads ] return args @@ -151,10 +151,10 @@ and CMake simply ignores the empty command line argument. For example the follow .. code-block:: python - variant('example', default=True, when='@2.0:') + variant("example", default=True, when="@2.0:") def cmake_args(self): - return [self.define_from_variant('EXAMPLE', 'example')] + return [self.define_from_variant("EXAMPLE", "example")] will generate ``'cmake' '-DEXAMPLE=ON' ...`` when `@2.0: +example` is met, but will result in ``'cmake' '' ...`` when the spec version is below ``2.0``. @@ -193,9 +193,9 @@ a variant to control this: .. code-block:: python - variant('build_type', default='RelWithDebInfo', - description='CMake build type', - values=('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel')) + variant("build_type", default="RelWithDebInfo", + description="CMake build type", + values=("Debug", "Release", "RelWithDebInfo", "MinSizeRel")) However, not every CMake package accepts all four of these options. Grep the ``CMakeLists.txt`` file to see if the default values are @@ -205,9 +205,9 @@ package overrides the default variant with: .. code-block:: python - variant('build_type', default='DebugRelease', - description='The build type to build', - values=('Debug', 'Release', 'DebugRelease')) + variant("build_type", default="DebugRelease", + description="The build type to build", + values=("Debug", "Release", "DebugRelease")) For more information on ``CMAKE_BUILD_TYPE``, see: https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html @@ -250,7 +250,7 @@ generator is Ninja. To switch to the Ninja generator, simply add: .. code-block:: python - generator = 'Ninja' + generator = "Ninja" ``CMakePackage`` defaults to "Unix Makefiles". If you switch to the @@ -258,7 +258,7 @@ Ninja generator, make sure to add: .. code-block:: python - depends_on('ninja', type='build') + depends_on("ninja", type="build") to the package as well. Aside from that, you shouldn't need to do anything else. Spack will automatically detect that you are using @@ -288,7 +288,7 @@ like so: .. code-block:: python - root_cmakelists_dir = 'src' + root_cmakelists_dir = "src" Note that this path is relative to the root of the extracted tarball, @@ -304,7 +304,7 @@ different sub-directory, simply override ``build_directory`` like so: .. code-block:: python - build_directory = 'my-build' + build_directory = "my-build" ^^^^^^^^^^^^^^^^^^^^^^^^^ Build and install targets @@ -324,8 +324,8 @@ library or build the documentation, you can add these like so: .. code-block:: python - build_targets = ['all', 'docs'] - install_targets = ['install', 'docs'] + build_targets = ["all", "docs"] + install_targets = ["install", "docs"] ^^^^^^^ Testing diff --git a/lib/spack/docs/build_systems/intelpackage.rst b/lib/spack/docs/build_systems/intelpackage.rst index 9afe1a8b91..8b2905f19a 100644 --- a/lib/spack/docs/build_systems/intelpackage.rst +++ b/lib/spack/docs/build_systems/intelpackage.rst @@ -934,9 +934,9 @@ a *virtual* ``mkl`` package is declared in Spack. .. code-block:: python # Examples for absolute and conditional dependencies: - depends_on('mkl') - depends_on('mkl', when='+mkl') - depends_on('mkl', when='fftw=mkl') + depends_on("mkl") + depends_on("mkl", when="+mkl") + depends_on("mkl", when="fftw=mkl") The ``MKLROOT`` environment variable (part of the documented API) will be set during all stages of client package installation, and is available to both @@ -972,8 +972,8 @@ a *virtual* ``mkl`` package is declared in Spack. def configure_args(self): args = [] ... - args.append('--with-blas=%s' % self.spec['blas'].libs.ld_flags) - args.append('--with-lapack=%s' % self.spec['lapack'].libs.ld_flags) + args.append("--with-blas=%s" % self.spec["blas"].libs.ld_flags) + args.append("--with-lapack=%s" % self.spec["lapack"].libs.ld_flags) ... .. tip:: @@ -989,13 +989,13 @@ a *virtual* ``mkl`` package is declared in Spack. .. code-block:: python - self.spec['blas'].headers.include_flags + self.spec["blas"].headers.include_flags and to generate linker options (``-L<dir> -llibname ...``), use the same as above, .. code-block:: python - self.spec['blas'].libs.ld_flags + self.spec["blas"].libs.ld_flags See :ref:`MakefilePackage <makefilepackage>` diff --git a/lib/spack/docs/build_systems/luapackage.rst b/lib/spack/docs/build_systems/luapackage.rst index 71a0c3962c..c70d0de426 100644 --- a/lib/spack/docs/build_systems/luapackage.rst +++ b/lib/spack/docs/build_systems/luapackage.rst @@ -88,7 +88,7 @@ override the ``luarocks_args`` method like so: .. code-block:: python def luarocks_args(self): - return ['flag1', 'flag2'] + return ["flag1", "flag2"] One common use of this is to override warnings or flags for newer compilers, as in: diff --git a/lib/spack/docs/build_systems/mavenpackage.rst b/lib/spack/docs/build_systems/mavenpackage.rst index 70c57024ac..1e28cb5620 100644 --- a/lib/spack/docs/build_systems/mavenpackage.rst +++ b/lib/spack/docs/build_systems/mavenpackage.rst @@ -48,8 +48,8 @@ class automatically adds the following dependencies: .. code-block:: python - depends_on('java', type=('build', 'run')) - depends_on('maven', type='build') + depends_on("java", type=("build", "run")) + depends_on("maven", type="build") In the ``pom.xml`` file, you may see sections like: @@ -72,8 +72,8 @@ should add: .. code-block:: python - depends_on('java@7:', type='build') - depends_on('maven@3.5.4:', type='build') + depends_on("java@7:", type="build") + depends_on("maven@3.5.4:", type="build") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -88,9 +88,9 @@ the build phase. For example: def build_args(self): return [ - '-Pdist,native', - '-Dtar', - '-Dmaven.javadoc.skip=true' + "-Pdist,native", + "-Dtar", + "-Dmaven.javadoc.skip=true" ] diff --git a/lib/spack/docs/build_systems/mesonpackage.rst b/lib/spack/docs/build_systems/mesonpackage.rst index e2f2e0a99e..6b662c114e 100644 --- a/lib/spack/docs/build_systems/mesonpackage.rst +++ b/lib/spack/docs/build_systems/mesonpackage.rst @@ -86,8 +86,8 @@ the ``MesonPackage`` base class already contains: .. code-block:: python - depends_on('meson', type='build') - depends_on('ninja', type='build') + depends_on("meson", type="build") + depends_on("ninja", type="build") If you need to specify a particular version requirement, you can @@ -95,8 +95,8 @@ override this in your package: .. code-block:: python - depends_on('meson@0.43.0:', type='build') - depends_on('ninja', type='build') + depends_on("meson@0.43.0:", type="build") + depends_on("ninja", type="build") ^^^^^^^^^^^^^^^^^^^ @@ -121,7 +121,7 @@ override the ``meson_args`` method like so: .. code-block:: python def meson_args(self): - return ['--warnlevel=3'] + return ["--warnlevel=3"] This method can be used to pass flags as well as variables. diff --git a/lib/spack/docs/build_systems/perlpackage.rst b/lib/spack/docs/build_systems/perlpackage.rst index c29dfaad55..11fa243226 100644 --- a/lib/spack/docs/build_systems/perlpackage.rst +++ b/lib/spack/docs/build_systems/perlpackage.rst @@ -118,7 +118,7 @@ so ``PerlPackage`` contains: .. code-block:: python - extends('perl') + extends("perl") If your package requires a specific version of Perl, you should @@ -132,14 +132,14 @@ properly. If your package uses ``Makefile.PL`` to build, add: .. code-block:: python - depends_on('perl-extutils-makemaker', type='build') + depends_on("perl-extutils-makemaker", type="build") If your package uses ``Build.PL`` to build, add: .. code-block:: python - depends_on('perl-module-build', type='build') + depends_on("perl-module-build", type="build") ^^^^^^^^^^^^^^^^^ @@ -165,11 +165,11 @@ arguments to ``Makefile.PL`` or ``Build.PL`` by overriding .. code-block:: python def configure_args(self): - expat = self.spec['expat'].prefix + expat = self.spec["expat"].prefix return [ - 'EXPATLIBPATH={0}'.format(expat.lib), - 'EXPATINCPATH={0}'.format(expat.include), + "EXPATLIBPATH={0}".format(expat.lib), + "EXPATINCPATH={0}".format(expat.include), ] diff --git a/lib/spack/docs/build_systems/qmakepackage.rst b/lib/spack/docs/build_systems/qmakepackage.rst index 98d625ede0..0956bd80fb 100644 --- a/lib/spack/docs/build_systems/qmakepackage.rst +++ b/lib/spack/docs/build_systems/qmakepackage.rst @@ -83,7 +83,7 @@ base class already contains: .. code-block:: python - depends_on('qt', type='build') + depends_on("qt", type="build") If you want to specify a particular version requirement, or need to @@ -91,7 +91,7 @@ link to the ``qt`` libraries, you can override this in your package: .. code-block:: python - depends_on('qt@5.6.0:') + depends_on("qt@5.6.0:") ^^^^^^^^^^^^^^^^^^^^^^^^^^ Passing arguments to qmake @@ -103,7 +103,7 @@ override the ``qmake_args`` method like so: .. code-block:: python def qmake_args(self): - return ['-recursive'] + return ["-recursive"] This method can be used to pass flags as well as variables. @@ -118,7 +118,7 @@ sub-directory by adding the following to the package: .. code-block:: python - build_directory = 'src' + build_directory = "src" ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/lib/spack/docs/build_systems/rpackage.rst b/lib/spack/docs/build_systems/rpackage.rst index a5a5fcee31..6781c62484 100644 --- a/lib/spack/docs/build_systems/rpackage.rst +++ b/lib/spack/docs/build_systems/rpackage.rst @@ -163,28 +163,28 @@ attributes that can be used to set ``homepage``, ``url``, ``list_url``, and .. code-block:: python - cran = 'caret' + cran = "caret" is equivalent to: .. code-block:: python - homepage = 'https://cloud.r-project.org/package=caret' - url = 'https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz' - list_url = 'https://cloud.r-project.org/src/contrib/Archive/caret' + homepage = "https://cloud.r-project.org/package=caret" + url = "https://cloud.r-project.org/src/contrib/caret_6.0-86.tar.gz" + list_url = "https://cloud.r-project.org/src/contrib/Archive/caret" Likewise, the following ``bioc`` attribute: .. code-block:: python - bioc = 'BiocVersion' + bioc = "BiocVersion" is equivalent to: .. code-block:: python - homepage = 'https://bioconductor.org/packages/BiocVersion/' - git = 'https://git.bioconductor.org/packages/BiocVersion' + homepage = "https://bioconductor.org/packages/BiocVersion/" + git = "https://git.bioconductor.org/packages/BiocVersion" ^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -200,7 +200,7 @@ base class contains: .. code-block:: python - extends('r') + extends("r") Take a close look at the homepage for ``caret``. If you look at the @@ -209,7 +209,7 @@ You should add this to your package like so: .. code-block:: python - depends_on('r@3.2.0:', type=('build', 'run')) + depends_on("r@3.2.0:", type=("build", "run")) ^^^^^^^^^^^^^^ @@ -227,7 +227,7 @@ and list all of their dependencies in the following sections: * LinkingTo As far as Spack is concerned, all 3 of these dependency types -correspond to ``type=('build', 'run')``, so you don't have to worry +correspond to ``type=("build", "run")``, so you don't have to worry about the details. If you are curious what they mean, https://github.com/spack/spack/issues/2951 has a pretty good summary: @@ -330,7 +330,7 @@ the dependency: .. code-block:: python - depends_on('r-lattice@0.20:', type=('build', 'run')) + depends_on("r-lattice@0.20:", type=("build", "run")) ^^^^^^^^^^^^^^^^^^ @@ -361,20 +361,20 @@ like so: .. code-block:: python def configure_args(self): - mpi_name = self.spec['mpi'].name + mpi_name = self.spec["mpi"].name # The type of MPI. Supported values are: # OPENMPI, LAM, MPICH, MPICH2, or CRAY - if mpi_name == 'openmpi': - Rmpi_type = 'OPENMPI' - elif mpi_name == 'mpich': - Rmpi_type = 'MPICH2' + if mpi_name == "openmpi": + Rmpi_type = "OPENMPI" + elif mpi_name == "mpich": + Rmpi_type = "MPICH2" else: - raise InstallError('Unsupported MPI type') + raise InstallError("Unsupported MPI type") return [ - '--with-Rmpi-type={0}'.format(Rmpi_type), - '--with-mpi={0}'.format(spec['mpi'].prefix), + "--with-Rmpi-type={0}".format(Rmpi_type), + "--with-mpi={0}".format(spec["mpi"].prefix), ] diff --git a/lib/spack/docs/build_systems/rubypackage.rst b/lib/spack/docs/build_systems/rubypackage.rst index d5c38b863b..ec60765eb1 100644 --- a/lib/spack/docs/build_systems/rubypackage.rst +++ b/lib/spack/docs/build_systems/rubypackage.rst @@ -84,8 +84,8 @@ The ``*.gemspec`` file may contain something like: .. code-block:: ruby - summary = 'An implementation of the AsciiDoc text processor and publishing toolchain' - description = 'A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML 5, DocBook 5, and other formats.' + summary = "An implementation of the AsciiDoc text processor and publishing toolchain" + description = "A fast, open source text processor and publishing toolchain for converting AsciiDoc content to HTML 5, DocBook 5, and other formats." Either of these can be used for the description of the Spack package. @@ -98,7 +98,7 @@ The ``*.gemspec`` file may contain something like: .. code-block:: ruby - homepage = 'https://asciidoctor.org' + homepage = "https://asciidoctor.org" This should be used as the official homepage of the Spack package. @@ -112,21 +112,21 @@ the base class contains: .. code-block:: python - extends('ruby') + extends("ruby") The ``*.gemspec`` file may contain something like: .. code-block:: ruby - required_ruby_version = '>= 2.3.0' + required_ruby_version = ">= 2.3.0" This can be added to the Spack package using: .. code-block:: python - depends_on('ruby@2.3.0:', type=('build', 'run')) + depends_on("ruby@2.3.0:", type=("build", "run")) ^^^^^^^^^^^^^^^^^ diff --git a/lib/spack/docs/build_systems/sippackage.rst b/lib/spack/docs/build_systems/sippackage.rst index a4f52bf186..06d3ba5626 100644 --- a/lib/spack/docs/build_systems/sippackage.rst +++ b/lib/spack/docs/build_systems/sippackage.rst @@ -124,7 +124,7 @@ are wrong, you can provide the names yourself by overriding .. code-block:: python - import_modules = ['PyQt5'] + import_modules = ["PyQt5"] These tests often catch missing dependencies and non-RPATHed diff --git a/lib/spack/docs/build_systems/wafpackage.rst b/lib/spack/docs/build_systems/wafpackage.rst index c9bbf8bb5a..6b2abc9a8f 100644 --- a/lib/spack/docs/build_systems/wafpackage.rst +++ b/lib/spack/docs/build_systems/wafpackage.rst @@ -63,8 +63,8 @@ run package-specific unit tests. .. code-block:: python def installtest(self): - with working_dir('test'): - pytest = which('py.test') + with working_dir("test"): + pytest = which("py.test") pytest() @@ -93,7 +93,7 @@ the following dependency automatically: .. code-block:: python - depends_on('python@2.5:', type='build') + depends_on("python@2.5:", type="build") Waf only supports Python 2.5 and up. @@ -113,7 +113,7 @@ phase, you can use: args = [] if self.run_tests: - args.append('--test') + args.append("--test") return args |