fix(benchmarks): pin dulwich<1.0.0 for DVC versions before 3.44.0 (#10979)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
skshetry
2026-01-23 23:33:50 +05:45
committed by GitHub
co-authored by pre-commit-ci[bot]
parent e9c0a99083
commit 0f2361f218
+14 -6
View File
@@ -9,7 +9,7 @@ from typing import Optional
import pytest import pytest
from dulwich.porcelain import clone from dulwich.porcelain import clone
from funcy import first from funcy import first
from packaging import version from packaging import specifiers, version
from dvc.types import StrPath from dvc.types import StrPath
@@ -109,11 +109,19 @@ def make_dvc_bin(
else: else:
pkg = "dvc" pkg = "dvc"
packages = [f"{pkg} @ git+file://{dvc_repo}@{dvc_rev}"] packages = [f"{pkg} @ git+file://{dvc_repo}@{dvc_rev}"]
try:
if version.Version(dvc_rev) < version.Version("3.50.3"): version_constraints = [
packages.append("pygit2==1.14.1") ("<3.50.3", ["pygit2==1.14.1"]),
except version.InvalidVersion: ("<3.44.0", ["dulwich<1.0.0"]),
pass ]
for spec, pkgs in version_constraints:
try:
_dvc_version = version.Version(dvc_rev)
except version.InvalidVersion:
continue
if _dvc_version in specifiers.SpecifierSet(spec):
packages.extend(pkgs)
venv.install(*packages) venv.install(*packages)
dvc_venvs[dvc_rev] = venv dvc_venvs[dvc_rev] = venv