Skip to content

Commit

Permalink
updated windows scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dec1 committed Jun 20, 2024
1 parent 0f3e392 commit 1f6ca37
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .idea/Percolation.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions prj/script/common.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions prj/script/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
script_dir=$(dirname "$0")
venv_dir=${script_dir}/../venv
pip_reqs_dir=${script_dir}/../pip_reqs
py_ver="3.11"
2 changes: 1 addition & 1 deletion prj/script/pip_reqs_export.cmd
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions prj/script/pip_reqs_export.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions prj/script/pip_reqs_install.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions prj/script/pip_reqs_install.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions prj/script/venv_create.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit 1f6ca37

Please sign in to comment.