Skip to content
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

Fix requirement actions #500

Merged
merged 9 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/manual-freeze-requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ jobs:
- name: Commit changes
run: |
git add .
git commit -m "Freeze requirements"
git commit -s -m "Freeze requirements"
git push
16 changes: 10 additions & 6 deletions .github/workflows/scripts/freeze_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,20 @@ function freeze() {
--output-file "$folder/freeze.txt" \
"$file"
echo "::endgroup::"

if [[ -e "$folder/freeze.txt" ]]; then
if [[ "$keep_origin_packages" == "true" ]]; then
sed -i '/^\s*#/d; s/#.*//; /^\s*$/d' "$file"
sed -i '/^\s*#/d; s/#.*//; /^\s*$/d' "$folder/freeze.txt"

packages1=$(cut -d'=' -f1 "$file" | tr '[:upper:]' '[:lower:]' | sed 's/[-_]/-/g')
# fix corner cases
sed -i '/^\s*#/d; s/#.*//; /^\s*$/d; s/ //g' "$file"
sed -i '/^\s*#/d; s/#.*//; /^\s*$/d; s/ //g; s/huggingface-hub\[inference\]/huggingface-hub/g; s/uvicorn\[standard\]/uvicorn/g' "$folder/freeze.txt"
if grep -q '^transformers$' $file && ! grep -q '^transformers\[sentencepiece\]$' $file; then
sed -i "s/transformers\[sentencepiece\]/transformers/" "$folder/freeze.txt"
fi
packages1=$(tr '><' '=' <"$file" | cut -d'=' -f1 | tr '[:upper:]' '[:lower:]' | sed 's/[-_]/-/g')
packages2=$(cut -d'=' -f1 "$folder/freeze.txt" | tr '[:upper:]' '[:lower:]' | sed 's/[-_]/-/g')
common_packages=$(comm -12 <(echo "$packages2" | sort) <(echo "$packages1" | sort))

rm "$file"
grep '^git\+' "$file" >temp_file || touch temp_file
rm -rf "$file" && mv temp_file "$file"
while IFS= read -r line; do
package=$(echo "$line" | cut -d'=' -f1)
package_transformed=$(echo "$package" | tr '[:upper:]' '[:lower:]' | sed 's/[_-]/-/g')
Expand Down
2 changes: 1 addition & 1 deletion comps/chathistory/mongo/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
motor==3.4.0
motor==3.4.0
2 changes: 1 addition & 1 deletion comps/dataprep/redis/llama_index/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ docarray[full]
fastapi
huggingface_hub
langsmith
llama-index
llama-index
llama-index-embeddings-huggingface==0.2.0
llama-index-readers-file
llama-index-vector-stores-redis
Expand Down
Loading