dvc-utils 0.3.1__py3-none-any.whl → 0.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dvc_utils/diff.py CHANGED
@@ -18,6 +18,7 @@ from dvc_utils.path import dvc_paths, dvc_cache_path
18
18
  short_help='Diff a DVC-tracked file at two commits (or one commit vs. current worktree), optionally passing both through another command first',
19
19
  no_args_is_help=True,
20
20
  )
21
+ @option('-b/-B', '--both/--no-both', default=False, help='Merge stderr into stdout in pipeline commands (like shell `2>&1`), so stderr is included in diff output. Default: stderr shown only on command failures.')
21
22
  @option('-c/-C', '--color/--no-color', default=None, help='Force or prevent colorized output')
22
23
  @option('-r', '--refspec', help='<commit 1>..<commit 2> (compare two commits) or <commit> (compare <commit> to the worktree)')
23
24
  @option('-R', '--ref', help='Shorthand for `-r <ref>^..<ref>`, i.e. inspect a specific commit (vs. its parent)')
@@ -29,6 +30,7 @@ from dvc_utils.path import dvc_paths, dvc_cache_path
29
30
  @option('-x', '--exec-cmd', 'exec_cmds', multiple=True, help='Command(s) to execute before diffing; alternate syntax to passing commands as positional arguments')
30
31
  @argument('args', metavar='[exec_cmd...] <path>', nargs=-1)
31
32
  def dvc_diff(
33
+ both: bool,
32
34
  color: bool | None,
33
35
  refspec: str | None,
34
36
  ref: str | None,
@@ -118,6 +120,7 @@ def dvc_diff(
118
120
  verbose=verbose,
119
121
  shell=shell,
120
122
  executable=shell_executable,
123
+ both=both,
121
124
  )
122
125
  exit(returncode)
123
126
  else:
dvc_utils/path.py CHANGED
@@ -60,7 +60,8 @@ def dvc_md5(
60
60
  relpath = basename(dvc_path)
61
61
  if relpath.endswith(".dvc"):
62
62
  relpath = relpath[:-len(".dvc")]
63
- while cur_dir and cur_dir != '.':
63
+ prev_dir = None
64
+ while cur_dir and cur_dir != '.' and cur_dir != prev_dir:
64
65
  dir_cache_path = dvc_cache_path(ref=git_ref, dvc_path=f"{cur_dir}.dvc", log=log)
65
66
  if dir_cache_path:
66
67
  with open(dir_cache_path, 'r') as f:
@@ -71,6 +72,7 @@ def dvc_md5(
71
72
  else:
72
73
  raise RuntimeError(f"{relpath=} not found in DVC-tracked dir {cur_dir}")
73
74
  relpath = join(basename(cur_dir), relpath)
75
+ prev_dir = cur_dir
74
76
  cur_dir = dirname(cur_dir)
75
77
  return None
76
78
  dvc_obj = yaml.safe_load(dvc_spec)
@@ -1,15 +1,15 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dvc-utils
3
- Version: 0.3.1
3
+ Version: 0.3.2
4
4
  Summary: CLI for diffing DVC-tracked files at two commits (or one commit vs. current worktree), optionally passing both through another command first
5
5
  Project-URL: Homepage, https://github.com/runsascoded/dvc-utils
6
6
  Project-URL: Author URL, https://github.com/ryan-williams
7
7
  Author-email: Ryan Williams <ryan@runsascoded.com>
8
8
  License: MIT
9
9
  License-File: LICENSE
10
- Requires-Python: >=3.9
10
+ Requires-Python: >=3.10
11
11
  Requires-Dist: click
12
- Requires-Dist: dffs>=0.0.6
12
+ Requires-Dist: dffs>=0.0.7
13
13
  Requires-Dist: pyyaml
14
14
  Requires-Dist: utz>=0.20.0
15
15
  Provides-Extra: ci
@@ -62,6 +62,10 @@ dvc-diff
62
62
  # optional) at HEAD (last committed value) vs. the current worktree content.
63
63
  #
64
64
  # Options:
65
+ # -b, --both / -B, --no-both Merge stderr into stdout in pipeline commands
66
+ # (like shell `2>&1`), so stderr is included in
67
+ # diff output. Default: stderr shown only on
68
+ # command failures.
65
69
  # -c, --color / -C, --no-color Force or prevent colorized output
66
70
  # -r, --refspec TEXT <commit 1>..<commit 2> (compare two commits)
67
71
  # or <commit> (compare <commit> to the worktree)
@@ -0,0 +1,11 @@
1
+ dvc_utils/__init__.py,sha256=Q9_9py_bah16WN6RIryNMelBvG9IJW1B1Sm2PEU87Yk,92
2
+ dvc_utils/cli.py,sha256=et2OeEWJeY0XUuStMVd8qmjtOgDbXl9esn3KYZCQFSI,318
3
+ dvc_utils/diff.py,sha256=wUCbVU4HvEP_YzcsHeL9RMi3yHvNIf2TqAEWSsZTzTo,5368
4
+ dvc_utils/main.py,sha256=cfbwebEc9Auh9DXyah31kvd9Br_uCsUxzOXkucfiSnM,119
5
+ dvc_utils/path.py,sha256=gC9LMCaAVcfCmcOAt7XI_gtk25U6CKoQSDKLRBR4-Qg,3034
6
+ dvc_utils/sync.py,sha256=gDwo0Z4lMK--xRwsACIpJRWS5rF6g7Wou0LJRxNd6b4,481
7
+ dvc_utils-0.3.2.dist-info/METADATA,sha256=9008bq-4FbTfazTVUueQEBQHrIEg2HgaqN6GDXNGxrM,15276
8
+ dvc_utils-0.3.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ dvc_utils-0.3.2.dist-info/entry_points.txt,sha256=VHnkBNH2bPbP1wX8-rKK_T13f3e9tnmAGBcrP0hjTr0,85
10
+ dvc_utils-0.3.2.dist-info/licenses/LICENSE,sha256=ZS8AReay7xmQzBAHwxIuTouGXz3SKgUa2_Sz8Ip0EzQ,1070
11
+ dvc_utils-0.3.2.dist-info/RECORD,,
@@ -1,11 +0,0 @@
1
- dvc_utils/__init__.py,sha256=Q9_9py_bah16WN6RIryNMelBvG9IJW1B1Sm2PEU87Yk,92
2
- dvc_utils/cli.py,sha256=et2OeEWJeY0XUuStMVd8qmjtOgDbXl9esn3KYZCQFSI,318
3
- dvc_utils/diff.py,sha256=k4_1rjCfvtQkTwelPkrp2m6lrh8lU4IUg7aaKw3YhU8,5112
4
- dvc_utils/main.py,sha256=cfbwebEc9Auh9DXyah31kvd9Br_uCsUxzOXkucfiSnM,119
5
- dvc_utils/path.py,sha256=tdigsKTCZPhCIb9wRX4e_tj1lUxa2gm6lXERlfb8qY4,2955
6
- dvc_utils/sync.py,sha256=gDwo0Z4lMK--xRwsACIpJRWS5rF6g7Wou0LJRxNd6b4,481
7
- dvc_utils-0.3.1.dist-info/METADATA,sha256=aWI-NtzxzF66gfP7jH3oVf7n6HDtAzvuJg8biTFk7Cw,14986
8
- dvc_utils-0.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- dvc_utils-0.3.1.dist-info/entry_points.txt,sha256=VHnkBNH2bPbP1wX8-rKK_T13f3e9tnmAGBcrP0hjTr0,85
10
- dvc_utils-0.3.1.dist-info/licenses/LICENSE,sha256=ZS8AReay7xmQzBAHwxIuTouGXz3SKgUa2_Sz8Ip0EzQ,1070
11
- dvc_utils-0.3.1.dist-info/RECORD,,