File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 99import pytest
1010from dulwich .porcelain import clone
1111from funcy import first
12- from packaging import version
12+ from packaging import specifiers , version
1313
1414from 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
You can’t perform that action at this time.
0 commit comments