-
Notifications
You must be signed in to change notification settings - Fork 8
/
venv.ps1
39 lines (28 loc) · 2.35 KB
/
venv.ps1
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
# Recreate the python virtual environment and reinstall libs on Windows.
# Chris Joakim, Microsoft
$dirs = ".\venv\", ".\pyvenv.cfg"
foreach ($d in $dirs) {
if (Test-Path $d) {
echo "deleting $d"
del $d -Force -Recurse
}
}
echo 'creating new venv ...'
python -m venv .\venv\
echo 'activating new venv ...'
.\venv\Scripts\Activate.ps1
echo 'upgrading pip ...'
python -m pip install --upgrade pip
echo 'install pip-tools ...'
pip install --upgrade pip-tools
echo 'pip-compile requirements.in ...'
pip-compile --output-file .\requirements.txt .\requirements.in
echo 'pip install requirements.txt ...'
pip install -q -r .\requirements.txt
echo 'pip list ...'
pip list
echo 'done; next -> .\venv\Scripts\activate'
# Enable Long Paths in Windows
# See https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later
# Win Key + X, then Windows Terminal (admin), the run the following PowerShell command:
# New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force