Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions dvc/testing/benchmarks/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import pytest
from dulwich.porcelain import clone
from funcy import first
from packaging import version
from packaging import specifiers, version

from dvc.types import StrPath

Expand Down Expand Up @@ -109,11 +109,19 @@ def make_dvc_bin(
else:
pkg = "dvc"
packages = [f"{pkg} @ git+file://{dvc_repo}@{dvc_rev}"]
try:
if version.Version(dvc_rev) < version.Version("3.50.3"):
packages.append("pygit2==1.14.1")
except version.InvalidVersion:
pass

version_constraints = [
("<3.50.3", ["pygit2==1.14.1"]),
("<3.44.0", ["dulwich<1.0.0"]),
]
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)

dvc_venvs[dvc_rev] = venv
Expand Down