Skip to content

Fix git availability crash in docs/conf.py for non-editable installs#187

Draft
Copilot wants to merge 3 commits intofix_non_editablefrom
copilot/sub-pr-141
Draft

Fix git availability crash in docs/conf.py for non-editable installs#187
Copilot wants to merge 3 commits intofix_non_editablefrom
copilot/sub-pr-141

Conversation

Copy link

Copilot AI commented Feb 24, 2026

docs/conf.py called subprocess.check_output for git commands at import time with no error handling, causing hard failures when git is unavailable or the directory isn't a git repo (e.g., non-editable pip installs).

Changes

  • docs/conf.py: Wrapped the three git subprocess.check_output calls in a try/except block, falling back to "Unknown" — matching the pattern already applied in iop4api/views/index.py
try:
    GIT_COMMIT_HASH = subprocess.check_output(['git', 'rev-parse', 'HEAD'], ...).decode('ascii').strip()
    GIT_BRANCH = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], ...).decode('ascii').strip()
    GIT_DESCRIBE = subprocess.check_output(['git', 'describe', '--always'], ...).decode('ascii').strip()
except (subprocess.CalledProcessError, FileNotFoundError, OSError):
    GIT_COMMIT_HASH = "Unknown"
    GIT_BRANCH = "Unknown"
    GIT_DESCRIBE = "Unknown"

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 24, 2026 01:09
Co-authored-by: juanep97 <26815511+juanep97@users.noreply.github.com>
Co-authored-by: juanep97 <26815511+juanep97@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on Git availability in non-editable installs Fix git availability crash in docs/conf.py for non-editable installs Feb 24, 2026
Copilot AI requested a review from juanep97 February 24, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants