summaryrefslogtreecommitdiffstats
path: root/.github/workflows/ci.yml
diff options
context:
space:
mode:
authoramey asgaonkar <160177341+aasgaonkar@users.noreply.github.com>2025-06-17 15:02:33 -0700
committerGitHub <noreply@github.com>2025-06-17 15:02:33 -0700
commitb6ab113cc3f296b55292c2385e3c229266f235a4 (patch)
tree40b12ef1a7fdad266ce6798a2b0d2a09db8f6af7 /.github/workflows/ci.yml
parent14d002ac5463f0fd20ca5c3d4288fd7be2aa1b80 (diff)
Fix slangpy not using correct slang backend (#7334)
- fix path conversion from linux to windows - add exit on fail for lib copy This ensures the slang backend built in CI is indeed the one used for tests.
Diffstat (limited to '.github/workflows/ci.yml')
-rw-r--r--.github/workflows/ci.yml29
1 files changed, 21 insertions, 8 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 194294b00..3984b1fda 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -287,17 +287,30 @@ jobs:
shell: pwsh
run: |
python --version
- Write-Host "Cleaning up existing installations..."
- Start-Process -FilePath "python" -ArgumentList "-m pip uninstall -y slangpy" -Verb RunAs -Wait
- Write-Host "Installing slangpy..."
- python -m pip install --no-cache-dir --verbose slangpy --user
- Write-Host "Getting Python site-packages directory and copying library files (DLL, SO, DYLIB)..."
+ Write-Host "Cleaning up existing installations and installing slangpy..."
+ try {
+ $SLANGPY_LOCATION = python -c "import slangpy; print(slangpy.__file__.rsplit('\\', 2)[0])"
+ Start-Process -FilePath "python" -ArgumentList "-m pip uninstall -y slangpy" -Verb RunAs -Wait
+ if (Test-Path $SLANGPY_LOCATION) {
+ Write-Host "Removing existing slangpy directory at: $SLANGPY_LOCATION"
+ Remove-Item -Path $SLANGPY_LOCATION -Recurse -Force
+ }
+ } catch {
+ Write-Host "slangpy not found or already removed"
+ }
+ python -m pip install --verbose slangpy --user
$SITE_PACKAGES = python -c "import slangpy; print(slangpy.__file__.rsplit('\\', 2)[0])"
+ $bin_dir = $env:bin_dir -replace '^/c/', 'C:\' -replace '/', '\'
Write-Host "Site packages directory: $SITE_PACKAGES"
- Write-Host "Copying library files..."
- Copy-Item -Path "$bin_dir\*" -Include "*.dll","*.so","*.dylib" -Destination "$SITE_PACKAGES\slangpy\" -Force -ErrorAction Continue
+ Write-Host "bin_dir location: $bin_dir"
+ try {
+ Copy-Item -Path "$bin_dir\slang*.dll" -Destination "$SITE_PACKAGES\slangpy\" -Force -ErrorAction Stop
+ } catch {
+ Write-Error "Failed to copy library files: $_"
+ exit 1
+ }
Write-Host "Listing files in slangpy directory..."
- Get-ChildItem -Path "$SITE_PACKAGES\slangpy" | Write-Host
+ Get-ChildItem -Path "$SITE_PACKAGES\slangpy" | ForEach-Object { Write-Host "$($_.Name) - Last Modified: $($_.LastWriteTime)" }
Write-Host "Running pytest on slangpy tests..."
$env:PYTHONPATH = "$SITE_PACKAGES"
python -m pytest "$SITE_PACKAGES\slangpy\tests" -v