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

Commit 58eb921

Browse files
authored
Merge pull request #384 from jumpstarter-dev/xdg
Use xdg config home for client config
2 parents c8b8a3a + 02bc452 commit 58eb921

6 files changed

Lines changed: 20 additions & 9 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")

docs/source/api-reference/adapters/network.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export:
5555
```{doctest}
5656
>>> with UnixPortforwardAdapter(client=client.unix_socket) as addr:
5757
... print(addr)
58-
/tmp/jumpstarter-.../socket
58+
/.../socket
5959
>>> # the type of the remote socket and the local one doesn't have to match
6060
>>> # e.g. forward a remote Unix domain socket to a local TCP port
6161
>>> with TcpPortforwardAdapter(client=client.unix_socket) as addr:

packages/jumpstarter/jumpstarter/common/tempfile.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55

66
from anyio import create_task_group, create_tcp_listener, create_unix_listener
77
from anyio.abc import SocketAttribute
8+
from xdg_base_dirs import xdg_runtime_dir
89

910

1011
@contextmanager
1112
def TemporarySocket():
12-
with TemporaryDirectory(prefix="jumpstarter-") as tempdir:
13+
with TemporaryDirectory(dir=xdg_runtime_dir(), prefix="jumpstarter-") as tempdir:
1314
yield Path(tempdir) / "socket"
1415

1516

packages/jumpstarter/jumpstarter/config/common.py

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

54
CONFIG_API_VERSION = "jumpstarter.dev/v1alpha1"
6-
CONFIG_PATH = Path.home() / ".config" / "jumpstarter"
5+
CONFIG_PATH = xdg_config_home() / "jumpstarter"
76

87

98
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)