( pythonPackage: PythonPackage, rootDir: string )
| 177 | } |
| 178 | |
| 179 | export 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 | |
| 207 | export async function createPyprojectToml({ |
| 208 | projectName, |
no outgoing calls
no test coverage detected