Skip to content

Commit 0f2361f

Browse files
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>
1 parent e9c0a99 commit 0f2361f

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

dvc/testing/benchmarks/fixtures.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import pytest
1010
from dulwich.porcelain import clone
1111
from funcy import first
12-
from packaging import version
12+
from packaging import specifiers, version
1313

1414
from dvc.types import StrPath
1515

@@ -109,11 +109,19 @@ def make_dvc_bin(
109109
else:
110110
pkg = "dvc"
111111
packages = [f"{pkg} @ git+file://{dvc_repo}@{dvc_rev}"]
112-
try:
113-
if version.Version(dvc_rev) < version.Version("3.50.3"):
114-
packages.append("pygit2==1.14.1")
115-
except version.InvalidVersion:
116-
pass
112+
113+
version_constraints = [
114+
("<3.50.3", ["pygit2==1.14.1"]),
115+
("<3.44.0", ["dulwich<1.0.0"]),
116+
]
117+
for spec, pkgs in version_constraints:
118+
try:
119+
_dvc_version = version.Version(dvc_rev)
120+
except version.InvalidVersion:
121+
continue
122+
if _dvc_version in specifiers.SpecifierSet(spec):
123+
packages.extend(pkgs)
124+
117125
venv.install(*packages)
118126

119127
dvc_venvs[dvc_rev] = venv

0 commit comments

Comments
 (0)