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
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user