Compare commits

...

2 Commits

Author SHA1 Message Date
Tamara Dahlgren
f04f7bd6af
repo: don't return builtin path plus docstring tweaks and TODOs 2024-12-19 18:49:23 -08:00
Tamara Dahlgren
062d3643b2
test/audit.py: Get tests to pass using mock packages 2024-12-19 18:31:24 -08:00
7 changed files with 28 additions and 4 deletions

View File

@ -146,6 +146,7 @@ def libc_external_spec(self) -> "spack.spec.Spec":
return self._external_spec(result)
def _external_spec(self, initial_spec) -> "spack.spec.Spec":
#TODO: Does this need to be changed?
initial_spec.namespace = "builtin"
initial_spec.compiler = self.host_compiler.spec
initial_spec.architecture = self.host_architecture

View File

@ -958,6 +958,7 @@ def fullnames(cls):
namespace = getattr(cls, "namespace", None)
if namespace:
fullnames.append("%s.%s" % (namespace, cls.name))
#TODO: Does this need to be changed?
if namespace == "builtin":
# builtin packages cannot inherit from other repos
break

View File

@ -58,7 +58,10 @@
# read-only things in $spack/var/spack
repos_path = os.path.join(var_path, "repos")
#TODO: How do we want to replace this?
packages_path = os.path.join(repos_path, "builtin")
mock_packages_path = os.path.join(repos_path, "builtin.mock")
#

View File

@ -57,7 +57,7 @@ def python_package_for_repo(namespace):
For instance:
python_package_for_repo('builtin') == 'spack.pkg.builtin'
python_package_for_repo('builtin.mock') == 'spack.pkg.builtin.mock'
Args:
namespace (str): repo namespace
@ -70,7 +70,7 @@ def namespace_from_fullname(fullname):
For instance:
namespace_from_fullname('spack.pkg.builtin.hdf5') == 'builtin'
namespace_from_fullname('spack.pkg.builtin.mock.hdf5') == 'builtin.mock'
Args:
fullname (str): full name for the Python module
@ -183,7 +183,10 @@ def packages_path():
try:
return PATH.get_repo("builtin.mock").packages_path
except UnknownNamespaceError:
return PATH.get_repo("builtin").packages_path
#TODO: Replace this with the approach needed to ensure using the new
#TODO: built-in repository option
#return PATH.get_repo("builtin").packages_path
return None
class GitExe:

View File

@ -2266,6 +2266,7 @@ def to_node_dict(self, hash=ht.dag_hash):
)
return d
#TODO: Does the example namespace need to change from builtin?
def to_dict(self, hash=ht.dag_hash):
"""Create a dictionary suitable for writing this spec to YAML or JSON.

View File

@ -114,7 +114,7 @@ def test_package_audits(packages, expected_errors, mock_packages):
),
],
)
def test_config_audits(config_section, data, failing_check):
def test_config_audits(config_section, data, failing_check, mock_packages):
with spack.config.override(config_section, data):
reports = spack.audit.run_group("configs")
assert any((check == failing_check) and errors for check, errors in reports)

View File

@ -0,0 +1,15 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Openssl(Package):
version("3.4.0")
#variant("internal-hwloc", default=False)
#variant("fabrics", values=any_combination_of("psm", "mxm"))
#depends_on("hwloc", when="~internal-hwloc")