mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-01 23:08:43 +01:00
💅 revert black upgrade
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
---
|
||||
restylers:
|
||||
- name: black
|
||||
image: restyled/restyler-black:v19.10b0
|
||||
image: restyled/restyler-black:v19.3b0
|
||||
command:
|
||||
- black
|
||||
arguments: []
|
||||
|
||||
+1
-1
@@ -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))
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+2
-2
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user