Skip to content

Commit

Permalink
make windows scripts more flexible (indep of where called from)
Browse files Browse the repository at this point in the history
  • Loading branch information
dec1 committed May 20, 2024
1 parent e491225 commit ea1c311
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 3 additions & 1 deletion prj/script/pip_reqs_export.cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
SET "script_dir=%~dp0"
SET "script_dir=%script_dir:~0,-1%"

CALL .\venv\Scripts\pip freeze > ..\pip_reqs.txt
CALL %script_dir%\venv\Scripts\pip freeze > ..\pip_reqs.txt
8 changes: 5 additions & 3 deletions prj/script/pip_reqs_install.cmd
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
SET "script_dir=%~dp0"
SET "script_dir=%script_dir:~0,-1%"

CALL .\venv\Scripts\python -m pip install --upgrade pip
CALl .\venv\Scripts\pip install --upgrade setuptools
CALL %script_dir%\venv\Scripts\python -m pip install --upgrade pip
CALl %script_dir%\venv\Scripts\pip install --upgrade setuptools


REM Latest
REM ------
REM install (latest versions of) dependencies
REM ------
CAll .\venv\Scripts\pip install -r ..\pip_reqs_base.txt
CAll %script_dir%\venv\Scripts\pip install -r ..\pip_reqs_base.txt

REM Exact
REM ------
Expand Down
14 changes: 8 additions & 6 deletions prj/script/venv_create.cmd
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
set HTTPS_PROXY=
REM http://10.110.15.6:8080
REM set HTTPS_PROXY= http://10.110.15.6:8080

CALL python -m venv .\venv
SET "script_dir=%~dp0"
SET "script_dir=%script_dir:~0,-1%"

CALL python -m venv %script_dir%\venv

echo ".....virtual environment created"

CALL .\venv\Scripts\activate
CALL %script_dir%\venv\Scripts\activate

echo ".....pip reqs installing...."

CALL .\pip_reqs_install.cmd
CALL %script_dir%\pip_reqs_install.cmd

echo ".....pip reqs installed"

CALL .\venv\Scripts\deactivate
CALL %script_dir%\\venv\Scripts\deactivate

echo ".....venv ready"

Expand Down

0 comments on commit ea1c311

Please sign in to comment.