fix(config): use parents[3] for CORE_REPO_ROOT and check cwd/workspace.toml so hs-doctor resolves outside /workspace (v1.2.0)
This commit is contained in:
1 parent
fff554e304
commit
efc31a3ecb
2 files changed
+7
-1
No files matched your search
@@ -13,7 +13,7 @@ from dataclasses import dataclass, field
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
CORE_REPO_ROOT = Path(__file__).resolve().parents[2]
|
CORE_REPO_ROOT = Path(__file__).resolve().parents[3]
|
||||||
WORKSPACE_ROOT = CORE_REPO_ROOT.parent
|
WORKSPACE_ROOT = CORE_REPO_ROOT.parent
|
||||||
USER_WORKSPACE_TOML = Path.home() / ".config" / "hyperstitionstud.io" / "workspace.toml"
|
USER_WORKSPACE_TOML = Path.home() / ".config" / "hyperstitionstud.io" / "workspace.toml"
|
||||||
|
|
||||||
@@ -78,6 +78,7 @@ def load_workspace_config(
|
|||||||
candidates.append(Path(env_p))
|
candidates.append(Path(env_p))
|
||||||
candidates.extend([
|
candidates.extend([
|
||||||
ws_root / "workspace.toml",
|
ws_root / "workspace.toml",
|
||||||
|
Path.cwd() / "workspace.toml",
|
||||||
USER_WORKSPACE_TOML,
|
USER_WORKSPACE_TOML,
|
||||||
Path("/workspace/workspace.toml"),
|
Path("/workspace/workspace.toml"),
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -11,8 +11,13 @@ Tests:
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
_SRC_DIR = Path(__file__).resolve().parents[1] / "src"
|
||||||
|
if _SRC_DIR.is_dir() and str(_SRC_DIR) not in sys.path:
|
||||||
|
sys.path.insert(0, str(_SRC_DIR))
|
||||||
|
|
||||||
from hyperstitionstud_io.ciphers import (
|
from hyperstitionstud_io.ciphers import (
|
||||||
assert_zero_d_filter,
|
assert_zero_d_filter,
|
||||||
compute_aq,
|
compute_aq,
|
||||||
|
|||||||
Reference in new issue
Block a user