adding scripts

This commit is contained in:
Palash Tyagi 2024-11-22 14:42:46 +00:00
parent 89f20299b5
commit cc08a3da59
2 changed files with 39 additions and 0 deletions

23
scripts/win/build.ps1 Normal file
View File

@ -0,0 +1,23 @@
# run command: maturin --help. if it fails, print the error message and exit
try {
maturin --help > $null
} catch {
Write-Error "Failed to run maturin --help: $_"
exit 1
}
# delete any existing build directory
Remove-Item -Path ./build -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Path ./build > $null
# copy ./src/msyrs.pyi to ./msyrs.pyi
Copy-Item -Path ./src/msyrs.pyi -Destination ./msyrs.pyi
maturin build --release --sdist --out ./build/
$whl = Get-ChildItem -Path ./build/*.whl
# rename the wheel wheel.whl to wheel.zip
Rename-Item -Path $whl -NewName ($whl.BaseName + ".zip")
# delete the pyi file
Remove-Item -Path ./msyrs.pyi

16
scripts/win/install.ps1 Normal file
View File

@ -0,0 +1,16 @@
# uv pip install maturin
try {
maturin --help > $null
} catch {
Write-Error "Failed to run maturin --help: $_"
exit 1
}
# copy ./src/msyrs.pyi to ./msyrs.pyi
Copy-Item -Path ./src/msyrs.pyi -Destination ./msyrs.pyi
maturin develop --release
# delete the pyi file
Remove-Item -Path ./msyrs.pyi