From 1f6ca37b0a881aa36c36c0d384a2c0f90d07b5e7 Mon Sep 17 00:00:00 2001
From: Declan <5962877+dec1@users.noreply.github.com>
Date: Thu, 20 Jun 2024 18:17:55 +0200
Subject: [PATCH] updated windows scripts
---
.idea/Percolation.iml | 2 +-
.idea/misc.xml | 2 +-
prj/script/common.cmd | 1 +
prj/script/common.sh | 1 +
prj/script/pip_reqs_export.cmd | 2 +-
prj/script/pip_reqs_export.sh | 5 +++--
prj/script/pip_reqs_install.cmd | 6 +++---
prj/script/pip_reqs_install.sh | 9 +++++----
prj/script/venv_create.sh | 6 ++++--
9 files changed, 20 insertions(+), 14 deletions(-)
mode change 100755 => 100644 prj/script/pip_reqs_export.sh
mode change 100755 => 100644 prj/script/pip_reqs_install.sh
diff --git a/.idea/Percolation.iml b/.idea/Percolation.iml
index 00765a6..04d5c64 100644
--- a/.idea/Percolation.iml
+++ b/.idea/Percolation.iml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 5cdfb96..f86c1bb 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/prj/script/common.cmd b/prj/script/common.cmd
index ce3a3cb..7544aee 100644
--- a/prj/script/common.cmd
+++ b/prj/script/common.cmd
@@ -5,3 +5,4 @@ REM define (relative) paths
set script_dir=%~dp0
set venv_dir=%script_dir%\..\venv
set pip_reqs_dir=%script_dir%\..\pip_reqs
+set py_ver="3.11"
diff --git a/prj/script/common.sh b/prj/script/common.sh
index 130e19b..1cfcf1f 100644
--- a/prj/script/common.sh
+++ b/prj/script/common.sh
@@ -3,3 +3,4 @@
script_dir=$(dirname "$0")
venv_dir=${script_dir}/../venv
pip_reqs_dir=${script_dir}/../pip_reqs
+py_ver="3.11"
diff --git a/prj/script/pip_reqs_export.cmd b/prj/script/pip_reqs_export.cmd
index 738e779..24ac4c8 100644
--- a/prj/script/pip_reqs_export.cmd
+++ b/prj/script/pip_reqs_export.cmd
@@ -1,4 +1,4 @@
@echo off
call common.cmd
-CALL %venv_dir%\Scripts\pip freeze > %pip_reqs_dir%\pip_reqs.txt
+CALL %venv_dir%\Scripts\python -m pip freeze > %pip_reqs_dir%\pip_reqs.txt
diff --git a/prj/script/pip_reqs_export.sh b/prj/script/pip_reqs_export.sh
old mode 100755
new mode 100644
index 899210c..608833e
--- a/prj/script/pip_reqs_export.sh
+++ b/prj/script/pip_reqs_export.sh
@@ -1,6 +1,7 @@
#!/bin/bash
-source common.sh
+script_dir=$(dirname "$0")
+source ${script_dir}/common.sh
# persist the exact dependencies (recursively)
-${venv_dir}/bin/pip freeze > ${pip_reqs_dir}/pip_reqs.txt
+${venv_dir}/bin/python -m pip freeze > ${pip_reqs_dir}/pip_reqs.txt
diff --git a/prj/script/pip_reqs_install.cmd b/prj/script/pip_reqs_install.cmd
index 98fbcdc..f2ff55e 100644
--- a/prj/script/pip_reqs_install.cmd
+++ b/prj/script/pip_reqs_install.cmd
@@ -2,11 +2,11 @@
call common.cmd
CALL %venv_dir%\Scripts\python -m pip install --upgrade pip
-CALl %venv_dir%\Scripts\pip install --upgrade setuptools
+CALl %venv_dir%\Scripts\python -m pip install --upgrade setuptools
REM 1) install latest (versions of) dependencies
-CALL %venv_dir%\Scripts\pip install -r %pip_reqs_dir%\pip_reqs_base.txt
+CALL %venv_dir%\Scripts\python -m pip install -r %pip_reqs_dir%\pip_reqs_base.txt
REM 2) install exact (versions of) dependencies
-REM CALL %venv_dir%\Scripts\pip install -r %pip_reqs_dir%\pip_reqs.txt
+REM CALL %venv_dir%\Scripts\python -m pip install -r %pip_reqs_dir%\pip_reqs.txt
diff --git a/prj/script/pip_reqs_install.sh b/prj/script/pip_reqs_install.sh
old mode 100755
new mode 100644
index 2350314..9cb2b65
--- a/prj/script/pip_reqs_install.sh
+++ b/prj/script/pip_reqs_install.sh
@@ -1,17 +1,18 @@
#!/bin/bash
-source common.sh
+script_dir=$(dirname "$0")
+source ${script_dir}/common.sh
${venv_dir}/bin/python -m pip install --upgrade pip
-${venv_dir}/bin/pip install --upgrade setuptools
+${venv_dir}/bin/python -m pip install --upgrade setuptools
# 1) install latest (versions of) dependencies
-${venv_dir}/bin/pip install -r ${pip_reqs_dir}/pip_reqs_base.txt
+${venv_dir}/bin/python -m pip install -r ${pip_reqs_dir}/pip_reqs_base.txt
# 2) install exact (versions of) dependencies
-#./venv/bin/pip install -r ../pip_reqs.txt
+#./venv/bin/python -m pip install -r ../pip_reqs.txt
# eg from previous call to 'pip_reqs_export.sh'
# recommended for production
diff --git a/prj/script/venv_create.sh b/prj/script/venv_create.sh
index b6052d9..6c4d139 100755
--- a/prj/script/venv_create.sh
+++ b/prj/script/venv_create.sh
@@ -1,9 +1,11 @@
#!/bin/bash
-source ./common.sh
+script_dir=$(dirname "$0")
+source ${script_dir}/common.sh
+echo "using python version: " ${py_ver}
-python3 -m venv ${venv_dir}
+python${py_ver} -m venv ${venv_dir}
echo ".....virtual environment created"