Skip to content

allow user repo config without repeating git / make repo init lazy / improve spack repo list#50823

Merged
tgamblin merged 4 commits intodevelopfrom
hs/fix/relax-git-attr
Jun 5, 2025
Merged

allow user repo config without repeating git / make repo init lazy / improve spack repo list#50823
tgamblin merged 4 commits intodevelopfrom
hs/fix/relax-git-attr

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Jun 5, 2025

with this

  • ~/.spack/repo.yaml does not error if it is
    repos:
      builtin:
       destination: ~/spack-packages
        # git: ... # no longer required by validator; validated at runtime.
  • spack.main no longer inits spack.repo.PATH -- this is done lazily to avoid that spack repo rm and spack config add etc trigger a git clone of the repo that is being removed/modified
  • spack python inits spack.repo.PATH so users can do import spack_repo.* directly.
  • spack repo list shows a status for uninitialized package repos with -
  • spack repo set --destination ~/spack-packages builtin gives users a way to put the spack package repo in a location of choice

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Jun 5, 2025
@spackbot-app spackbot-app bot added the commands label Jun 5, 2025
@haampie haampie changed the title repo schema: validate required git attr at runtime repo config: allow user repo config without repeating git / make repo init lazy / improve spack repo list Jun 5, 2025
@haampie haampie changed the title repo config: allow user repo config without repeating git / make repo init lazy / improve spack repo list allow user repo config without repeating git / make repo init lazy / improve spack repo list Jun 5, 2025
@haampie haampie requested a review from Copilot June 5, 2025 20:43
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 git as a required field in the JSON schema and enforce it at parse time
  • Lazy-init repositories in main and the Python subcommand instead of on startup
  • Refactor spack repo list to 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 RuntimeError for missing git) and remove or clarify references to BadRepoError if it is no longer raised.
"""Parse a repository descriptor from validated configuration. This does not instantiate Repo

@tgamblin tgamblin merged commit 8674b20 into develop Jun 5, 2025
31 of 32 checks passed
@tgamblin tgamblin deleted the hs/fix/relax-git-attr branch June 5, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands core PR affects Spack core functionality shell-support tests General test capability(ies)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants