Skip to content

Commit 15452de

Browse files
committed
Locate the config using jupyter_core.paths.jupyter_config_dir()
1 parent 59865fd commit 15452de

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/jupytext_config/jupytext_config.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
import sys
88
from argparse import ArgumentParser
9+
from pathlib import Path
910

10-
from .labconfig import DEFAULT_SETTINGS_FILE, LabConfig
11+
import jupyter_core.paths as jupyter_core_paths
12+
13+
from .labconfig import LabConfig
1114

1215

1316
class SubCommand:
@@ -86,7 +89,12 @@ def fill_parser(self, subparser):
8689

8790
def main():
8891
parser = ArgumentParser()
89-
parser.add_argument("--settings-file", default=DEFAULT_SETTINGS_FILE)
92+
parser.add_argument(
93+
"--settings-file",
94+
default=Path(jupyter_core_paths.jupyter_config_dir())
95+
/ "labconfig"
96+
/ "default_setting_overrides.json",
97+
)
9098
subparsers = parser.add_subparsers(required=True)
9199
for subcommand in SUBCOMMANDS:
92100
subparser = subparsers.add_parser(subcommand.name, help=subcommand.help)

src/jupytext_config/labconfig.py

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
import logging
1010
from pathlib import Path
1111

12-
DEFAULT_SETTINGS_FILE = (
13-
Path.home() / ".jupyter" / "labconfig" / "default_setting_overrides.json"
14-
)
15-
1612

1713
class LabConfig:
1814
DOCTYPES = [

0 commit comments

Comments
 (0)