Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,30 @@ jobs:
shell: pwsh
Comment thread
aasgaonkar marked this conversation as resolved.
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
}
Comment on lines +308 to +311
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this try-catch is needed.
The way github ci works is that when a command returns an exit code other than zero, the flow stops and the whole test is reported as failed.

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
Expand Down
Loading