aletrn commited on
Commit
c357c11
1 Parent(s): aedefa3

ci: add create_requirements.sh script for quick requirements.txt updates starting from installed packages (e.g. using poetry)

Browse files
requirements.txt CHANGED
@@ -7,9 +7,8 @@ python-dotenv==1.0.1
7
  onnxruntime==1.18.1
8
  rasterio==1.3.10
9
  requests==2.32.3
10
- samgis-core==3.0.6
11
- samgis-web==1.0.7
12
- fastapi==0.111.0
13
- jinja2==3.1.4
14
  pydantic==2.8.2
15
- uvicorn==0.30.1
 
7
  onnxruntime==1.18.1
8
  rasterio==1.3.10
9
  requests==2.32.3
10
+ samgis_core==3.0.6
11
+ samgis_web==1.0.7
12
+ fastapi==0.111.1
 
13
  pydantic==2.8.2
14
+ uvicorn==0.30.3
requirements_no_versions.txt CHANGED
@@ -9,6 +9,8 @@ rasterio
9
  requests
10
  samgis-core
11
  samgis-web
 
 
12
  fastapi
13
  jinja2
14
  pydantic
 
9
  requests
10
  samgis-core
11
  samgis-web
12
+ samgis_core
13
+ samgis_web
14
  fastapi
15
  jinja2
16
  pydantic
scripts/create_requirements.sh ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+
3
+ SCRIPT=$(realpath "$0")
4
+ SCRIPT_FOLDER=$(dirname "$SCRIPT")
5
+ ROOT_FOLDER=${SCRIPT_FOLDER}/../
6
+
7
+ rm ./tmp/requirements_tmp.txt || echo "./tmp/requirements_tmp.txt not found!"
8
+
9
+ echo "start requirements.txt preparation: pip freeze..."
10
+ pip freeze > ./tmp/freeze.txt
11
+ echo "grep python dependencies into freeze.txt..."
12
+ for x in $(cat ./requirements_no_versions.txt); do
13
+ echo "# $x #"
14
+ grep $x ./tmp/freeze.txt >> ./tmp/requirements_tmp.txt
15
+ echo "######"
16
+ done
17
+
18
+ echo "cat ${ROOT_FOLDER}/tmp/requirements_tmp.txt"
19
+ cat ${ROOT_FOLDER}/tmp/requirements_tmp.txt
20
+ echo -e "\n"
21
+
22
+ [[ "$(echo -n 'Promote "${ROOT_FOLDER}/tmp/requirements_tmp.txt" as new requirements.txt? [y/N]> ' >&2; read; echo $REPLY)" == [Yy]* ]] \
23
+ && echo "copy requirements_tmp.txt to root project..." \
24
+ || exit 0
25
+
26
+ cp ${ROOT_FOLDER}/tmp/requirements_tmp.txt ${ROOT_FOLDER}/requirements.txt
27
+
28
+ echo "Fix any discrepancy within the new requirements.txt, bye!"
29
+
30
+ exit 0