mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 15:28:34 +01:00
black: bump version 19.3b0 -> 19.10b0 (#3307)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/ambv/black
|
||||
rev: 19.3b0
|
||||
rev: 19.10b0
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
---
|
||||
restylers:
|
||||
- name: black
|
||||
image: restyled/restyler-black:v19.3b0
|
||||
image: restyled/restyler-black:v19.10b0
|
||||
command:
|
||||
- black
|
||||
arguments: []
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"}}
|
||||
)
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user