Strip environment markers from detected uv dependency pins (#938)

## Summary
- strip PEP 508 environment markers before extracting uv versions from
dependency entries
- cover dependency-group pins with and without whitespace before the
marker
- cover requirements-style pins with markers

Fixes #920

## Validation
- npm ci --ignore-scripts
- npm run all

Refs: pi-session 019f316a-4108-7975-892f-ee5bf8abc7c3
This commit is contained in:
Kevin Stillhammer
2026-07-05 10:47:17 +02:00
committed by GitHub
parent 17c398959b
commit d31148d669
3 changed files with 37 additions and 4 deletions

6
dist/setup/index.cjs generated vendored
View File

@@ -97414,7 +97414,11 @@ function parsePyprojectContent(pyprojectContent) {
return parse4(pyprojectContent);
}
function getUvVersionFromAllDependencies(allDependencies) {
return allDependencies.find((dep) => dep.match(/^uv[=<>~!]/))?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
return allDependencies.map(getUvVersionFromDependency).find((version3) => version3 !== void 0);
}
function getUvVersionFromDependency(dependency) {
const dependencyWithoutMarker = dependency.split(";", 1)[0]?.trim();
return dependencyWithoutMarker?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
}
// src/version/tool-versions-file.ts