Skip to content

Commit

Permalink
build in venv
Browse files Browse the repository at this point in the history
  • Loading branch information
Himura2la committed Sep 17, 2021
1 parent 1886a7c commit 54e43fe
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions vk-inviter/make.ps1
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
param (
[switch] $InstallRequirements,
[switch] $InstallPyInstaller,
[switch] $Init,
[switch] $Clean,
[switch] $Compile
)
Set-Location $PSScriptRoot
$didSomething = $false

if ($InstallRequirements -or $InstallPyInstaller) {
& py -m pip install --user --upgrade pip
}
if ($InstallRequirements) {
& py -m pip install --user --upgrade -r ./requirements.txt
# The 'python3-tk' package is also required on Linux.
$didSomething = $true
}
if ($InstallPyInstaller) {
& py -m pip install --user --upgrade pyinstaller
if ($Init) {
& py -m venv ./.venv
. ./.venv/Scripts/Activate.ps1

& ./.venv/Scripts/python -m pip install --upgrade pip
& ./.venv/Scripts/python -m pip install --upgrade -r ./requirements.txt
& ./.venv/Scripts/python -m pip install --upgrade pyinstaller
$didSomething = $true
}

if ($Clean) {
Remove-Item -Recurse -ErrorAction Ignore ./dist
$didSomething = $true
}
if ($Compile) {
& py -m PyInstaller --specpath ./build ./vk_inviter.py
& ./.venv/Scripts/pyinstaller --specpath ./build ./vk_inviter.py
Remove-Item -Recurse -ErrorAction Ignore ./build, ./__pycache__
Remove-Item './dist/vk_inviter/MSVCP140.dll', `
'./dist/vk_inviter/VCRUNTIME140.dll', `
Expand Down

0 comments on commit 54e43fe

Please sign in to comment.