Remove unused values (#48795)

Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Co-authored-by: Todd Gamblin <tgamblin@llnl.gov>
This commit is contained in:
Harmen Stoppels 2025-01-31 08:21:44 +01:00 committed by GitHub
parent 2c51b5853f
commit 6b13017ded
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 127 additions and 134 deletions

View File

@ -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)

View File

@ -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!

View File

@ -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"

View File

@ -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()

View File

@ -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"]

View File

@ -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

View File

@ -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 (

View File

@ -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):

View File

@ -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

View File

@ -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():

View File

@ -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):

View File

@ -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",

View File

@ -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):

View File

@ -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 = [

View File

@ -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
]

View File

@ -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"):

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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):

View File

@ -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"

View File

@ -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,

View File

@ -10,7 +10,7 @@ def try_le(x, y):
try:
return int(x) < y
except ValueError:
False
return False
class LcFramework(CMakePackage, CudaPackage):

View File

@ -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=")

View File

@ -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"),

View File

@ -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"),

View File

@ -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"):

View File

@ -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"

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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)