Skip to content

Commit 54e43fe

Browse files
committed
build in venv
1 parent 1886a7c commit 54e43fe

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

vk-inviter/make.ps1

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
param (
2-
[switch] $InstallRequirements,
3-
[switch] $InstallPyInstaller,
2+
[switch] $Init,
43
[switch] $Clean,
54
[switch] $Compile
65
)
76
Set-Location $PSScriptRoot
87
$didSomething = $false
98

10-
if ($InstallRequirements -or $InstallPyInstaller) {
11-
& py -m pip install --user --upgrade pip
12-
}
13-
if ($InstallRequirements) {
14-
& py -m pip install --user --upgrade -r ./requirements.txt
15-
# The 'python3-tk' package is also required on Linux.
16-
$didSomething = $true
17-
}
18-
if ($InstallPyInstaller) {
19-
& py -m pip install --user --upgrade pyinstaller
9+
if ($Init) {
10+
& py -m venv ./.venv
11+
. ./.venv/Scripts/Activate.ps1
12+
13+
& ./.venv/Scripts/python -m pip install --upgrade pip
14+
& ./.venv/Scripts/python -m pip install --upgrade -r ./requirements.txt
15+
& ./.venv/Scripts/python -m pip install --upgrade pyinstaller
2016
$didSomething = $true
2117
}
18+
2219
if ($Clean) {
2320
Remove-Item -Recurse -ErrorAction Ignore ./dist
2421
$didSomething = $true
2522
}
2623
if ($Compile) {
27-
& py -m PyInstaller --specpath ./build ./vk_inviter.py
24+
& ./.venv/Scripts/pyinstaller --specpath ./build ./vk_inviter.py
2825
Remove-Item -Recurse -ErrorAction Ignore ./build, ./__pycache__
2926
Remove-Item './dist/vk_inviter/MSVCP140.dll', `
3027
'./dist/vk_inviter/VCRUNTIME140.dll', `

0 commit comments

Comments
 (0)