Skip to content

Commit

Permalink
Make it compatible with windows
Browse files Browse the repository at this point in the history
  • Loading branch information
amritghimire committed Oct 17, 2024
1 parent 8e72e7d commit b1d6ace
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/datachain/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class DataChainDir:
TMP = "tmp"
DB = "db"
CONFIG = "config"
CONFIG = "config"
ENV_VAR = "DATACHAIN_DIR"
ENV_VAR_DATACHAIN_ROOT = "DATACHAIN_ROOT_DIR"

Expand All @@ -53,7 +52,6 @@ def __init__(
tmp: Optional[str] = None,
db: Optional[str] = None,
config: Optional[str] = None,
config: Optional[str] = None,
) -> None:
self.root = osp.abspath(root) if root is not None else self.default_root()
self.cache = (
Expand Down
7 changes: 5 additions & 2 deletions tests/unit/test_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

import pytest
from tomlkit import TOMLDocument, dump

Expand Down Expand Up @@ -49,14 +51,15 @@ def create_local_config(current_dir):
"local-conf": "exists",
}

with open(DataChainDir(current_dir + "/.datachain").config, "w") as f:
with open(DataChainDir(os.path.join(current_dir, ".datachain")).config, "w") as f:
dump(conf, f)


def test_get_dir(global_config_dir, system_config_dir, current_dir):
assert Config.get_dir(ConfigLevel.GLOBAL) == global_config_dir
assert Config.get_dir(ConfigLevel.SYSTEM) == system_config_dir
assert Config.get_dir(ConfigLevel.LOCAL) == current_dir + "/.datachain"

assert Config.get_dir(ConfigLevel.LOCAL) == os.path.join(current_dir, ".datachain")


def test_read_config(global_config_dir, system_config_dir, current_dir):
Expand Down

0 comments on commit b1d6ace

Please sign in to comment.