mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
Merge pull request #2320 from efiop/2284
version: temporarily make psutil optional
This commit is contained in:
+22
-16
@@ -1,12 +1,16 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import psutil
|
||||
import platform
|
||||
import argparse
|
||||
import logging
|
||||
import uuid
|
||||
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
psutil = None
|
||||
|
||||
from dvc.utils import is_binary
|
||||
from dvc.utils.compat import pathlib
|
||||
from dvc.repo import Repo
|
||||
@@ -38,24 +42,26 @@ class CmdVersion(CmdBaseNoRepo):
|
||||
binary=binary,
|
||||
)
|
||||
|
||||
try:
|
||||
repo = Repo()
|
||||
root_directory = repo.root_dir
|
||||
if psutil:
|
||||
try:
|
||||
repo = Repo()
|
||||
root_directory = repo.root_dir
|
||||
|
||||
info += (
|
||||
"Cache: {cache}\n"
|
||||
"Filesystem type (cache directory): {fs_cache}\n"
|
||||
).format(
|
||||
cache=self.get_linktype_support_info(repo),
|
||||
fs_cache=self.get_fs_type(repo.cache.local.cache_dir),
|
||||
info += (
|
||||
"Cache: {cache}\n"
|
||||
"Filesystem type (cache directory): {fs_cache}\n"
|
||||
).format(
|
||||
cache=self.get_linktype_support_info(repo),
|
||||
fs_cache=self.get_fs_type(repo.cache.local.cache_dir),
|
||||
)
|
||||
|
||||
except NotDvcRepoError:
|
||||
root_directory = os.getcwd()
|
||||
|
||||
info += ("Filesystem type (workspace): {fs_root}").format(
|
||||
fs_root=self.get_fs_type(os.path.abspath(root_directory))
|
||||
)
|
||||
|
||||
except NotDvcRepoError:
|
||||
root_directory = os.getcwd()
|
||||
|
||||
info += ("Filesystem type (workspace): {fs_root}").format(
|
||||
fs_root=self.get_fs_type(os.path.abspath(root_directory))
|
||||
)
|
||||
logger.info(info)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ if %errorlevel% neq 0 (echo Error: Couldn't find Inno Setup compiler. && goto :e
|
||||
|
||||
echo ====== Installing requirements... ======
|
||||
call pip install .[all] || goto :error
|
||||
call pip install psutil || goto :error
|
||||
call dvc pull || goto :error
|
||||
call pip install pyinstaller || goto :error
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ function retry {
|
||||
# work or not.
|
||||
retry pip install --upgrade pip setuptools wheel
|
||||
retry pip install .[all,tests]
|
||||
retry pip install psutil
|
||||
|
||||
git config --global user.email "[email protected]"
|
||||
git config --global user.name "DVC Tester"
|
||||
|
||||
Reference in New Issue
Block a user