repo: don't return builtin path plus docstring tweaks and TODOs

This commit is contained in:
Tamara Dahlgren 2024-12-19 18:48:31 -08:00
parent 062d3643b2
commit f04f7bd6af
No known key found for this signature in database
GPG Key ID: 1DFB48B82B5BB5C4
5 changed files with 12 additions and 3 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.