forked from hydrusnetwork/hydrus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_venv.bat
157 lines (100 loc) · 4 KB
/
setup_venv.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
@ECHO off
pushd "%~dp0"
where /q python
IF ERRORLEVEL 1 (
SET /P gumpf=You do not seem to have python installed. Please check the 'running from source' help.
popd
EXIT /B 1
)
IF EXIST "venv\" (
SET /P ready=Virtual environment will be reinstalled. Hit Enter to start.
echo Deleting old venv...
rmdir /s /q venv
) ELSE (
SET /P ready=If you do not know what this is, check the 'running from source' help. Hit Enter to start.
)
:questions
ECHO:
ECHO Users on older Windows need the advanced install.
ECHO:
ECHO Your Python version is:
python --version
ECHO:
SET /P install_type=Do you want the (s)imple or (a)dvanced install?
IF "%install_type%" == "s" goto :create
IF "%install_type%" == "a" goto :question_qt
IF "%install_type%" == "d" goto :create
goto :parse_fail
:question_qt
ECHO:
ECHO Qt is the User Interface library. We are now on Qt6.
ECHO If you are on Windows ^<=8.1, choose 5. If 6 gives you trouble, fall back to o.
SET /P qt=Do you want Qt(5), Qt(6), Qt6 (o)lder, or (t)est?
IF "%qt%" == "5" goto :question_mpv
IF "%qt%" == "6" goto :question_mpv
IF "%qt%" == "o" goto :question_mpv
IF "%qt%" == "t" goto :question_mpv
goto :parse_fail
:question_mpv
ECHO:
ECHO mpv is the main way to play audio and video. We need to tell hydrus how to talk to your mpv dll.
ECHO Try the n first. If it doesn't work, fall back to o.
SET /P mpv=Do you want (o)ld mpv or (n)ew mpv?
IF "%mpv%" == "o" goto :question_opencv
IF "%mpv%" == "n" goto :question_opencv
goto :parse_fail
:question_opencv
ECHO:
ECHO OpenCV is the main image processing library.
ECHO Try the n first. If it doesn't work, fall back to o. Very new python versions might need t.
SET /P opencv=Do you want (o)ld OpenCV, (n)ew OpenCV, or (t)est OpenCV?
IF "%opencv%" == "o" goto :create
IF "%opencv%" == "n" goto :create
IF "%opencv%" == "t" goto :create
goto :parse_fail
:create
echo Creating new venv...
python -m venv venv
CALL venv\Scripts\activate.bat
IF ERRORLEVEL 1 (
SET /P gumpf=The venv failed to activate, stopping now!
popd
EXIT /B 1
)
python -m pip install --upgrade pip
python -m pip install --upgrade wheel
IF "%install_type%" == "s" (
python -m pip install -r requirements.txt
)
IF "%install_type%" == "d" (
python -m pip install -r static\requirements\advanced\requirements_core.txt
python -m pip install -r static\requirements\advanced\requirements_windows.txt
python -m pip install -r static\requirements\advanced\requirements_qt6_test.txt
python -m pip install pyside2
python -m pip install PyQtChart PyQt5
python -m pip install PyQt6-Charts PyQt6
python -m pip install -r static\requirements\advanced\requirements_mpv_new.txt
python -m pip install -r static\requirements\advanced\requirements_opencv_test.txt
python -m pip install -r static\requirements\hydev\requirements_windows_build.txt
)
IF "%install_type%" == "a" (
python -m pip install -r static\requirements\advanced\requirements_core.txt
python -m pip install -r static\requirements\advanced\requirements_windows.txt
IF "%qt%" == "5" python -m pip install -r static\requirements\advanced\requirements_qt5.txt
IF "%qt%" == "6" python -m pip install -r static\requirements\advanced\requirements_qt6.txt
IF "%qt%" == "o" python -m pip install -r static\requirements\advanced\requirements_qt6_older.txt
IF "%qt%" == "t" python -m pip install -r static\requirements\advanced\requirements_qt6_test.txt
IF "%mpv%" == "o" python -m pip install -r static\requirements\advanced\requirements_mpv_old.txt
IF "%mpv%" == "n" python -m pip install -r static\requirements\advanced\requirements_mpv_new.txt
IF "%opencv%" == "o" python -m pip install -r static\requirements\advanced\requirements_opencv_old.txt
IF "%opencv%" == "n" python -m pip install -r static\requirements\advanced\requirements_opencv_new.txt
IF "%opencv%" == "t" python -m pip install -r static\requirements\advanced\requirements_opencv_test.txt
)
CALL venv\Scripts\deactivate.bat
SET /P done=Done!
popd
EXIT /B 0
:parse_fail
SET /P done=Sorry, did not understand that input!
popd
EXIT /B 1