@echo off
REM Winose Evolution Clean Environment Script
REM -------------------------------
REM supposed to be run from a dictionary which contains the matching msi file
REM This installs a fresh python distribution and downloads/installs
REM all necessary dependencies for the winose system
REM it creates in total two virtual environments:
REM development - current development, mess around herre
REM and finally it install production level libraries into the python global dir itself
REM -------------------------------
echo removing and reinstalling python...
rmdir /S /Q python
msiexec /i python-3.4.2.msi /qn TARGETDIR=%cd%\python REMOVE=Documentation,TclTk,Extensions,Testsuite
echo creating virtual environments...
python\python.exe -m venv development --clear
echo setting up production...
REM install pip first, obviously
python\python.exe -m ensurepip
python\python.exe -m pip install -r requirements.txt -q --allow-all-external
python\python.exe -m easy_install psycopg2-2.6.0.win32-py3.4-pg9.4.1-release.exe

echo setting up development...
cd development\Scripts
call activate.bat
python.exe -m pip install -r ..\..\requirements_dev.txt -q --allow-all-external
# REM install psycop manually
python.exe -m easy_install ..\..\psycopg2-2.6.0.win32-py3.4-pg9.4.1-release.exe

cd ..\..
echo finished!
timeout /T 5 /NOBREAK