Merge pull request #2320 from efiop/2284

version: temporarily make psutil optional
This commit is contained in:
Ruslan Kuprieiev
2019-07-25 03:48:44 +03:00
committed by GitHub
4 changed files with 24 additions and 17 deletions
+22 -16
View File
@@ -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
+1
View File
@@ -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
+1
View File
@@ -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"
-1
View File
@@ -58,7 +58,6 @@ install_requires = [
"inflect>=2.1.0",
"humanize>=0.5.1",
"ruamel.yaml>=0.15.91",
"psutil==5.6.2",
"funcy>=1.12",
"pathspec>=0.5.9",
"shortuuid>=0.5.0",