Repository: iterative/dvc

Issue:
dvc: fix version generatio
Looks like dynamic version got broken https://travis-ci.com/iterative/dvc/jobs/274986530 .


Discussion:

Patch:
diff --git a/dvc/version.py b/dvc/version.py
index a1ebd240b..411510f57 100644
--- a/dvc/version.py
+++ b/dvc/version.py
@@ -49,7 +49,7 @@ def _is_release(dir_path, base_version):
             ["git", "describe", "--tags", "--exact-match"],
             cwd=dir_path,
             stderr=subprocess.STDOUT,
-        )
+        ).decode("utf-8")
         tag = output.strip()
         return tag == base_version
     except subprocess.CalledProcessError:


Test patch:
diff --git a/tests/unit/test_version.py b/tests/unit/test_version.py
index 1d21c7205..5cd4f8ca5 100644
--- a/tests/unit/test_version.py
+++ b/tests/unit/test_version.py
@@ -12,10 +12,10 @@ def test_is_release():
         assert ret is False
 
         m.side_effect = None
-        m.return_value = dvc.version._BASE_VERSION
+        m.return_value = dvc.version._BASE_VERSION.encode("ascii")
         ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)
         assert ret
 
-        m.return_value = "630d1741c2d5dd89a3176bd15b63121b905d35c9"
+        m.return_value = b"630d1741c2d5dd89a3176bd15b63121b905d35c9"
         ret = dvc.version._is_release(None, dvc.version._BASE_VERSION)
         assert ret is False