mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
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:
co-authored by
pre-commit-ci[bot]
parent
e9c0a99083
commit
0f2361f218
@@ -9,7 +9,7 @@ from typing import Optional
|
||||
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
|
||||
|
||||
@@ -109,11 +109,19 @@ def make_dvc_bin(
|
||||
else:
|
||||
pkg = "dvc"
|
||||
packages = [f"{pkg} @ git+file://{dvc_repo}@{dvc_rev}"]
|
||||
|
||||
version_constraints = [
|
||||
("<3.50.3", ["pygit2==1.14.1"]),
|
||||
("<3.44.0", ["dulwich<1.0.0"]),
|
||||
]
|
||||
for spec, pkgs in version_constraints:
|
||||
try:
|
||||
if version.Version(dvc_rev) < version.Version("3.50.3"):
|
||||
packages.append("pygit2==1.14.1")
|
||||
_dvc_version = version.Version(dvc_rev)
|
||||
except version.InvalidVersion:
|
||||
pass
|
||||
continue
|
||||
if _dvc_version in specifiers.SpecifierSet(spec):
|
||||
packages.extend(pkgs)
|
||||
|
||||
venv.install(*packages)
|
||||
|
||||
dvc_venvs[dvc_rev] = venv
|
||||
|
||||
Reference in New Issue
Block a user