Skip to content

Commit b1d40b1

Browse files
m96-chanclaude
andcommitted
fix(ci): correct RECORD file generation in release workflow
- Linux: include dist-info files in RECORD (was missing) - Windows: use -Recurse for subdirectories, fix relative paths - Windows: ensure Unix line endings (LF) for RECORD file - Bump version to 0.2.13 Fixes PyPI warning about RECORD file mismatch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 9e9b19e commit b1d40b1

2 files changed

Lines changed: 32 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,24 @@ jobs:
241241
# Dynamically find dist-info folder
242242
DIST_INFO=$(ls -d pygpukit-*.dist-info | head -1)
243243
echo "Found dist-info folder: $DIST_INFO"
244-
find pygpukit -type f | while read f; do
245-
hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
246-
size=$(stat -c%s "$f")
247-
echo "$f,$hash,$size"
248-
done > "$DIST_INFO/RECORD"
249-
echo "$DIST_INFO/RECORD,," >> "$DIST_INFO/RECORD"
244+
245+
# Generate RECORD with ALL files (pygpukit/ + dist-info/)
246+
{
247+
# All files in pygpukit/
248+
find pygpukit -type f | while read f; do
249+
hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
250+
size=$(stat -c%s "$f")
251+
echo "$f,$hash,$size"
252+
done
253+
# All files in dist-info/ except RECORD
254+
find "$DIST_INFO" -type f ! -name RECORD | while read f; do
255+
hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
256+
size=$(stat -c%s "$f")
257+
echo "$f,$hash,$size"
258+
done
259+
# RECORD itself (no hash)
260+
echo "$DIST_INFO/RECORD,,"
261+
} > "$DIST_INFO/RECORD"
250262
251263
# Repack wheel
252264
cd ..
@@ -558,16 +570,20 @@ jobs:
558570
$distInfoName = $distInfo.Name
559571
Write-Host "Found dist-info folder: $distInfoName"
560572
$recordPath = "wheel-contents/$distInfoName/RECORD"
573+
$wheelContentsPath = (Resolve-Path "wheel-contents").Path
561574
$newRecord = @()
562-
Get-ChildItem wheel-contents/pygpukit -File | ForEach-Object {
563-
$relativePath = "pygpukit/$($_.Name)"
575+
576+
# All files in pygpukit/ (recursive)
577+
Get-ChildItem wheel-contents/pygpukit -File -Recurse | ForEach-Object {
578+
$relativePath = $_.FullName.Substring($wheelContentsPath.Length + 1).Replace('\', '/')
564579
$bytes = [System.IO.File]::ReadAllBytes($_.FullName)
565580
$hash = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes)
566581
$hashB64 = [Convert]::ToBase64String($hash).TrimEnd('=').Replace('+', '-').Replace('/', '_')
567582
$size = $_.Length
568583
$newRecord += "$relativePath,sha256=$hashB64,$size"
569584
}
570-
# Add dist-info files
585+
586+
# All files in dist-info/ except RECORD
571587
Get-ChildItem "wheel-contents/$distInfoName" -File | Where-Object { $_.Name -ne "RECORD" } | ForEach-Object {
572588
$relativePath = "$distInfoName/$($_.Name)"
573589
$bytes = [System.IO.File]::ReadAllBytes($_.FullName)
@@ -576,8 +592,13 @@ jobs:
576592
$size = $_.Length
577593
$newRecord += "$relativePath,sha256=$hashB64,$size"
578594
}
595+
596+
# RECORD itself (no hash)
579597
$newRecord += "$distInfoName/RECORD,,"
580-
$newRecord | Out-File -FilePath $recordPath -Encoding utf8NoBOM
598+
599+
# Write with Unix line endings (LF only)
600+
$newRecord -join "`n" | Set-Content -Path $recordPath -NoNewline -Encoding utf8NoBOM
601+
Add-Content -Path $recordPath -Value "" -NoNewline -Encoding utf8NoBOM
581602
582603
# Repack wheel
583604
Remove-Item $wheel.FullName

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build"
44

55
[project]
66
name = "PyGPUkit"
7-
version = "0.2.12"
7+
version = "0.2.13"
88
description = "A lightweight GPU runtime for Python with Rust-powered scheduler, NVRTC JIT compilation, and NumPy-like API"
99
readme = "README.md"
1010
license = "MIT"

0 commit comments

Comments
 (0)