mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
fix windows path handling
This commit is contained in:
committed by
David de la Iglesia Castro
parent
28402dedf1
commit
d57bb23c93
@@ -9,7 +9,12 @@ from dvc.output import Output
|
||||
from dvc.repo import locked
|
||||
from dvc.repo.collect import StrPaths, collect
|
||||
from dvc.scm import NoSCMError
|
||||
from dvc.utils import error_handler, errored_revisions, onerror_collect
|
||||
from dvc.utils import (
|
||||
as_posix,
|
||||
error_handler,
|
||||
errored_revisions,
|
||||
onerror_collect,
|
||||
)
|
||||
from dvc.utils.collections import ensure_list
|
||||
from dvc.utils.serialize import load_path
|
||||
|
||||
@@ -31,12 +36,12 @@ def _to_fs_paths(metrics: List[Output]) -> StrPaths:
|
||||
def _collect_top_level_metrics(repo):
|
||||
top_metrics = repo.index._top_metrics # pylint: disable=protected-access
|
||||
for dvcfile, metrics in top_metrics.items():
|
||||
wdir = repo.dvcfs.path.relpath(
|
||||
repo.dvcfs.path.parent(dvcfile), repo.root_dir
|
||||
wdir = repo.fs.path.relpath(
|
||||
repo.fs.path.parent(dvcfile), repo.root_dir
|
||||
)
|
||||
for file in metrics:
|
||||
path = repo.dvcfs.path.join(wdir, file)
|
||||
yield repo.dvcfs.path.normpath(path)
|
||||
path = repo.fs.path.join(wdir, as_posix(file))
|
||||
yield repo.fs.path.normpath(path)
|
||||
|
||||
|
||||
def _collect_metrics(repo, targets, revision, recursive):
|
||||
|
||||
+10
-5
@@ -20,7 +20,12 @@ from dvc.repo.collect import collect
|
||||
from dvc.scm import NoSCMError
|
||||
from dvc.stage import PipelineStage
|
||||
from dvc.ui import ui
|
||||
from dvc.utils import error_handler, errored_revisions, onerror_collect
|
||||
from dvc.utils import (
|
||||
as_posix,
|
||||
error_handler,
|
||||
errored_revisions,
|
||||
onerror_collect,
|
||||
)
|
||||
from dvc.utils.collections import ensure_list
|
||||
from dvc.utils.serialize import load_path
|
||||
|
||||
@@ -38,12 +43,12 @@ def _is_params(dep: "Output"):
|
||||
def _collect_top_level_params(repo):
|
||||
top_params = repo.index._top_params # pylint: disable=protected-access
|
||||
for dvcfile, params in top_params.items():
|
||||
wdir = repo.dvcfs.path.relpath(
|
||||
repo.dvcfs.path.parent(dvcfile), repo.root_dir
|
||||
wdir = repo.fs.path.relpath(
|
||||
repo.fs.path.parent(dvcfile), repo.root_dir
|
||||
)
|
||||
for file in params:
|
||||
path = repo.dvcfs.path.join(wdir, file)
|
||||
yield repo.dvcfs.path.normpath(path)
|
||||
path = repo.fs.path.join(wdir, as_posix(file))
|
||||
yield repo.fs.path.normpath(path)
|
||||
|
||||
|
||||
def _collect_configs(
|
||||
|
||||
Reference in New Issue
Block a user