From 83429a5abcecc9a750a9b376b2ee86922a3861e4 Mon Sep 17 00:00:00 2001 From: n3hrox Date: Mon, 4 Nov 2019 21:29:56 +0100 Subject: [PATCH] refactor is_conda placement --- dvc/utils/pkg.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dvc/utils/pkg.py b/dvc/utils/pkg.py index f080d1e1d..4d2a0228d 100644 --- a/dvc/utils/pkg.py +++ b/dvc/utils/pkg.py @@ -13,9 +13,6 @@ def is_conda(): def get_linux(): import distro - if is_conda(): - return "conda" - if not is_binary(): return "pip" @@ -33,8 +30,6 @@ def get_linux(): def get_darwin(): - if is_conda(): - return "conda" if not is_binary(): if __file__.startswith("/usr/local/Cellar"): return "formula" @@ -44,8 +39,6 @@ def get_darwin(): def get_windows(): - if is_conda(): - return "conda" return None if is_binary() else "pip" @@ -53,6 +46,9 @@ def get_package_manager(): import platform from dvc.exceptions import DvcException + if is_conda(): + return "conda" + m = { "Windows": get_windows(), "Darwin": get_darwin(),