From 6b13017deda65c3f69a0a3acb06acb13c7267ba6 Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Fri, 31 Jan 2025 08:21:44 +0100 Subject: [PATCH] Remove unused values (#48795) Signed-off-by: Todd Gamblin Co-authored-by: Todd Gamblin --- lib/spack/spack/cmd/test.py | 17 +++++----- lib/spack/spack/main.py | 2 +- lib/spack/spack/package_base.py | 4 --- lib/spack/spack/spec.py | 5 ++- lib/spack/spack/test/ci.py | 14 ++++---- lib/spack/spack/test/cmd/gc.py | 2 +- lib/spack/spack/test/cmd/load.py | 10 +++--- .../spack/test/concretization/flag_mixing.py | 23 +++++++------ lib/spack/spack/test/llnl/util/lock.py | 31 ++++++++--------- lib/spack/spack/test/reporters.py | 3 +- lib/spack/spack/test/sbang.py | 2 +- lib/spack/spack/test/spec_dag.py | 34 +++++++++---------- lib/spack/spack/test/stage.py | 2 +- lib/spack/spack/test/util/compression.py | 7 +--- .../repos/builtin/packages/7zip/package.py | 4 +-- .../builtin/packages/amdlibflame/package.py | 4 +-- .../repos/builtin/packages/dyninst/package.py | 5 +-- .../builtin/packages/elemental/package.py | 4 +-- .../repos/builtin/packages/embree/package.py | 2 +- .../builtin/packages/foam-extend/package.py | 2 +- .../repos/builtin/packages/gurobi/package.py | 2 +- .../repos/builtin/packages/h5bench/package.py | 4 +-- .../repos/builtin/packages/hip/package.py | 8 ++--- .../repos/builtin/packages/kokkos/package.py | 2 +- .../builtin/packages/lc-framework/package.py | 2 +- .../repos/builtin/packages/lcals/package.py | 29 +++++++++------- .../packages/openradioss-engine/package.py | 4 +-- .../packages/openradioss-starter/package.py | 4 +-- .../builtin/packages/paraview/package.py | 2 +- .../packages/py-jupyter-telemetry/package.py | 5 ++- .../builtin/packages/rocm-opencl/package.py | 2 +- .../packages/rocm-openmp-extras/package.py | 6 ++-- .../packages/rocm-validation-suite/package.py | 4 +-- .../repos/builtin/packages/slate/package.py | 4 +-- .../repos/builtin/packages/vtk-h/package.py | 6 ++-- 35 files changed, 127 insertions(+), 134 deletions(-) diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index 90e78cb1236..8e420b665d9 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -177,16 +177,15 @@ def test_run(args): matching = spack.store.STORE.db.query_local(spec, hashes=hashes, explicit=explicit) if spec and not matching: tty.warn("No {0}installed packages match spec {1}".format(explicit_str, spec)) - """ - TODO: Need to write out a log message and/or CDASH Testing - output that package not installed IF continue to process - these issues here. - if args.log_format: - # Proceed with the spec assuming the test process - # to ensure report package as skipped (e.g., for CI) - specs_to_test.append(spec) - """ + # TODO: Need to write out a log message and/or CDASH Testing + # output that package not installed IF continue to process + # these issues here. + + # if args.log_format: + # # Proceed with the spec assuming the test process + # # to ensure report package as skipped (e.g., for CI) + # specs_to_test.append(spec) specs_to_test.extend(matching) diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 2c353a3e59c..8907022009c 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -163,7 +163,7 @@ def format_help_sections(self, level): # lazily add all commands to the parser when needed. add_all_commands(self) - """Print help on subcommands in neatly formatted sections.""" + # Print help on subcommands in neatly formatted sections. formatter = self._get_formatter() # Create a list of subcommand actions. Argparse internals are nasty! diff --git a/lib/spack/spack/package_base.py b/lib/spack/spack/package_base.py index c8a52eb4bb2..42eab851aa3 100644 --- a/lib/spack/spack/package_base.py +++ b/lib/spack/spack/package_base.py @@ -66,10 +66,6 @@ ] FLAG_HANDLER_TYPE = Callable[[str, Iterable[str]], FLAG_HANDLER_RETURN_TYPE] -"""Allowed URL schemes for spack packages.""" -_ALLOWED_URL_SCHEMES = ["http", "https", "ftp", "file", "git"] - - #: Filename for the Spack build/install log. _spack_build_logfile = "spack-build-out.txt" diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index 78202b65e98..fed7f28e9f9 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -4726,7 +4726,10 @@ def __str__(self): bool_keys = [] kv_keys = [] for key in sorted_keys: - bool_keys.append(key) if isinstance(self[key].value, bool) else kv_keys.append(key) + if isinstance(self[key].value, bool): + bool_keys.append(key) + else: + kv_keys.append(key) # add spaces before and after key/value variants. string = io.StringIO() diff --git a/lib/spack/spack/test/ci.py b/lib/spack/spack/test/ci.py index f951c0664db..9d00825ec3d 100644 --- a/lib/spack/spack/test/ci.py +++ b/lib/spack/spack/test/ci.py @@ -328,16 +328,14 @@ def test_get_spec_filter_list(mutable_mock_env_path, mutable_mock_repo): e1.add("hypre") e1.concretize() - """ - Concretizing the above environment results in the following graphs: + # Concretizing the above environment results in the following graphs: - mpileaks -> mpich (provides mpi virtual dep of mpileaks) - -> callpath -> dyninst -> libelf - -> libdwarf -> libelf - -> mpich (provides mpi dep of callpath) + # mpileaks -> mpich (provides mpi virtual dep of mpileaks) + # -> callpath -> dyninst -> libelf + # -> libdwarf -> libelf + # -> mpich (provides mpi dep of callpath) - hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre) - """ + # hypre -> openblas-with-lapack (provides lapack and blas virtual deps of hypre) touched = ["libdwarf"] diff --git a/lib/spack/spack/test/cmd/gc.py b/lib/spack/spack/test/cmd/gc.py index b557f5b57ff..24131b311c9 100644 --- a/lib/spack/spack/test/cmd/gc.py +++ b/lib/spack/spack/test/cmd/gc.py @@ -139,7 +139,7 @@ def test_gc_except_specific_environments(mutable_database, mutable_mock_env_path def test_gc_except_nonexisting_dir_env(mutable_database, mutable_mock_env_path, tmpdir): output = gc("-ye", tmpdir.strpath, fail_on_error=False) assert "No such environment" in output - gc.returncode == 1 + assert gc.returncode == 1 @pytest.mark.db diff --git a/lib/spack/spack/test/cmd/load.py b/lib/spack/spack/test/cmd/load.py index c0e1a03c799..125a8ed0325 100644 --- a/lib/spack/spack/test/cmd/load.py +++ b/lib/spack/spack/test/cmd/load.py @@ -26,9 +26,9 @@ def test_manpath_trailing_colon( else ("--sh", "export %s=%s", ";") ) - """Test that the commands generated by load add the MANPATH prefix - inspections. Also test that Spack correctly preserves the default/existing - manpath search path via a trailing colon""" + # Test that the commands generated by load add the MANPATH prefix + # inspections. Also test that Spack correctly preserves the default/existing + # manpath search path via a trailing colon install("mpileaks") sh_out = load(shell, "mpileaks") @@ -81,7 +81,9 @@ def extract_value(output, variable): # Finally, do we list them in topo order? for i, pkg in enumerate(pkgs): - set(s.name for s in mpileaks_spec[pkg].traverse(direction="parents")) in set(pkgs[:i]) + assert {s.name for s in mpileaks_spec[pkg].traverse(direction="parents")}.issubset( + pkgs[: i + 1] + ) # Lastly, do we keep track that mpileaks was loaded? assert ( diff --git a/lib/spack/spack/test/concretization/flag_mixing.py b/lib/spack/spack/test/concretization/flag_mixing.py index 281b5122afe..b5e8f3a9604 100644 --- a/lib/spack/spack/test/concretization/flag_mixing.py +++ b/lib/spack/spack/test/concretization/flag_mixing.py @@ -1,17 +1,6 @@ # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import pathlib - -import pytest - -import spack.concretize -import spack.config -import spack.environment as ev -import spack.paths -import spack.repo -import spack.spec -import spack.util.spack_yaml as syaml """ These tests include the following package DAGs: @@ -42,6 +31,18 @@ y """ +import pathlib + +import pytest + +import spack.concretize +import spack.config +import spack.environment as ev +import spack.paths +import spack.repo +import spack.spec +import spack.util.spack_yaml as syaml + @pytest.fixture def test_repo(mutable_config, monkeypatch, mock_stage): diff --git a/lib/spack/spack/test/llnl/util/lock.py b/lib/spack/spack/test/llnl/util/lock.py index 8e737b2bfde..66822b86991 100644 --- a/lib/spack/spack/test/llnl/util/lock.py +++ b/lib/spack/spack/test/llnl/util/lock.py @@ -93,28 +93,26 @@ pass -"""This is a list of filesystem locations to test locks in. Paths are -expanded so that %u is replaced with the current username. '~' is also -legal and will be expanded to the user's home directory. - -Tests are skipped for directories that don't exist, so you'll need to -update this with the locations of NFS, Lustre, and other mounts on your -system. -""" +#: This is a list of filesystem locations to test locks in. Paths are +#: expanded so that %u is replaced with the current username. '~' is also +#: legal and will be expanded to the user's home directory. +#: +#: Tests are skipped for directories that don't exist, so you'll need to +#: update this with the locations of NFS, Lustre, and other mounts on your +#: system. locations = [ tempfile.gettempdir(), os.path.join("/nfs/tmp2/", getpass.getuser()), os.path.join("/p/lscratch*/", getpass.getuser()), ] -"""This is the longest a failed multiproc test will take. -Barriers will time out and raise an exception after this interval. -In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test. -""" +#: This is the longest a failed multiproc test will take. +#: Barriers will time out and raise an exception after this interval. +#: In MPI mode, barriers don't time out (they hang). See mpi_multiproc_test. barrier_timeout = 5 -"""This is the lock timeout for expected failures. -This may need to be higher for some filesystems.""" +#: This is the lock timeout for expected failures. +#: This may need to be higher for some filesystems. lock_fail_timeout = 0.1 @@ -286,9 +284,8 @@ def wait(self): comm.Barrier() # barrier after each MPI test. -"""``multiproc_test()`` should be called by tests below. -``multiproc_test()`` will work for either MPI runs or for local runs. -""" +#: ``multiproc_test()`` should be called by tests below. +#: ``multiproc_test()`` will work for either MPI runs or for local runs. multiproc_test = mpi_multiproc_test if mpi else local_multiproc_test diff --git a/lib/spack/spack/test/reporters.py b/lib/spack/spack/test/reporters.py index 1b81700fffc..2d587a38241 100644 --- a/lib/spack/spack/test/reporters.py +++ b/lib/spack/spack/test/reporters.py @@ -132,7 +132,8 @@ def test_reporters_extract_skipped(state): parts = spack.reporters.extract.extract_test_parts("fake", outputs) assert len(parts) == 1 - parts[0]["completed"] == expected + + assert parts[0]["completed"] == spack.reporters.extract.completed["skipped"] def test_reporters_skip_new(): diff --git a/lib/spack/spack/test/sbang.py b/lib/spack/spack/test/sbang.py index d840d097102..1917e12a65c 100644 --- a/lib/spack/spack/test/sbang.py +++ b/lib/spack/spack/test/sbang.py @@ -198,7 +198,7 @@ def script_dir(sbang_line): ], ) def test_shebang_interpreter_regex(shebang, interpreter): - sbang.get_interpreter(shebang) == interpreter + assert sbang.get_interpreter(shebang) == interpreter def test_shebang_handling(script_dir, sbang_line): diff --git a/lib/spack/spack/test/spec_dag.py b/lib/spack/spack/test/spec_dag.py index 8a39f07dbdd..1741cccc8f0 100644 --- a/lib/spack/spack/test/spec_dag.py +++ b/lib/spack/spack/test/spec_dag.py @@ -428,31 +428,29 @@ def test_copy_through_spec_build_interface(self): c2 = s["mpileaks"]["mpileaks"].copy() assert c0 == c1 == c2 == s - """ - Here is the graph with deptypes labeled (assume all packages have a 'dt' - prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for - 'link', 'r' for 'run'). + # Here is the graph with deptypes labeled (assume all packages have a 'dt' + # prefix). Arrows are marked with the deptypes ('b' for 'build', 'l' for + # 'link', 'r' for 'run'). - use -bl-> top + # use -bl-> top - top -b-> build1 - top -bl-> link1 - top -r-> run1 + # top -b-> build1 + # top -bl-> link1 + # top -r-> run1 - build1 -b-> build2 - build1 -bl-> link2 - build1 -r-> run2 + # build1 -b-> build2 + # build1 -bl-> link2 + # build1 -r-> run2 - link1 -bl-> link3 + # link1 -bl-> link3 - run1 -bl-> link5 - run1 -r-> run3 + # run1 -bl-> link5 + # run1 -r-> run3 - link3 -b-> build2 - link3 -bl-> link4 + # link3 -b-> build2 + # link3 -bl-> link4 - run3 -b-> build3 - """ + # run3 -b-> build3 @pytest.mark.parametrize( "spec_str,deptypes,expected", diff --git a/lib/spack/spack/test/stage.py b/lib/spack/spack/test/stage.py index c7b9a871b35..71eafcbd20a 100644 --- a/lib/spack/spack/test/stage.py +++ b/lib/spack/spack/test/stage.py @@ -125,7 +125,7 @@ def check_expand_archive(stage, stage_name, expected_file_list): assert os.path.isfile(fn) with open(fn, encoding="utf-8") as _file: - _file.read() == contents + assert _file.read() == contents def check_fetch(stage, stage_name): diff --git a/lib/spack/spack/test/util/compression.py b/lib/spack/spack/test/util/compression.py index e4ff5746f74..4fbda590a7f 100644 --- a/lib/spack/spack/test/util/compression.py +++ b/lib/spack/spack/test/util/compression.py @@ -20,12 +20,7 @@ datadir = os.path.join(spack_root, "lib", "spack", "spack", "test", "data", "compression") -ext_archive = {} -[ - ext_archive.update({ext: ".".join(["Foo", ext])}) - for ext in llnl.url.ALLOWED_ARCHIVE_TYPES - if "TAR" not in ext -] +ext_archive = {ext: f"Foo.{ext}" for ext in llnl.url.ALLOWED_ARCHIVE_TYPES if "TAR" not in ext} # Spack does not use Python native handling for tarballs or zip # Don't test tarballs or zip in native test native_archive_list = [ diff --git a/var/spack/repos/builtin/packages/7zip/package.py b/var/spack/repos/builtin/packages/7zip/package.py index 8dd9d89caf9..2f69729e47d 100644 --- a/var/spack/repos/builtin/packages/7zip/package.py +++ b/var/spack/repos/builtin/packages/7zip/package.py @@ -100,10 +100,8 @@ def install(self, spec, prefix): for ext in exts: glob_str = os.path.join(pth, ext) files = glob.glob(glob_str) - [ + for x in files: shutil.copy( os.path.join(self._7z_src_dir, x), os.path.join(prefix, os.path.basename(x)), ) - for x in files - ] diff --git a/var/spack/repos/builtin/packages/amdlibflame/package.py b/var/spack/repos/builtin/packages/amdlibflame/package.py index 4ceac71f7b9..3c07796f70a 100644 --- a/var/spack/repos/builtin/packages/amdlibflame/package.py +++ b/var/spack/repos/builtin/packages/amdlibflame/package.py @@ -202,8 +202,8 @@ def configure_args(self): args.append("--enable-void-return-complex") if spec.satisfies("@3.0:3.1 %aocc"): - """To enabled Fortran to C calling convention for - complex types when compiling with aocc flang""" + # To enable Fortran to C calling convention for complex types when compiling with + # aocc flang args.append("--enable-f2c-dotc") if spec.satisfies("@3.0.1: +ilp64"): diff --git a/var/spack/repos/builtin/packages/dyninst/package.py b/var/spack/repos/builtin/packages/dyninst/package.py index ebf0604070a..7fe816c5ad5 100644 --- a/var/spack/repos/builtin/packages/dyninst/package.py +++ b/var/spack/repos/builtin/packages/dyninst/package.py @@ -63,8 +63,9 @@ class Dyninst(CMakePackage): variant("stat_dysect", default=False, description="Patch for STAT's DySectAPI") - boost_libs = "+atomic+chrono+date_time+filesystem+system+thread+timer" - "+container+random+exception" + boost_libs = ( + "+atomic+chrono+date_time+filesystem+system+thread+timer+container+random+exception" + ) depends_on("boost@1.61.0:" + boost_libs, when="@10.1.0:") depends_on("boost@1.61.0:1.69" + boost_libs, when="@:10.0") diff --git a/var/spack/repos/builtin/packages/elemental/package.py b/var/spack/repos/builtin/packages/elemental/package.py index bfa75cd2f57..cb1aa30e3fc 100644 --- a/var/spack/repos/builtin/packages/elemental/package.py +++ b/var/spack/repos/builtin/packages/elemental/package.py @@ -150,7 +150,7 @@ def cmake_args(self): ), "-DCUSTOM_BLAS_SUFFIX:BOOL=TRUE", ] - ), + ) if spec.satisfies("+scalapack"): args.extend( [ @@ -159,7 +159,7 @@ def cmake_args(self): ), "-DCUSTOM_LAPACK_SUFFIX:BOOL=TRUE", ] - ), + ) else: math_libs = spec["lapack"].libs + spec["blas"].libs diff --git a/var/spack/repos/builtin/packages/embree/package.py b/var/spack/repos/builtin/packages/embree/package.py index d12f2007d8a..f49be60f32c 100644 --- a/var/spack/repos/builtin/packages/embree/package.py +++ b/var/spack/repos/builtin/packages/embree/package.py @@ -80,7 +80,7 @@ def cmake_args(self): avx512_suffix = "" if spec.satisfies("@:3.12"): avx512_suffix = "SKX" - args.append(self.define("EMBREE_ISA_AVX512" + avx512_suffix, True)), + args.append(self.define("EMBREE_ISA_AVX512" + avx512_suffix, True)) if spec.satisfies("%gcc@:7"): # remove unsupported -mprefer-vector-width=256, otherwise copied # from common/cmake/gnu.cmake diff --git a/var/spack/repos/builtin/packages/foam-extend/package.py b/var/spack/repos/builtin/packages/foam-extend/package.py index 1dccd39b69a..adad6aa4ad6 100644 --- a/var/spack/repos/builtin/packages/foam-extend/package.py +++ b/var/spack/repos/builtin/packages/foam-extend/package.py @@ -170,7 +170,7 @@ def setup_run_environment(self, env): if minimal: # pre-build or minimal environment tty.info("foam-extend minimal env {0}".format(self.prefix)) - env.set("FOAM_INST_DIR", os.path.dirname(self.projectdir)), + env.set("FOAM_INST_DIR", os.path.dirname(self.projectdir)) env.set("FOAM_PROJECT_DIR", self.projectdir) env.set("WM_PROJECT_DIR", self.projectdir) for d in ["wmake", self.archbin]: # bin added automatically diff --git a/var/spack/repos/builtin/packages/gurobi/package.py b/var/spack/repos/builtin/packages/gurobi/package.py index 565a87a4160..aa6c46e936c 100644 --- a/var/spack/repos/builtin/packages/gurobi/package.py +++ b/var/spack/repos/builtin/packages/gurobi/package.py @@ -53,7 +53,7 @@ def patch(self): def setup_run_environment(self, env): env.set("GUROBI_HOME", self.prefix) env.set("GRB_LICENSE_FILE", join_path(self.prefix, "gurobi.lic")) - env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib), + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) def install(self, spec, prefix): install_tree("linux64", prefix) diff --git a/var/spack/repos/builtin/packages/h5bench/package.py b/var/spack/repos/builtin/packages/h5bench/package.py index 4f5598f5130..3c89cdf177e 100644 --- a/var/spack/repos/builtin/packages/h5bench/package.py +++ b/var/spack/repos/builtin/packages/h5bench/package.py @@ -74,8 +74,8 @@ def setup_build_tests(self): filter_file("mpirun", f"{launcher}", filename) filter_file(r"-n 2", "-n 1 --timeout 240", filename) - """Copy the example source files after the package is installed to an - install test subdirectory for use during `spack test run`.""" + # Copy the example source files after the package is installed to an + # install test subdirectory for use during `spack test run`. cache_extra_test_sources(self, ["tests", "samples"]) def mpi_launcher(self): diff --git a/var/spack/repos/builtin/packages/hip/package.py b/var/spack/repos/builtin/packages/hip/package.py index 438f940ec35..f163900475d 100644 --- a/var/spack/repos/builtin/packages/hip/package.py +++ b/var/spack/repos/builtin/packages/hip/package.py @@ -666,12 +666,12 @@ def cmake_args(self): if self.spec.satisfies("@5.6.0:"): args.append(self.define("ROCCLR_PATH", self.stage.source_path + "/clr/rocclr")) args.append(self.define("AMD_OPENCL_PATH", self.stage.source_path + "/clr/opencl")) - args.append(self.define("CLR_BUILD_HIP", True)), - args.append(self.define("CLR_BUILD_OCL", False)), + args.append(self.define("CLR_BUILD_HIP", True)) + args.append(self.define("CLR_BUILD_OCL", False)) if self.spec.satisfies("@5.6:5.7"): - args.append(self.define("HIPCC_BIN_DIR", self.stage.source_path + "/hipcc/bin")), + args.append(self.define("HIPCC_BIN_DIR", self.stage.source_path + "/hipcc/bin")) if self.spec.satisfies("@6.0:"): - args.append(self.define("HIPCC_BIN_DIR", self.spec["hipcc"].prefix.bin)), + args.append(self.define("HIPCC_BIN_DIR", self.spec["hipcc"].prefix.bin)) return args test_src_dir_old = "samples" diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py index 646184ab321..a9a717684ad 100644 --- a/var/spack/repos/builtin/packages/kokkos/package.py +++ b/var/spack/repos/builtin/packages/kokkos/package.py @@ -513,7 +513,7 @@ def setup_build_tests(self): cmake_source_path = join_path(self.stage.source_path, self.test_script_relative_path) if not os.path.exists(cmake_source_path): return - """Copy test.""" + # Copy test cmake_out_path = join_path(self.test_script_relative_path, "out") cmake_args = [ cmake_source_path, diff --git a/var/spack/repos/builtin/packages/lc-framework/package.py b/var/spack/repos/builtin/packages/lc-framework/package.py index 5da5a9fec7e..c2cbd96d916 100644 --- a/var/spack/repos/builtin/packages/lc-framework/package.py +++ b/var/spack/repos/builtin/packages/lc-framework/package.py @@ -10,7 +10,7 @@ def try_le(x, y): try: return int(x) < y except ValueError: - False + return False class LcFramework(CMakePackage, CudaPackage): diff --git a/var/spack/repos/builtin/packages/lcals/package.py b/var/spack/repos/builtin/packages/lcals/package.py index 7dbcb05877b..a9b4dd891d8 100644 --- a/var/spack/repos/builtin/packages/lcals/package.py +++ b/var/spack/repos/builtin/packages/lcals/package.py @@ -53,30 +53,35 @@ def build_targets(self): if self.compiler.name == "intel": if arch == "MIC": cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_ICC " - cxx_compile += "-g -O3 -mmic -vec-report3 " - " -inline-max-total-size=10000 -inline-forceinline -ansi-alias" + cxx_compile += ( + "-g -O3 -mmic -vec-report3 " + " -inline-max-total-size=10000 -inline-forceinline -ansi-alias" + ) elif microarch == "sse" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_ICC " - cxx_compile += "-O3 -msse4.1 -inline-max-total-size=10000" - " -inline-forceinline -ansi-alias -std=c++0x " + cxx_compile += ( + "-O3 -msse4.1 -inline-max-total-size=10000" + " -inline-forceinline -ansi-alias -std=c++0x " + ) elif microarch == "avx" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_AVX -DLCALS_COMPILER_ICC " - cxx_compile += "-O3 -mavx -inline-max-total-size=10000" - " -inline-forceinline -ansi-alias -std=c++0x" + cxx_compile += ( + "-O3 -mavx -inline-max-total-size=10000" + " -inline-forceinline -ansi-alias -std=c++0x" + ) cxxflags += self.compiler.openmp_flag elif self.compiler.name == "gcc": if arch == "MIC" or (microarch == "sse" and arch == "x86"): cxxflags += "-DLCALS_PLATFORM_X86_SSE -DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -msse4.1 -finline-functions" - " -finline-limit=10000 -std=c++11 " + cxx_compile += ( + "-Ofast -msse4.1 -finline-functions" " -finline-limit=10000 -std=c++11 " + ) elif microarch == "avx" and arch == "x86": cxxflags += "-DLCALS_PLATFORM_X86_AVX -DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -mavx -finline-functions" - " -finline-limit=10000 -std=c++11" + cxx_compile += "-Ofast -mavx -finline-functions" " -finline-limit=10000 -std=c++11" elif arch == "aarch64": cxxflags += "-DLCALS_COMPILER_GNU " - cxx_compile += "-Ofast -finline-functions" - " -finline-limit=10000 -std=c++11" + cxx_compile += "-Ofast -finline-functions" " -finline-limit=10000 -std=c++11" cxxflags += self.compiler.openmp_flag targets.append("LCALS_ARCH=") diff --git a/var/spack/repos/builtin/packages/openradioss-engine/package.py b/var/spack/repos/builtin/packages/openradioss-engine/package.py index e7ab1f8b811..bdfd4e5b88c 100644 --- a/var/spack/repos/builtin/packages/openradioss-engine/package.py +++ b/var/spack/repos/builtin/packages/openradioss-engine/package.py @@ -110,10 +110,10 @@ def install(self, spec, prefix): ) install_tree( join_path(self.stage.source_path, "hm_cfg_files"), join_path(prefix, "hm_cfg_files") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "h3d"), join_path(prefix, "extlib", "h3d") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "hm_reader"), join_path(prefix, "extlib", "hm_reader"), diff --git a/var/spack/repos/builtin/packages/openradioss-starter/package.py b/var/spack/repos/builtin/packages/openradioss-starter/package.py index 4af3dc15163..b528036a56b 100644 --- a/var/spack/repos/builtin/packages/openradioss-starter/package.py +++ b/var/spack/repos/builtin/packages/openradioss-starter/package.py @@ -96,10 +96,10 @@ def install(self, spec, prefix): ) install_tree( join_path(self.stage.source_path, "hm_cfg_files"), join_path(prefix, "hm_cfg_files") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "h3d"), join_path(prefix, "extlib", "h3d") - ), + ) install_tree( join_path(self.stage.source_path, "extlib", "hm_reader"), join_path(prefix, "extlib", "hm_reader"), diff --git a/var/spack/repos/builtin/packages/paraview/package.py b/var/spack/repos/builtin/packages/paraview/package.py index 6a480c2c00a..77ba1e4c2af 100644 --- a/var/spack/repos/builtin/packages/paraview/package.py +++ b/var/spack/repos/builtin/packages/paraview/package.py @@ -386,7 +386,7 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage): def url_for_version(self, version): _urlfmt = "http://www.paraview.org/files/v{0}/ParaView-v{1}{2}.tar.{3}" - """Handle ParaView version-based custom URLs.""" + # Handle ParaView version-based custom URLs if version < Version("5.1.0"): return _urlfmt.format(version.up_to(2), version, "-source", "gz") elif version < Version("5.6.1"): diff --git a/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py b/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py index a510859f39c..a756499b9af 100644 --- a/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py +++ b/var/spack/repos/builtin/packages/py-jupyter-telemetry/package.py @@ -6,9 +6,8 @@ class PyJupyterTelemetry(PythonPackage): - """Jupyter Telemetry enables Jupyter Applications to record events and transmit""" - - """ them to destinations as structured data""" + """Jupyter Telemetry enables Jupyter Applications to record events and transmit them to + destinations as structured data""" pypi = "jupyter-telemetry/jupyter_telemetry-0.1.0.tar.gz" diff --git a/var/spack/repos/builtin/packages/rocm-opencl/package.py b/var/spack/repos/builtin/packages/rocm-opencl/package.py index 597226e10e8..e45f0852af6 100644 --- a/var/spack/repos/builtin/packages/rocm-opencl/package.py +++ b/var/spack/repos/builtin/packages/rocm-opencl/package.py @@ -210,7 +210,7 @@ def setup_build_environment(self, env): env.set("LDFLAGS", "-fuse-ld=lld") def setup_run_environment(self, env): - env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib), + env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib) env.set("OCL_ICD_VENDORS", self.prefix.vendors + "/") @run_after("install") diff --git a/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py b/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py index df9fd3c644c..e378bc0b81a 100644 --- a/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py +++ b/var/spack/repos/builtin/packages/rocm-openmp-extras/package.py @@ -599,8 +599,10 @@ def install(self, spec, prefix): "-DNUMACTL_DIR={0}".format(numactl_prefix), ] if self.spec.satisfies("@:6.2"): - "-DHSAKMT_LIB={0}/lib".format(hsakmt_prefix), - "-DHSAKMT_LIB64={0}/lib64".format(hsakmt_prefix), + openmp_common_args += [ + "-DHSAKMT_LIB={0}/lib".format(hsakmt_prefix), + "-DHSAKMT_LIB64={0}/lib64".format(hsakmt_prefix), + ] components["openmp"] = ["../rocm-openmp-extras/llvm-project/openmp"] components["openmp"] += openmp_common_args diff --git a/var/spack/repos/builtin/packages/rocm-validation-suite/package.py b/var/spack/repos/builtin/packages/rocm-validation-suite/package.py index 2de8c6289c3..3f13babb57f 100644 --- a/var/spack/repos/builtin/packages/rocm-validation-suite/package.py +++ b/var/spack/repos/builtin/packages/rocm-validation-suite/package.py @@ -154,8 +154,8 @@ def cmake_args(self): self.define("UT_INC", self.spec["googletest"].prefix.include), ] if self.spec.satisfies("@6.2.1:"): - args.append(self.define("HIPRAND_DIR", self.spec["hiprand"].prefix)), - args.append(self.define("ROCRAND_DIR", self.spec["rocrand"].prefix)), + args.append(self.define("HIPRAND_DIR", self.spec["hiprand"].prefix)) + args.append(self.define("ROCRAND_DIR", self.spec["rocrand"].prefix)) libloc = self.spec["googletest"].prefix.lib64 if not os.path.isdir(libloc): libloc = self.spec["googletest"].prefix.lib diff --git a/var/spack/repos/builtin/packages/slate/package.py b/var/spack/repos/builtin/packages/slate/package.py index 44c622d18aa..9da8e8c553d 100644 --- a/var/spack/repos/builtin/packages/slate/package.py +++ b/var/spack/repos/builtin/packages/slate/package.py @@ -165,8 +165,8 @@ def cmake_args(self): def cache_test_sources(self): if self.spec.satisfies("@2020.10.00"): return - """Copy the example source files after the package is installed to an - install test subdirectory for use during `spack test run`.""" + # Copy the example source files after the package is installed to an + # install test subdirectory for use during `spack test run`. cache_extra_test_sources(self, ["examples"]) def mpi_launcher(self): diff --git a/var/spack/repos/builtin/packages/vtk-h/package.py b/var/spack/repos/builtin/packages/vtk-h/package.py index 23231b66c3b..4a20bc2c5d4 100644 --- a/var/spack/repos/builtin/packages/vtk-h/package.py +++ b/var/spack/repos/builtin/packages/vtk-h/package.py @@ -121,11 +121,9 @@ def _get_host_config_path(self, spec): @run_before("cmake") def hostconfig(self): + """This method creates a 'host-config' file that specifies all of the options used to + configure and build vtkh.""" spec = self.spec - """ - This method creates a 'host-config' file that specifies - all of the options used to configure and build vtkh. - """ if not os.path.isdir(spec.prefix): os.mkdir(spec.prefix)