diff --git a/dvc/command/show_workflow.py b/dvc/command/show_workflow.py index fc92695c4..c91c7bc30 100644 --- a/dvc/command/show_workflow.py +++ b/dvc/command/show_workflow.py @@ -1,4 +1,5 @@ import re +import sys from collections import defaultdict from dvc.logger import Logger @@ -65,7 +66,8 @@ class CmdShowWorkflow(CmdBase): def branches_multimap(self): git_cmd = ['git', 'show-ref', '--abbrev={}'.format(self.COMMIT_LEN)] lines = Executor.exec_cmd_only_success(git_cmd).split('\n') - items_full = map(unicode.split, lines) + func = unicode.split if sys.version_info[0] < 3 else str.split + items_full = map(func, lines) items = map(lambda it: (it[0], re.sub(r'^refs/heads/', '', it[1])), items_full) result = defaultdict(list) diff --git a/dvc/data_cloud.py b/dvc/data_cloud.py index be5374709..7e217a4a5 100644 --- a/dvc/data_cloud.py +++ b/dvc/data_cloud.py @@ -10,6 +10,14 @@ import filecmp import math from boto.s3.connection import S3Connection +try: + import httplib +except ImportError: + # Python3 workaround for ResumableDownloadHandler. + # See https://github.com/boto/boto/pull/3755. + import sys + import http.client as httplib + sys.modules['httplib'] = httplib from boto.s3.resumable_download_handler import ResumableDownloadHandler from google.cloud import storage as gc diff --git a/dvc/graph/workflow.py b/dvc/graph/workflow.py index 56a0c68f7..192e76274 100644 --- a/dvc/graph/workflow.py +++ b/dvc/graph/workflow.py @@ -109,7 +109,7 @@ class Workflow(object): g = nx.DiGraph(name='DVC Workflow', directed=False) - for hash in set(self._edges.keys() + self._back_edges.keys()): + for hash in set(list(self._edges.keys()) + list(self._back_edges.keys())): commit = self._commits[hash] g.add_node(hash, diff --git a/scripts/ci/after_script.sh b/scripts/ci/after_script.sh index 526c5a378..6fe448d99 100644 --- a/scripts/ci/after_script.sh +++ b/scripts/ci/after_script.sh @@ -1,5 +1,8 @@ #!/bin/bash +set -x +set -e + if [[ "$TRAVIS_OS_NAME" == "linux" && \ "$(python -c 'import sys; print(sys.version_info[0])')" == "2" && \ "$TRAVIS_PULL_REQUEST" == "false" && \ diff --git a/scripts/ci/before_deploy.sh b/scripts/ci/before_deploy.sh index 23276298e..15d2dcd5b 100644 --- a/scripts/ci/before_deploy.sh +++ b/scripts/ci/before_deploy.sh @@ -1,3 +1,8 @@ +#!/bin/bash + +set -x +set -e + if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then git config --local user.name 'Nightly Travis Builds' git config --local user.email '<>' diff --git a/scripts/ci/before_install.sh b/scripts/ci/before_install.sh index 69211a431..0e3380acd 100644 --- a/scripts/ci/before_install.sh +++ b/scripts/ci/before_install.sh @@ -1,3 +1,8 @@ +#!/bin/bash + +set -x +set -e + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pyenv install $PYTHON_VER pyenv global $PYTHON_VER diff --git a/scripts/ci/before_script.sh b/scripts/ci/before_script.sh index c664cff3d..0a7173f41 100644 --- a/scripts/ci/before_script.sh +++ b/scripts/ci/before_script.sh @@ -1,5 +1,8 @@ #!/bin/bash +set -x +set -e + if [[ "$TRAVIS_OS_NAME" == "linux" && \ "$(python -c 'import sys; print(sys.version_info[0])')" == "2" && \ "$TRAVIS_PULL_REQUEST" == "false" && \ diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index d23a9f728..3c99b2b23 100644 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -1,3 +1,9 @@ +#!/bin/bash + +set -x +set -e + +sudo apt-get install graphviz pip install --upgrade pip pip install -r requirements.txt pip install -r test-requirements.txt diff --git a/scripts/ci/script.sh b/scripts/ci/script.sh index 827f05bd1..3b45b2614 100644 --- a/scripts/ci/script.sh +++ b/scripts/ci/script.sh @@ -1,3 +1,8 @@ +#!/bin/bash + +set -x +set -e + ./unittests.sh ./functests.sh