Merge pull request #1842 from efiop/1835

pkg: import git dynamically
This commit is contained in:
Ruslan Kuprieiev
2019-04-07 01:10:36 +03:00
committed by GitHub
2 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -2,12 +2,11 @@ from __future__ import unicode_literals
import os
import shutil
from git.cmd import Git
import dvc.logger as logger
from dvc.exceptions import DvcException
from dvc.stage import Stage
from dvc.temp_git_repo import TempGitRepo
from dvc.scm.git.temp_git_repo import TempGitRepo
class PackageParams(object):
@@ -60,6 +59,8 @@ class GitPackage(Package):
DEF_DVC_FILE_PREFIX = "mod_"
def install_or_update(self, parent_repo, pkg_params):
from git.cmd import Git
if not self.is_in_root():
raise DvcException(
"This command can be run only from a repository root"
@@ -2,8 +2,6 @@ import os
import shutil
import tempfile
import git
from dvc import logger
from dvc.exceptions import DvcException
@@ -70,6 +68,8 @@ class TempGitRepo(object):
return self
def _clone_to_temp_dir(self):
import git
result = tempfile.mktemp(
prefix=self._tmp_mod_prefix, dir=self.modules_dir
)