diff --git a/backend/requirements.txt b/backend/requirements.txt index ba894d35..53166a42 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,25 +1,25 @@ -anyio -bs4 -certifi -charset-normalizer -click -fastapi -h11 -idna +anyio==3.7.0 +bs4==0.0.1 +certifi==2023.5.7 +charset-normalizer==3.1.0 +click==8.1.3 +fastapi==0.97.0 +h11==0.14.0 +idna==3.4 pydantic~=1.10 -PySocks -qbittorrent-api -requests -six -sniffio -soupsieve -typing_extensions -urllib3 -uvicorn -attrdict -jinja2 -python-dotenv -python-jose -passlib -bcrypt -python-multipart +PySocks==1.7.1 +qbittorrent-api==2023.6.49 +requests==2.31.0 +six==1.16.0 +sniffio==1.3.0 +soupsieve==2.4.1 +typing_extensions==4.6.3 +urllib3==2.0.3 +uvicorn==0.22.0 +attrdict==2.0.1 +Jinja2==3.1.2 +python-dotenv==1.0.0 +python-jose==3.3.0 +passlib==1.7.4 +bcrypt==4.0.1 +python-multipart==0.0.6 diff --git a/backend/scripts/pip-lock-version.sh b/backend/scripts/pip-lock-version.sh new file mode 100755 index 00000000..676501a1 --- /dev/null +++ b/backend/scripts/pip-lock-version.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# +# Usage: +# `bash scripts/pip-lock-version.sh` +# +# ```prompt +# Lock the library versions in `requirements.txt` to the current ones from `pip freeze` using shell script, +# but don't change any order in `requirements.txt` +# ``` +# + + +# Create a temporary requirements file using pip freeze +pip freeze > pip_freeze.log + +# Read the existing requirements.txt line by line +while IFS= read -r line +do + # Extract the library name without version + lib_name=$(echo $line | cut -d'=' -f1) + + # Find the corresponding library in the temporary requirements file + lib_line=$(grep "^$lib_name==" pip_freeze.log) + + # If the library is found, update the line + if [[ $lib_line ]] + then + echo $lib_line + else + echo $line + fi + +# Redirect the output to a new requirements file +done < requirements.txt > new_requirements.log + +# Remove the temporary requirements file +rm pip_freeze.log + +# Replace the old requirements file with the new one +mv new_requirements.log requirements.txt +