( manifest: PythonManifest, manifestStack: PythonManifest[] )
| 375 | } |
| 376 | |
| 377 | function findWorkspaceManifestFor( |
| 378 | manifest: PythonManifest, |
| 379 | manifestStack: PythonManifest[] |
| 380 | ): PythonManifest { |
| 381 | if (manifest.isRoot) { |
| 382 | return manifest; |
| 383 | } |
| 384 | |
| 385 | for (const parentManifest of manifestStack) { |
| 386 | if (parentManifest.path === manifest.path) { |
| 387 | continue; |
| 388 | } |
| 389 | |
| 390 | const workspace = parentManifest.data.tool?.uv?.workspace; |
| 391 | if (workspace !== undefined) { |
| 392 | let members = workspace.members ?? []; |
| 393 | if (!Array.isArray(members)) { |
| 394 | members = []; |
| 395 | } |
| 396 | let exclude = workspace.exclude ?? []; |
| 397 | if (!Array.isArray(exclude)) { |
| 398 | exclude = []; |
| 399 | } |
| 400 | |
| 401 | const entrypointRelPath = path.relative( |
| 402 | path.dirname(parentManifest.path), |
| 403 | path.dirname(manifest.path) |
| 404 | ); |
| 405 | if ( |
| 406 | members.length > 0 && |
| 407 | members.some( |
| 408 | pat => minimatchMatch([entrypointRelPath], pat).length > 0 |
| 409 | ) && |
| 410 | !exclude.some( |
| 411 | pat => minimatchMatch([entrypointRelPath], pat).length > 0 |
| 412 | ) |
| 413 | ) { |
| 414 | return parentManifest; |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | |
| 419 | return manifest; |
| 420 | } |
| 421 | |
| 422 | async function loadPythonManifest( |
| 423 | root: AbsPath, |
no outgoing calls
no test coverage detected