diff --git a/scripts/win/build.ps1 b/scripts/win/build.ps1 new file mode 100644 index 0000000..c24d7ae --- /dev/null +++ b/scripts/win/build.ps1 @@ -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 \ No newline at end of file diff --git a/scripts/win/install.ps1 b/scripts/win/install.ps1 new file mode 100644 index 0000000..252e338 --- /dev/null +++ b/scripts/win/install.ps1 @@ -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 \ No newline at end of file