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

Function detectInstallSource

packages/python/src/install.ts:179–205  ·  view source on GitHub ↗
(
  pythonPackage: PythonPackage,
  rootDir: string
)

Source from the content-addressed store, hash-verified

177}
178
179export function detectInstallSource(
180 pythonPackage: PythonPackage,
181 rootDir: string
182): InstallSourceInfo {
183 // Determine effective manifest type based on lock file and manifest presence
184 let manifestType: ManifestType = null;
185 let manifestPath: string | null = null;
186
187 // Check for lock file first (highest priority)
188 const lockFile =
189 pythonPackage.manifest?.lockFile ?? pythonPackage.workspaceLockFile;
190 if (lockFile) {
191 if (lockFile.kind === PythonLockFileKind.UvLock) {
192 manifestType = 'uv.lock';
193 manifestPath = join(rootDir, lockFile.path);
194 } else if (lockFile.kind === PythonLockFileKind.PylockToml) {
195 manifestType = 'pylock.toml';
196 manifestPath = join(rootDir, lockFile.path);
197 }
198 } else if (pythonPackage.manifest) {
199 // No lock file, but have a manifest (native or converted)
200 manifestType = 'pyproject.toml';
201 manifestPath = join(rootDir, pythonPackage.manifest.path);
202 }
203
204 return { manifestPath, manifestType, pythonPackage };
205}
206
207export async function createPyprojectToml({
208 projectName,

Callers 2

syncDependenciesFunction · 0.90
ensureUvProjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected