Add version constraint support for git URL requirements (#23737)

This commit is contained in:
fatih akyon 2026-02-26 11:33:10 +03:00 committed by GitHub
parent c56255fa7f
commit f83bcda3d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -458,7 +458,11 @@ def check_requirements(requirements=ROOT.parent / "requirements.txt", exclude=()
continue
if not satisfied:
pkgs.append(candidates[0])
pkg = candidates[0]
if "git+" in pkg: # strip version constraints from git URLs for pip
url, sep, marker = pkg.partition(";")
pkg = re.sub(r"[<>!=~]+.*$", "", url) + sep + marker
pkgs.append(pkg)
@Retry(times=2, delay=1)
def attempt_install(packages, commands, use_uv):