Skip to content

Commit 9716123

Browse files
committed
fix: use correct Python path in CI builds
- Detect pythonLocation environment variable from GitHub Actions - Use the actual Python binary path instead of /usr/bin/python3 - Add logging to show which Python is being used
1 parent 7a6fd3a commit 9716123

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/build.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ const { execSync } = require('child_process');
55
// Check if we're in a CI environment
66
const isCI = process.env.CI === 'true';
77

8+
// Determine Python executable
9+
let pythonCmd = 'python3';
10+
if (process.env.pythonLocation) {
11+
// GitHub Actions sets pythonLocation
12+
pythonCmd = `${process.env.pythonLocation}/bin/python`;
13+
}
14+
815
// Build command with appropriate flags
916
const buildCmd = isCI
10-
? 'uv pip install --system --python /usr/bin/python3 -e .'
11-
: 'uv pip install --python /usr/bin/python3 -e .';
17+
? `uv pip install --system --python ${pythonCmd} -e .`
18+
: `uv pip install --python ${pythonCmd} -e .`;
1219

1320
try {
1421
console.log('🔨 Building package...');
22+
console.log(`Using Python: ${pythonCmd}`);
1523
execSync(buildCmd, { stdio: 'inherit' });
1624
console.log('✅ Build complete');
1725
} catch (error) {

0 commit comments

Comments
 (0)