From 59072f4d18adf4364e267759d0bb42ccf5f74a8b Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Mon, 16 Dec 2019 09:44:59 -0600 Subject: [PATCH] :nail_care: revert black upgrade --- .restyled.yaml | 2 +- dvc/api.py | 2 +- dvc/repo/__init__.py | 6 +++--- dvc/repo/get_url.py | 4 ++-- setup.py | 2 +- tests/func/test_add.py | 8 ++++---- tests/func/test_api.py | 2 +- tests/func/test_commit.py | 6 +++--- tests/func/test_gc.py | 2 +- tests/func/test_stage.py | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.restyled.yaml b/.restyled.yaml index 245d33d2c..d5eeec715 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -1,7 +1,7 @@ --- restylers: - name: black - image: restyled/restyler-black:v19.10b0 + image: restyled/restyler-black:v19.3b0 command: - black arguments: [] diff --git a/dvc/api.py b/dvc/api.py index 8da4cf6ba..bf976dcf0 100644 --- a/dvc/api.py +++ b/dvc/api.py @@ -15,7 +15,7 @@ def get_url(path, repo=None, rev=None, remote=None): """Returns an url of a resource specified by path in repo""" with _make_repo(repo, rev=rev) as _repo: abspath = os.path.join(_repo.root_dir, path) - (out,) = _repo.find_outs_by_path(abspath) + out, = _repo.find_outs_by_path(abspath) remote_obj = _repo.cloud.get_remote(remote) return str(remote_obj.checksum_to_path_info(out.checksum)) diff --git a/dvc/repo/__init__.py b/dvc/repo/__init__.py index 94f792880..8a0afc2d3 100644 --- a/dvc/repo/__init__.py +++ b/dvc/repo/__init__.py @@ -263,7 +263,7 @@ class Repo(object): for stage in stages: if stage.is_repo_import: - (dep,) = stage.deps + dep, = stage.deps cache.external[dep.repo_pair].add(dep.def_path) continue @@ -445,7 +445,7 @@ class Repo(object): def find_out_by_relpath(self, relpath): path = os.path.join(self.root_dir, relpath) - (out,) = self.find_outs_by_path(path) + out, = self.find_outs_by_path(path) return out def is_dvc_internal(self, path): @@ -457,7 +457,7 @@ class Repo(object): """Opens a specified resource as a file descriptor""" cause = None try: - (out,) = self.find_outs_by_path(path) + out, = self.find_outs_by_path(path) except OutputNotFoundError as e: out = None cause = e diff --git a/dvc/repo/get_url.py b/dvc/repo/get_url.py index 5718b20ec..fbc173b64 100644 --- a/dvc/repo/get_url.py +++ b/dvc/repo/get_url.py @@ -14,6 +14,6 @@ def get_url(url, out=None): out = os.path.abspath(out) - (dep,) = dependency.loads_from(None, [url]) - (out,) = output.loads_from(None, [out], use_cache=False) + dep, = dependency.loads_from(None, [url]) + out, = output.loads_from(None, [out], use_cache=False) dep.download(out) diff --git a/setup.py b/setup.py index 81dadf1cb..29a4a0936 100644 --- a/setup.py +++ b/setup.py @@ -141,7 +141,7 @@ tests_requirements = [ ] if (sys.version_info) >= (3, 6): - tests_requirements.append("black==19.10b0") + tests_requirements.append("black==19.3b0") setup( name="dvc", diff --git a/tests/func/test_add.py b/tests/func/test_add.py index bbb4fc4bf..8a76263da 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -32,7 +32,7 @@ from tests.utils import spy 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 @@ -50,7 +50,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) @@ -61,7 +61,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 @@ -162,7 +162,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 diff --git a/tests/func/test_api.py b/tests/func/test_api.py index b6ddc9dd5..54623c080 100644 --- a/tests/func/test_api.py +++ b/tests/func/test_api.py @@ -101,7 +101,7 @@ def _set_remote_url_and_commit(repo, remote_url): # FIXME: this test doesn't use scm ;D def test_open_scm_controlled(dvc_repo, repo_dir): - (stage,) = dvc_repo.add(repo_dir.FOO) + stage, = dvc_repo.add(repo_dir.FOO) stage_content = open(stage.path, "r").read() with api.open(stage.path) as fd: diff --git a/tests/func/test_commit.py b/tests/func/test_commit.py index 85c3623b5..8d6a8e57d 100644 --- a/tests/func/test_commit.py +++ b/tests/func/test_commit.py @@ -20,7 +20,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() @@ -42,7 +42,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 @@ -62,7 +62,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 2fb46eb0c..7d06cb9a3 100644 --- a/tests/func/test_gc.py +++ b/tests/func/test_gc.py @@ -192,7 +192,7 @@ def test_all_commits(tmp_dir, scm, dvc): def test_gc_no_dir_cache(tmp_dir, dvc, repo_template): dvc.add(["foo", "bar"]) - (dir_stage,) = dvc.add("dir") + dir_stage, = dvc.add("dir") os.unlink(dir_stage.outs[0].cache_path) diff --git a/tests/func/test_stage.py b/tests/func/test_stage.py index d4e9e8b97..b87a32d76 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(repo_dir, dvc_repo): - (stage,) = dvc_repo.add("foo") + stage, = dvc_repo.add("foo") with open(stage.path, "a") as f: f.write("# End comment\n") @@ -165,7 +165,7 @@ def test_md5_ignores_comments(repo_dir, dvc_repo): def test_meta_is_preserved(dvc_repo): - (stage,) = dvc_repo.add("foo") + stage, = dvc_repo.add("foo") # Add meta to DVC-file data = load_stage_file(stage.path)