Compare commits

..
4 Commits
Author SHA1 Message Date
Ruslan Kuprieiev 82e559a51a dvc: bump to 2.6.3 2021-08-17 15:17:48 +03:00
Ruslan Kuprieiev 33c6a9b19b analytics: introduce DVC_NO_ANALYTICS (#6453)
Replacing DVC_ANALYTICS. This is following our other env conventions and
will not have effect if set to false/no/etc, and will only work if set
to true/yes/y/etc. Will disable analytics even if it is explicitly
enabled in our configs.

Kudos @skshetry
2021-08-17 15:16:40 +03:00
Saugat Pachhai 14cc748139 Increase coverage target to 90%. 2021-08-17 12:23:35 +05:45
David de la Iglesia Castro 40abf34c8c Update dvc exp branch help (#6439) 2021-08-17 11:14:44 +09:00
6 changed files with 19 additions and 16 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ coverage:
status:
project:
default:
target: 85
target: 90
threshold: 10%
patch:
default:
+3 -3
View File
@@ -2,7 +2,7 @@ import json
import logging
import os
from .env import DVC_ANALYTICS
from .env import DVC_NO_ANALYTICS
logger = logging.getLogger(__name__)
@@ -44,8 +44,8 @@ def is_enabled():
if env2bool("DVC_TEST"):
return False
enabled = env2bool(DVC_ANALYTICS, None)
if enabled is None:
enabled = not os.getenv(DVC_NO_ANALYTICS)
if enabled:
enabled = to_bool(
Config(validate=False).get("core", {}).get("analytics", "true")
)
+1 -1
View File
@@ -9,4 +9,4 @@ DVCLIVE_RESUME = "DVCLIVE_RESUME"
DVC_IGNORE_ISATTY = "DVC_IGNORE_ISATTY"
DVC_EXP_GIT_REMOTE = "DVC_EXP_GIT_REMOTE"
DVC_EXP_AUTO_PUSH = "DVC_EXP_AUTO_PUSH"
DVC_ANALYTICS = "DVC_ANALYTICS"
DVC_NO_ANALYTICS = "DVC_NO_ANALYTICS"
+1 -1
View File
@@ -455,7 +455,7 @@ class Experiments:
)
logger.info(
"\nTo promote an experiment to a Git branch run:\n\n"
"\tdvc exp branch <exp>\n"
"\tdvc exp branch <exp> <branch>\n"
)
@scm_locked
+1 -1
View File
@@ -6,7 +6,7 @@
import os
import subprocess
_BASE_VERSION = "2.6.2"
_BASE_VERSION = "2.6.3"
def _generate_version(base_version):
+12 -9
View File
@@ -87,7 +87,7 @@ def test_is_enabled(dvc, config, result, monkeypatch, tmp_global_dir):
# reset DVC_TEST env var, which affects `is_enabled()`
monkeypatch.delenv("DVC_TEST")
monkeypatch.delenv("DVC_ANALYTICS", raising=False)
monkeypatch.delenv("DVC_NO_ANALYTICS", raising=False)
assert result == analytics.is_enabled()
@@ -96,20 +96,23 @@ def test_is_enabled(dvc, config, result, monkeypatch, tmp_global_dir):
"config, env, result",
[
(None, None, True),
(None, "true", True),
(None, "false", False),
(None, "true", False),
(None, "false", False), # only checking if env is set
("false", None, False),
("false", "true", True),
("false", "true", False),
("false", "false", False),
("true", None, True),
("true", "true", True),
("true", "false", False),
("true", "true", False),
("true", "false", False), # we checking if env is set
],
)
def test_is_enabled_env(dvc, config, env, result, monkeypatch, tmp_global_dir):
def test_is_enabled_env_neg(
dvc, config, env, result, monkeypatch, tmp_global_dir
):
# reset DVC_TEST env var, which affects `is_enabled()`
monkeypatch.delenv("DVC_TEST")
monkeypatch.delenv("DVC_ANALYTICS", raising=False)
monkeypatch.delenv("DVC_NO_ANALYTICS", raising=False)
with dvc.config.edit() as conf:
conf["core"] = {}
@@ -120,7 +123,7 @@ def test_is_enabled_env(dvc, config, env, result, monkeypatch, tmp_global_dir):
conf["core"] = {"analytics": config}
if env is not None:
monkeypatch.setenv("DVC_ANALYTICS", env)
monkeypatch.setenv("DVC_NO_ANALYTICS", env)
assert result == analytics.is_enabled()