allow user repo config without repeating git / make repo init lazy / improve spack repo list#50823
Merged
allow user repo config without repeating git / make repo init lazy / improve spack repo list#50823
git / make repo init lazy / improve spack repo list#50823Conversation
git / make repo init lazy / improve spack repo list
git / make repo init lazy / improve spack repo listgit / make repo init lazy / improve spack repo list
There was a problem hiding this comment.
Pull Request Overview
This PR makes repository config more flexible by deferring git presence checks to runtime, defers repo initialization until needed, and enhances spack repo list output to indicate uninitialized repos.
- Remove
gitas a required field in the JSON schema and enforce it at parse time - Lazy-init repositories in
mainand the Python subcommand instead of on startup - Refactor
spack repo listto collect statuses and print aligned, marking uninitialized remotes
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/spack/spack/test/repo.py | Add test for parsing a descriptor missing a git key |
| lib/spack/spack/schema/repos.py | Remove "git" from the schema’s required list |
| lib/spack/spack/repo.py | Add runtime check for missing git and update doc |
| lib/spack/spack/main.py | Remove eager repository initialization on startup |
| lib/spack/spack/cmd/repo.py | Collect repository statuses, align output, mark uninitialized |
| lib/spack/spack/cmd/python.py | Explicitly touch spack.repo.PATH.repos to init repo path |
Comments suppressed due to low confidence (1)
lib/spack/spack/repo.py:1819
- [nitpick] Update the docstring to reflect the current exception behavior (e.g., mention
RuntimeErrorfor missinggit) and remove or clarify references toBadRepoErrorif it is no longer raised.
"""Parse a repository descriptor from validated configuration. This does not instantiate Repo
Closed
tgamblin
approved these changes
Jun 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
with this
~/.spack/repo.yamldoes not error if it isspack.mainno longer initsspack.repo.PATH-- this is done lazily to avoid thatspack repo rmandspack config addetc trigger a git clone of the repo that is being removed/modifiedspack pythoninitsspack.repo.PATHso users can doimport spack_repo.*directly.spack repo listshows a status for uninitialized package repos with-spack repo set --destination ~/spack-packages builtingives users a way to put the spack package repo in a location of choice