Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 28, 2025

Summary

Fixed the setup_dev.sh script to properly handle pre-commit installation from requirements-dev.txt.

Changes Made:

  • Updated grep pattern in setup_dev.sh to include both 'sphinx' and 'pre-commit' packages (line 64)
  • Added error handling if pre-commit command is not available after installation attempt (lines 76-85)
  • Improved error and info messages to accurately reference requirements-dev.txt
  • Investigated CI failures - found pre-existing mypy type annotation errors (214 errors unrelated to setup script changes)
  • Replied to user explaining the fix and CI failure root cause
  • Completed code review with no outstanding issues
  • Verified no security vulnerabilities introduced

CI Failures Note:

The pre-commit CI workflow is failing due to 214 pre-existing mypy type annotation errors in test files, examples, and benchmarks. These errors existed before this PR and are caused by disallow_untyped_defs = true in pyproject.toml. The setup script changes are correct and address the issues identified in code review comments.

Security Summary:

No security vulnerabilities were introduced or discovered during this change.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Dec 28, 2025
54 tasks
@coderabbitai
Copy link

coderabbitai bot commented Dec 28, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 3 commits December 28, 2025 04:42
The grep pattern now includes both sphinx and pre-commit packages.
Also added error handling if pre-commit is not found.

Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com>
…ndencies

Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com>
Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com>
@omsherikar omsherikar marked this pull request as ready for review December 28, 2025 04:45
Copilot AI review requested due to automatic review settings December 28, 2025 04:45
@github-actions github-actions bot added bug Something isn't working documentation Improvements or additions to documentation size: small security labels Dec 28, 2025
@omsherikar omsherikar merged commit 1648274 into feat/quick-setup Dec 28, 2025
8 of 9 checks passed
Copilot AI requested a review from omsherikar December 28, 2025 04:46
Copy link
Contributor

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 fixes the setup_dev.sh script to properly handle pre-commit installation and improves error handling when pre-commit is unavailable after installation attempts.

Key Changes:

  • Updated the grep pattern to extract both sphinx and pre-commit dependencies from requirements-dev.txt
  • Added conditional check with error handling when pre-commit command is not available
  • Cleaned up trailing whitespace in CONTRIBUTING.md and setup_dev.bat

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
setup_dev.sh Updated dependency extraction logic to include pre-commit, renamed variables for clarity, and added error handling for missing pre-commit command
setup_dev.bat Removed trailing newline
CONTRIBUTING.md Removed trailing whitespace on line 193

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +80 to +82
echo "This should have been installed from requirements-dev.txt."
echo "Please ensure pre-commit is listed in requirements-dev.txt or install it manually:"
echo " pip install pre-commit"
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

The error handling assumes that pre-commit should have been installed from requirements-dev.txt, but the script only attempts to install it if requirements-dev.txt exists AND contains a line matching the grep pattern. If requirements-dev.txt doesn't exist or doesn't contain pre-commit, the error message will be misleading. Consider checking if requirements-dev.txt exists and contains pre-commit before assuming it should have been installed from there.

Suggested change
echo "This should have been installed from requirements-dev.txt."
echo "Please ensure pre-commit is listed in requirements-dev.txt or install it manually:"
echo " pip install pre-commit"
if [ -f "requirements-dev.txt" ] && grep -q -E '^[[:space:]]*pre-commit' requirements-dev.txt; then
echo "pre-commit appears to be listed in requirements-dev.txt but was not installed."
echo "You may need to rerun this script or install it manually:"
echo " pip install pre-commit"
else
echo "pre-commit is not installed and does not appear to be listed in requirements-dev.txt."
echo "Please add pre-commit to your development dependencies (e.g., requirements-dev.txt) or install it manually:"
echo " pip install pre-commit"
fi

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +83
echo "❌ Error: pre-commit is not installed in this environment."
echo "This should have been installed from requirements-dev.txt."
echo "Please ensure pre-commit is listed in requirements-dev.txt or install it manually:"
echo " pip install pre-commit"
exit 1
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

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

The exit 1 here will terminate the script if pre-commit is not available, which may be too strict. If pre-commit is truly optional or can be installed later, consider making this a warning instead of a fatal error. Alternatively, the script could attempt to install pre-commit directly if it's missing.

Suggested change
echo "❌ Error: pre-commit is not installed in this environment."
echo "This should have been installed from requirements-dev.txt."
echo "Please ensure pre-commit is listed in requirements-dev.txt or install it manually:"
echo " pip install pre-commit"
exit 1
echo "⚠️ Warning: pre-commit is not installed in this environment."
echo " Pre-commit hooks will not be installed automatically."
echo " To enable pre-commit hooks, ensure 'pre-commit' is listed in requirements-dev.txt"
echo " or install it manually in this environment with:"
echo " pip install pre-commit"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation security size: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants