MCPcopy Create free account
hub / github.com/vercel/vercel / restoreCachedLock

Function restoreCachedLock

packages/python/src/install.ts:28–38  ·  view source on GitHub ↗

* Restore a previously cached uv.lock into the project directory so that * `uv lock` can validate it instead of re-resolving from PyPI. Only * restores when a cached file exists and no lock file is already present.

(
  cachedLockPath: string | undefined,
  projectDir: string
)

Source from the content-addressed store, hash-verified

26 * restores when a cached file exists and no lock file is already present.
27 */
28async function restoreCachedLock(
29 cachedLockPath: string | undefined,
30 projectDir: string
31): Promise<void> {
32 if (!cachedLockPath) return;
33 const targetLockPath = join(projectDir, 'uv.lock');
34 if (fs.existsSync(cachedLockPath) && !fs.existsSync(targetLockPath)) {
35 debug('Restoring cached uv.lock');
36 await fs.promises.copyFile(cachedLockPath, targetLockPath);
37 }
38}
39
40const makeDependencyCheckCode = (dependency: string) => `
41from importlib import util

Callers 1

ensureUvProjectFunction · 0.85

Calls 2

debugFunction · 0.90
existsSyncMethod · 0.45

Tested by

no test coverage detected