From 743ee4db45df031d4014766f9b33d402ba8aba70 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 04:37:31 +0000 Subject: [PATCH 1/4] Initial plan From 0bddf34332a060519f500a165998e3eed59f8c37 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 04:42:46 +0000 Subject: [PATCH 2/4] Fix setup_dev.sh to install pre-commit from requirements-dev.txt 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> --- CONTRIBUTING.md | 2 +- setup_dev.bat | 1 - setup_dev.sh | 25 +++++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1346880..8cbd907 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -190,7 +190,7 @@ git push origin feature/my-improvement ```bash # Format with black black refactron tests - + # Sort imports isort refactron tests ``` diff --git a/setup_dev.bat b/setup_dev.bat index 34c325b..9d31361 100644 --- a/setup_dev.bat +++ b/setup_dev.bat @@ -120,4 +120,3 @@ echo venv\Scripts\activate echo. echo Happy coding! 🚀 pause - diff --git a/setup_dev.sh b/setup_dev.sh index 46fb1d8..ada4628 100755 --- a/setup_dev.sh +++ b/setup_dev.sh @@ -54,17 +54,16 @@ pip install -e ".[dev]" --quiet # - Core development tools (pytest, black, mypy, flake8, isort, etc.) are installed # via the [dev] extra in pyproject.toml (see the pip install -e ".[dev]" above). # - To avoid redundant installations and version conflicts, we only use -# requirements-dev.txt for *extra* tools such as documentation dependencies. +# requirements-dev.txt for *extra* tools such as documentation dependencies and pre-commit. if [ -f "requirements-dev.txt" ]; then echo "đŸ“Ĩ Installing additional documentation/development dependencies from requirements-dev.txt..." - # Extract Sphinx-related requirements (e.g., sphinx, sphinx-rtd-theme) from - # requirements-dev.txt and install only those. This avoids re-installing tools - # that are already provided by the [dev] extra. - DOC_REQUIREMENTS=$(grep -E '^[[:space:]]*sphinx' requirements-dev.txt || true) + # Extract Sphinx-related and pre-commit requirements from requirements-dev.txt. + # This avoids re-installing tools that are already provided by the [dev] extra. + EXTRA_REQUIREMENTS=$(grep -E '^[[:space:]]*(sphinx|pre-commit)' requirements-dev.txt || true) - if [ -n "$DOC_REQUIREMENTS" ]; then - echo "$DOC_REQUIREMENTS" | xargs -n1 pip install --quiet + if [ -n "$EXTRA_REQUIREMENTS" ]; then + echo "$EXTRA_REQUIREMENTS" | xargs -n1 pip install --quiet else echo "â„šī¸ No additional documentation dependencies detected in requirements-dev.txt; skipping." fi @@ -73,8 +72,15 @@ fi # Install pre-commit hooks echo "" echo "🔧 Setting up pre-commit hooks..." -pre-commit install -echo "✅ Pre-commit hooks installed" +if command -v pre-commit &> /dev/null; then + pre-commit install + echo "✅ Pre-commit hooks installed" +else + echo "❌ Error: pre-commit is not installed in this environment." + echo "Please install it (e.g., inside the virtual environment) and re-run this script:" + echo " pip install pre-commit" + exit 1 +fi # Verify installation echo "" @@ -125,4 +131,3 @@ echo "💡 To activate the environment in the future, run:" echo " source venv/bin/activate" echo "" echo "Happy coding! 🚀" - From 301def7ef7b6725f1889ff5b0e52b349a65206e9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 04:44:06 +0000 Subject: [PATCH 3/4] Update info message to mention both documentation and pre-commit dependencies Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com> --- setup_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_dev.sh b/setup_dev.sh index ada4628..b2cf451 100755 --- a/setup_dev.sh +++ b/setup_dev.sh @@ -65,7 +65,7 @@ if [ -f "requirements-dev.txt" ]; then if [ -n "$EXTRA_REQUIREMENTS" ]; then echo "$EXTRA_REQUIREMENTS" | xargs -n1 pip install --quiet else - echo "â„šī¸ No additional documentation dependencies detected in requirements-dev.txt; skipping." + echo "â„šī¸ No additional documentation or pre-commit dependencies detected in requirements-dev.txt; skipping." fi fi From 6db07cfb2bf6524ee6bf14de32e43ea3ac3cd769 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 28 Dec 2025 04:44:39 +0000 Subject: [PATCH 4/4] Improve error message for missing pre-commit installation Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com> --- setup_dev.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup_dev.sh b/setup_dev.sh index b2cf451..5e4166b 100755 --- a/setup_dev.sh +++ b/setup_dev.sh @@ -77,7 +77,8 @@ if command -v pre-commit &> /dev/null; then echo "✅ Pre-commit hooks installed" else echo "❌ Error: pre-commit is not installed in this environment." - echo "Please install it (e.g., inside the virtual environment) and re-run this script:" + 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 fi