Skip to content
This repository was archived by the owner on Jan 23, 2026. It is now read-only.

Commit 7275d37

Browse files
committed
Use xdg config home for client config
1 parent 955baef commit 7275d37

4 files changed

Lines changed: 19 additions & 7 deletions

File tree

conftest.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
try:
99
from jumpstarter.common.utils import serve
10-
from jumpstarter.config import ClientConfigV1Alpha1, ExporterConfigV1Alpha1DriverInstance, UserConfigV1Alpha1
10+
from jumpstarter.config import ExporterConfigV1Alpha1DriverInstance
1111
from jumpstarter.config.exporter import ExporterConfigV1Alpha1
1212
except ImportError:
1313
# some packages in the workspace does not depend on jumpstarter
@@ -26,6 +26,5 @@ def jumpstarter_namespace(doctest_namespace):
2626

2727
@pytest.fixture(autouse=True)
2828
def tmp_config_path(tmp_path, monkeypatch):
29-
monkeypatch.setattr(UserConfigV1Alpha1, "USER_CONFIG_PATH", tmp_path / "config.yaml")
30-
monkeypatch.setattr(ClientConfigV1Alpha1, "CLIENT_CONFIGS_PATH", tmp_path / "clients")
29+
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "client-config"))
3130
monkeypatch.setattr(ExporterConfigV1Alpha1, "BASE_PATH", tmp_path / "exporters")

packages/jumpstarter/jumpstarter/config/common.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
from pathlib import Path
2-
31
from pydantic import BaseModel
2+
from xdg_base_dirs import (
3+
xdg_config_home,
4+
)
45

56
CONFIG_API_VERSION = "jumpstarter.dev/v1alpha1"
6-
CONFIG_PATH = Path.home() / ".config" / "jumpstarter"
7+
CONFIG_PATH = xdg_config_home() / "jumpstarter"
78

89

910
class ObjectMeta(BaseModel):

packages/jumpstarter/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ dependencies = [
1616
"anyio>=4.4.0,!=4.6.2",
1717
"aiohttp>=3.10.5",
1818
"tqdm>=4.66.5",
19-
"pydantic>=2.8.2"
19+
"pydantic>=2.8.2",
20+
"xdg-base-dirs>=6.0.2",
2021
]
2122

2223
[dependency-groups]

uv.lock

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)