-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] Fix quick setup issues in code #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
743ee4d
0bddf34
301def7
6db07cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,4 +120,3 @@ echo venv\Scripts\activate | |
| echo. | ||
| echo Happy coding! 🚀 | ||
| pause | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -54,27 +54,34 @@ 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." | ||||||||||||||||||||||
| echo "ℹ️ No additional documentation or pre-commit dependencies detected in requirements-dev.txt; skipping." | ||||||||||||||||||||||
| fi | ||||||||||||||||||||||
| 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 "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 | ||||||||||||||||||||||
|
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 | |
| 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" |
There was a problem hiding this comment.
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.