-
-
Notifications
You must be signed in to change notification settings - Fork 149
[wip] reworking serialization #710
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
base: master
Are you sure you want to change the base?
Changes from 8 commits
6f8c664
0896e1f
9f1047a
2759e2e
7953856
a08b155
c0a9e64
cf8ca91
89ff448
af99117
44225cd
0f93348
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 |
|---|---|---|
|
|
@@ -44,13 +44,19 @@ PIP() { | |
| $pip_exec "$@" | ||
| } | ||
|
|
||
| #if [[ -x "$(command -v $PY_VENV/bin/activate)" ]]; then | ||
| # $PY_ROOT/activate | ||
| #fi | ||
|
|
||
| #echo "PY=$(command -v PY)" | ||
| #echo "PIP=$(command -v PIP)" | ||
| echo "PY=$py_exec" | ||
| echo "PIP=$pip_exec" | ||
|
|
||
| PIP install --no-cache-dir -r $SHARED_DIR/requirements.txt | ||
| REQ_FILE="$SHARED_DIR/requirements.txt" | ||
|
|
||
| for line in $(grep -vE '^\s*#' "$REQ_FILE" | grep -vE '^\s*$'); do | ||
| pkg=$(echo "$line" | sed -E 's/[=><~!].*$//') | ||
| # In a line like "numpy==1.12.0" then pkg=numpy and line is the whole line | ||
|
|
||
| if ! PY -c "import $pkg" &> /dev/null; then | ||
| echo "$pkg not found. Installing from requirements.txt..." | ||
| PIP install --no-cache-dir "$line" | ||
| else | ||
| echo "$pkg is already installed by the framework, using that instead." | ||
| fi | ||
| done | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Avoid word-splitting in the requirements loop - for line in $(grep -vE '^\s*#' "$REQ_FILE" | grep -vE '^\s*$'); do
+ while IFS= read -r line; do
pkg=${line%%[=><~!]*}
if ! PY -c "import $pkg" &> /dev/null; then
echo "$pkg not found. Installing from requirements.txt..."
PIP install --no-cache-dir "$line"
else
echo "$pkg is already installed by the framework, using that instead."
fi
- done
+ done < "$REQ_FILE"This approach avoids splitting issues, reduces forking (
🤖 Prompt for AI Agents |
||
Uh oh!
There was an error while loading. Please reload this page.