Skip to content

Commit

Permalink
version: temporarily make psutil optional
Browse files Browse the repository at this point in the history
Workaround for iterative#2284

Signed-off-by: Ruslan Kuprieiev <[email protected]>
  • Loading branch information
efiop committed Jul 24, 2019
1 parent 590c2dc commit 4a4ddf0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
38 changes: 22 additions & 16 deletions dvc/command/version.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -38,24 +42,26 @@ def run(self):
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),
)

except NotDvcRepoError:
root_directory = os.getcwd()

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 += ("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

Expand Down
1 change: 1 addition & 0 deletions scripts/build_windows.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions scripts/ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def run(self):
"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",
Expand Down

0 comments on commit 4a4ddf0

Please sign in to comment.