(pkg: UvLockPackage)
| 1062 | |
| 1063 | // Seed the BFS with the root package's compatible dependencies |
| 1064 | async function enqueueDeps(pkg: UvLockPackage): Promise<void> { |
| 1065 | if (!pkg.dependencies) return; |
| 1066 | for (const dep of pkg.dependencies) { |
| 1067 | const normalized = normalizePackageName(dep.name); |
| 1068 | if (visited.has(normalized)) continue; |
| 1069 | if (dep.marker) { |
| 1070 | try { |
| 1071 | const compatible = await evaluateMarker( |
| 1072 | dep.marker, |
| 1073 | pythonMajor, |
| 1074 | pythonMinor, |
| 1075 | sysPlatform, |
| 1076 | platformMachine |
| 1077 | ); |
| 1078 | if (!compatible) { |
| 1079 | debug( |
| 1080 | `Skipping dependency ${dep.name}: marker "${dep.marker}" not satisfied on ${sysPlatform}` |
| 1081 | ); |
| 1082 | continue; |
| 1083 | } |
| 1084 | } catch (err) { |
| 1085 | // If we can't evaluate the marker, conservatively include the dependency |
| 1086 | debug( |
| 1087 | `Failed to evaluate marker "${dep.marker}" for ${dep.name}, including conservatively: ${ |
| 1088 | err instanceof Error ? err.message : String(err) |
| 1089 | }` |
| 1090 | ); |
| 1091 | } |
| 1092 | } |
| 1093 | queue.push(normalized); |
| 1094 | } |
| 1095 | } |
| 1096 | |
| 1097 | await enqueueDeps(rootPkg); |
| 1098 |
no test coverage detected