({
repoRootPath,
workPath,
})
| 1325 | export { startDevServer }; |
| 1326 | |
| 1327 | export const prepareCache: PrepareCache = async ({ |
| 1328 | repoRootPath, |
| 1329 | workPath, |
| 1330 | }) => { |
| 1331 | const root = repoRootPath || workPath; |
| 1332 | const ignore = ['**/*.pyc', '**/__pycache__/**']; |
| 1333 | |
| 1334 | // Prune pre-built wheels from the uv cache (source-built wheels are retained). |
| 1335 | const uvCacheDir = getUvCacheDir(workPath); |
| 1336 | try { |
| 1337 | const uvPath = findUvInPath(); |
| 1338 | if (uvPath) { |
| 1339 | const uv = new UvRunner(uvPath, uvCacheDir); |
| 1340 | await uv.cachePrune(); |
| 1341 | } |
| 1342 | } catch { |
| 1343 | // best-effort; don't fail the build |
| 1344 | } |
| 1345 | |
| 1346 | // Cache the uv package cache, the default venv, and any service-namespaced |
| 1347 | // venvs so that subsequent builds can skip dependency installation. |
| 1348 | return glob('**/.vercel/python/{.venv,services/*/.venv,cache/uv}/**', { |
| 1349 | cwd: root, |
| 1350 | ignore, |
| 1351 | }); |
| 1352 | }; |
| 1353 | |
| 1354 | export const shouldServe: ShouldServe = opts => { |
| 1355 | const framework = opts.config.framework; |
no test coverage detected