( pythonPath: string )
| 478 | * @throws Error if uv binary cannot be found |
| 479 | */ |
| 480 | export async function getUvBinaryForBundling( |
| 481 | pythonPath: string |
| 482 | ): Promise<string> { |
| 483 | const uvPath = await findUvBinary(pythonPath); |
| 484 | if (!uvPath) { |
| 485 | throw new Error( |
| 486 | 'Cannot find uv binary for bundling. ' + |
| 487 | 'Ensure uv is installed and available in PATH.' |
| 488 | ); |
| 489 | } |
| 490 | |
| 491 | // Resolve symlinks to get the actual binary path. |
| 492 | // This is important because in Vercel's build container, |
| 493 | // /usr/local/bin/uv is a symlink to /uv/uv. If we don't resolve it, |
| 494 | // the Lambda will contain a symlink rather than the actual binary. |
| 495 | const resolvedPath = await fs.promises.realpath(uvPath); |
| 496 | return resolvedPath; |
| 497 | } |
| 498 | |
| 499 | export const UV_LINUX_TARGET = 'x86_64-unknown-linux-gnu'; |
| 500 |
no test coverage detected