Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert all paths in config to posix-style #3665

Merged
merged 7 commits into from
Apr 23, 2020
24 changes: 18 additions & 6 deletions dvc/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
"""DVC config objects."""
from contextlib import contextmanager
import logging
import os
import re
from contextlib import contextmanager
from pathlib import Path, PurePosixPath
from urllib.parse import urlparse

from funcy import cached_property, re_find, walk_values, compact
import configobj
from voluptuous import Schema, Optional, Invalid, ALLOW_EXTRA
from voluptuous import All, Any, Lower, Range, Coerce
from funcy import cached_property, compact, re_find, walk_values
from voluptuous import (
ALLOW_EXTRA,
All,
Any,
Coerce,
Invalid,
Lower,
Optional,
Range,
Schema,
)

from dvc.exceptions import DvcException, NotDvcRepoError
from dvc.utils import relpath
Expand Down Expand Up @@ -320,8 +330,10 @@ def rel(path):
return path

if isinstance(path, RelPath) or not os.path.isabs(path):
return relpath(path, conf_dir)
return path
path = relpath(path, conf_dir)

posix_path = str(PurePosixPath(Path(path)))
charlesbaynham marked this conversation as resolved.
Show resolved Hide resolved
return posix_path

return Config._map_dirs(conf, rel)

Expand Down