diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2c5d11fe..d27f67a26 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/ambv/black - rev: 19.3b0 + rev: 19.10b0 hooks: - id: black language_version: python3 diff --git a/.restyled.yaml b/.restyled.yaml index d5eeec715..245d33d2c 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -1,7 +1,7 @@ --- restylers: - name: black - image: restyled/restyler-black:v19.3b0 + image: restyled/restyler-black:v19.10b0 command: - black arguments: [] diff --git a/setup.py b/setup.py index 40b3b16c5..f4e6ba825 100644 --- a/setup.py +++ b/setup.py @@ -125,7 +125,7 @@ tests_requirements = [ ] if (sys.version_info) >= (3, 6): - tests_requirements.append("black==19.3b0") + tests_requirements.append("black==19.10b0") setup( name="dvc", diff --git a/tests/func/remote/test_local.py b/tests/func/remote/test_local.py index a6af649a7..cc0f7ded1 100644 --- a/tests/func/remote/test_local.py +++ b/tests/func/remote/test_local.py @@ -8,7 +8,7 @@ from tests.utils import trees_equal def test_dont_fail_on_unpacked_create_fail(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) + (stage,) = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) with mock.patch.object( RemoteLOCAL, "_create_unpacked_dir", side_effect=DvcException("msg") @@ -18,7 +18,7 @@ def test_dont_fail_on_unpacked_create_fail(tmp_dir, dvc): def test_remove_unpacked_on_create_fail(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) + (stage,) = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX # artificial unpacked dir for test purpose @@ -34,7 +34,7 @@ def test_remove_unpacked_on_create_fail(tmp_dir, dvc): def test_create_unpacked_on_status(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) + (stage,) = tmp_dir.dvc_gen({"dir": {"file": "file_content"}}) unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX assert not os.path.exists(unpacked_dir) @@ -45,7 +45,7 @@ def test_create_unpacked_on_status(tmp_dir, dvc): def test_dir_cache_changed_on_single_cache_file_modification(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen( + (stage,) = tmp_dir.dvc_gen( {"dir": {"file1": "file1 content", "file2": "file2 content"}} ) unpacked_dir = stage.outs[0].cache_path + RemoteLOCAL.UNPACKED_DIR_SUFFIX diff --git a/tests/func/test_add.py b/tests/func/test_add.py index 002722f52..8e88e43a2 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -31,7 +31,7 @@ from tests.utils import get_gitignore_content def test_add(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen({"foo": "foo"}) + (stage,) = tmp_dir.dvc_gen({"foo": "foo"}) md5, _ = file_md5("foo") assert stage is not None @@ -49,7 +49,7 @@ def test_add_unicode(tmp_dir, dvc): with open("\xe1", "wb") as fd: fd.write("something".encode("utf-8")) - stage, = dvc.add("\xe1") + (stage,) = dvc.add("\xe1") assert os.path.isfile(stage.path) @@ -60,7 +60,7 @@ def test_add_unsupported_file(dvc): def test_add_directory(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen({"dir": {"file": "file"}}) + (stage,) = tmp_dir.dvc_gen({"dir": {"file": "file"}}) assert stage is not None assert len(stage.deps) == 0 @@ -161,7 +161,7 @@ def test_add_file_in_dir(tmp_dir, dvc): tmp_dir.gen({"dir": {"subdir": {"subdata": "subdata content"}}}) subdir_path = os.path.join("dir", "subdir", "subdata") - stage, = dvc.add(subdir_path) + (stage,) = dvc.add(subdir_path) assert stage is not None assert len(stage.deps) == 0 @@ -549,7 +549,7 @@ def test_windows_should_add_when_cache_on_different_drive( dvc.config.set("cache", "dir", temporary_windows_drive) dvc.cache = Cache(dvc) - stage, = tmp_dir.dvc_gen({"file": "file"}) + (stage,) = tmp_dir.dvc_gen({"file": "file"}) cache_path = stage.outs[0].cache_path assert path_isin(cache_path, temporary_windows_drive) diff --git a/tests/func/test_commit.py b/tests/func/test_commit.py index 51b595d16..8cd254553 100644 --- a/tests/func/test_commit.py +++ b/tests/func/test_commit.py @@ -18,7 +18,7 @@ def test_commit_recursive(tmp_dir, dvc): def test_commit_force(tmp_dir, dvc): tmp_dir.gen({"dir": {"file": "text1", "file2": "text2"}}) - stage, = dvc.add("dir", no_commit=True) + (stage,) = dvc.add("dir", no_commit=True) with dvc.state: assert stage.outs[0].changed_cache() @@ -40,7 +40,7 @@ def test_commit_force(tmp_dir, dvc): def test_commit_with_deps(tmp_dir, dvc, run_copy): tmp_dir.gen("foo", "foo") - foo_stage, = dvc.add("foo", no_commit=True) + (foo_stage,) = dvc.add("foo", no_commit=True) assert foo_stage is not None assert len(foo_stage.outs) == 1 @@ -60,7 +60,7 @@ def test_commit_with_deps(tmp_dir, dvc, run_copy): def test_commit_changed_md5(tmp_dir, dvc): tmp_dir.gen({"file": "file content"}) - stage, = dvc.add("file", no_commit=True) + (stage,) = dvc.add("file", no_commit=True) stage_file_content = load_stage_file(stage.path) stage_file_content["md5"] = "1111111111" diff --git a/tests/func/test_gc.py b/tests/func/test_gc.py index 41c4f2204..f1aa4012a 100644 --- a/tests/func/test_gc.py +++ b/tests/func/test_gc.py @@ -191,7 +191,7 @@ def test_all_commits(tmp_dir, scm, dvc): def test_gc_no_dir_cache(tmp_dir, dvc): tmp_dir.dvc_gen({"foo": "foo", "bar": "bar"}) - dir_stage, = tmp_dir.dvc_gen({"dir": {"x": "x", "subdir": {"y": "y"}}}) + (dir_stage,) = tmp_dir.dvc_gen({"dir": {"x": "x", "subdir": {"y": "y"}}}) os.unlink(dir_stage.outs[0].cache_path) diff --git a/tests/func/test_stage.py b/tests/func/test_stage.py index bbfc7a765..ce4991fd8 100644 --- a/tests/func/test_stage.py +++ b/tests/func/test_stage.py @@ -155,7 +155,7 @@ class TestExternalRemoteResolution(TestDvc): def test_md5_ignores_comments(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen("foo", "foo content") + (stage,) = tmp_dir.dvc_gen("foo", "foo content") with open(stage.path, "a") as f: f.write("# End comment\n") @@ -165,7 +165,7 @@ def test_md5_ignores_comments(tmp_dir, dvc): def test_meta_is_preserved(tmp_dir, dvc): - stage, = tmp_dir.dvc_gen("foo", "foo content") + (stage,) = tmp_dir.dvc_gen("foo", "foo content") # Add meta to DVC-file data = load_stage_file(stage.path) diff --git a/tests/func/test_status.py b/tests/func/test_status.py index 35b66aa51..a34a355f3 100644 --- a/tests/func/test_status.py +++ b/tests/func/test_status.py @@ -37,7 +37,7 @@ def test_status_non_dvc_repo_import(tmp_dir, dvc, git_dir): with git_dir.branch("branch", new=False): git_dir.scm_gen("file", "second version", commit="update file") - status, = dvc.status(["file.dvc"])["file.dvc"] + (status,) = dvc.status(["file.dvc"])["file.dvc"] assert status == { "changed deps": {"file ({})".format(git_dir): "update available"} } @@ -60,7 +60,7 @@ def test_status_before_and_after_dvc_init(tmp_dir, dvc, git_dir): assert old_rev != new_rev - status, = dvc.status(["file.dvc"])["file.dvc"] + (status,) = dvc.status(["file.dvc"])["file.dvc"] assert status == { "changed deps": { "file ({})".format(fspath(git_dir)): "update available" diff --git a/tests/func/test_update.py b/tests/func/test_update.py index e2c68de40..54a5bacbf 100644 --- a/tests/func/test_update.py +++ b/tests/func/test_update.py @@ -59,8 +59,8 @@ def test_update_import_after_remote_updates_to_dvc(tmp_dir, dvc, erepo_dir): assert old_rev != new_rev - status, = dvc.status([stage.path])["version.dvc"] - changed_dep, = list(status["changed deps"].items()) + (status,) = dvc.status([stage.path])["version.dvc"] + (changed_dep,) = list(status["changed deps"].items()) assert changed_dep[0].startswith("version ") assert changed_dep[1] == "update available" diff --git a/tests/unit/repo/test_repo.py b/tests/unit/repo/test_repo.py index 7b515d5c3..d544da793 100644 --- a/tests/unit/repo/test_repo.py +++ b/tests/unit/repo/test_repo.py @@ -17,7 +17,7 @@ def test_is_dvc_internal(dvc): ], ) def test_find_outs_by_path(tmp_dir, dvc, path): - stage, = tmp_dir.dvc_gen( + (stage,) = tmp_dir.dvc_gen( {"dir": {"subdir": {"file": "file"}, "other": "other"}} ) diff --git a/tests/unit/repo/test_reproduce.py b/tests/unit/repo/test_reproduce.py index aef2a3bd2..2b49273ed 100644 --- a/tests/unit/repo/test_reproduce.py +++ b/tests/unit/repo/test_reproduce.py @@ -2,7 +2,7 @@ from dvc.repo.reproduce import _get_active_graph def test_get_active_graph(tmp_dir, dvc): - pre_foo_stage, = tmp_dir.dvc_gen({"pre-foo": "pre-foo"}) + (pre_foo_stage,) = tmp_dir.dvc_gen({"pre-foo": "pre-foo"}) foo_stage = dvc.run(deps=["pre-foo"], outs=["foo"], cmd="echo foo > foo") bar_stage = dvc.run(deps=["foo"], outs=["bar"], cmd="echo bar > bar") baz_stage = dvc.run(deps=["foo"], outs=["baz"], cmd="echo baz > baz")