calkit-python 0.41.21__py3-none-any.whl → 0.41.23__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. calkit/cli/main/core.py +53 -6
  2. calkit/cli/overleaf.py +24 -50
  3. calkit/overleaf.py +63 -0
  4. calkit/tests/cli/main/test_core.py +79 -0
  5. calkit/tests/cli/test_overleaf.py +32 -0
  6. {calkit_python-0.41.21.dist-info → calkit_python-0.41.23.dist-info}/METADATA +1 -1
  7. {calkit_python-0.41.21.dist-info → calkit_python-0.41.23.dist-info}/RECORD +24 -24
  8. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/etc/jupyter/jupyter_server_config.d/calkit.json +0 -0
  9. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/package.json +0 -0
  10. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/schemas/calkit/package.json.orig +0 -0
  11. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/schemas/calkit/plugin.json +0 -0
  12. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/502.9a2c5772a15466e923ef.js +0 -0
  13. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/695.2c41003a452d43d2b358.js +0 -0
  14. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/867.a42a046aa5108f54f8fb.js +0 -0
  15. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/909.e3f9cc3408834a7fdcc3.js +0 -0
  16. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js +0 -0
  17. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js.LICENSE.txt +0 -0
  18. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/b2f1c3efe70cb539d121.png +0 -0
  19. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/remoteEntry.ac9035764d5b2adbb542.js +0 -0
  20. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/style.js +0 -0
  21. {calkit_python-0.41.21.data → calkit_python-0.41.23.data}/data/share/jupyter/labextensions/calkit/static/third-party-licenses.json +0 -0
  22. {calkit_python-0.41.21.dist-info → calkit_python-0.41.23.dist-info}/WHEEL +0 -0
  23. {calkit_python-0.41.21.dist-info → calkit_python-0.41.23.dist-info}/entry_points.txt +0 -0
  24. {calkit_python-0.41.21.dist-info → calkit_python-0.41.23.dist-info}/licenses/LICENSE +0 -0
calkit/cli/main/core.py CHANGED
@@ -1419,6 +1419,39 @@ def _stage_run_info_from_log_content(log_content: str) -> dict:
1419
1419
  return res
1420
1420
 
1421
1421
 
1422
+ def _run_dvc_repro(argv: list[str]) -> int | None:
1423
+ """Run ``dvc repro`` via the DVC CLI, tolerating teardown failures.
1424
+
1425
+ Returns DVC's exit code, or ``None`` if the command ran but DVC's
1426
+ post-command teardown failed to import a module. After ``do_run`` finishes,
1427
+ ``dvc.cli.main`` reports anonymous analytics and cleans up cached repos,
1428
+ importing ``dvc.daemon`` and ``dvc.repo.open_repo`` only at that point. In
1429
+ some broken or mixed installs those submodules can't be imported, so the
1430
+ teardown raises a ``ModuleNotFoundError`` that escapes DVC entirely and
1431
+ crashes the run with a confusing traceback once the pipeline has already
1432
+ finished (see issue #1018). That doesn't affect the pipeline result, so
1433
+ swallow it and signal ``None`` so the caller derives success/failure from
1434
+ the run log instead of a lost exit code.
1435
+
1436
+ Only those two modules are tolerated, and deliberately so. ``dvc.cli.main``
1437
+ runs the command inside a broad ``except Exception`` that turns any failure
1438
+ into an exit code, so nothing from the command itself reaches here; but it
1439
+ also imports ``dvc._debug``/``dvc.config``/``dvc.logger`` *before* that
1440
+ block, and a broken install can fail there too. Swallowing those would leave
1441
+ an empty run log and report a pipeline that never ran as successful, so
1442
+ anything but a teardown module must propagate and fail loudly.
1443
+ """
1444
+ from dvc.cli import main as dvc_cli_main
1445
+
1446
+ try:
1447
+ return int(dvc_cli_main(argv))
1448
+ except ModuleNotFoundError as e:
1449
+ if e.name not in ("dvc.daemon", "dvc.repo.open_repo"):
1450
+ raise
1451
+ warn(f"DVC post-run teardown failed and was ignored ({e})")
1452
+ return None
1453
+
1454
+
1422
1455
  def _prune_run_logs(
1423
1456
  logs_dir: str, keep: int = 10, protect: str | None = None
1424
1457
  ) -> None:
@@ -1828,7 +1861,6 @@ def run(
1828
1861
  import dvc.repo
1829
1862
  import dvc.repo.reproduce
1830
1863
  import dvc.ui
1831
- from dvc.cli import main as dvc_cli_main
1832
1864
  from git.exc import InvalidGitRepositoryError
1833
1865
 
1834
1866
  import calkit.dvc.zip
@@ -2080,13 +2112,21 @@ def run(
2080
2112
  with calkit.dvc.dvc_lock_timeout(
2081
2113
  calkit.dvc.DEFAULT_RUN_LOCK_TIMEOUT
2082
2114
  ):
2083
- sp_res = dvc_cli_main(["repro"] + sp_args)
2115
+ sp_res = _run_dvc_repro(["repro"] + sp_args)
2084
2116
  finally:
2085
2117
  os.chdir(original_dir)
2086
- if sp_res != 0:
2118
+ # ``None`` means the stage ran but DVC's teardown failed; treat that
2119
+ # as success since the exit code is unrecoverable here.
2120
+ if sp_res is not None and sp_res != 0:
2087
2121
  failed = True
2088
2122
  if not args or all(a.startswith("--") for a in args):
2089
- # Only isolated subproject stage targets were given; skip parent run
2123
+ # Only isolated subproject stage targets were given; skip the parent
2124
+ # run, but still report failure the way the parent path does below,
2125
+ # else a failing subproject stage would exit zero.
2126
+ os.environ.pop("CALKIT_PIPELINE_RUNNING", None)
2127
+ if failed:
2128
+ raise_error("Pipeline failed")
2129
+ calkit.echo("Pipeline completed successfully ✅")
2090
2130
  return {}
2091
2131
  if pipeline is not None:
2092
2132
  args += ["--pipeline", pipeline]
@@ -2157,14 +2197,21 @@ def run(
2157
2197
  # the instant it finishes) can all hold it momentarily. Without this,
2158
2198
  # such a collision aborts the whole run with "Unable to acquire lock".
2159
2199
  with calkit.dvc.dvc_lock_timeout(calkit.dvc.DEFAULT_RUN_LOCK_TIMEOUT):
2160
- res = dvc_cli_main(["repro"] + args)
2200
+ res = _run_dvc_repro(["repro"] + args)
2161
2201
  finally:
2162
2202
  os.environ.pop("CALKIT_FORCE", None)
2163
- failed = failed or res != 0
2164
2203
  # Parse log to get timing and which stages ran
2165
2204
  with open(log_fpath, "r") as f:
2166
2205
  log_content = f.read()
2167
2206
  stage_run_info = _stage_run_info_from_log_content(log_content)
2207
+ if res is None:
2208
+ # DVC's exit code was lost to a teardown failure; fall back to the log,
2209
+ # which records any stage that failed to reproduce.
2210
+ failed = failed or any(
2211
+ info.get("status") == "failed" for info in stage_run_info.values()
2212
+ )
2213
+ else:
2214
+ failed = failed or res != 0
2168
2215
  # Zip dvc-zip outputs for stages that actually ran
2169
2216
  if stage_run_info:
2170
2217
  from calkit.models.io import PathOutput
calkit/cli/overleaf.py CHANGED
@@ -16,6 +16,20 @@ from calkit.cli import AliasGroup, raise_error, warn
16
16
 
17
17
  overleaf_app = typer.Typer(cls=AliasGroup, no_args_is_help=True)
18
18
 
19
+ # Shown when a pull from Overleaf fails, most commonly due to an invalid or
20
+ # expired token. Calkit authenticates only with the token in its config, but a
21
+ # stale token cached by the OS credential manager from an earlier version can
22
+ # still interfere, so we point users there as a fallback.
23
+ PULL_FAILED_MESSAGE = (
24
+ "Failed to pull from Overleaf; "
25
+ "check that your Overleaf token is valid\n"
26
+ "Run 'calkit config get overleaf_token' and ensure that it matches one in "
27
+ "your Overleaf account settings (https://overleaf.com/user/settings).\n"
28
+ "If it looks correct but pulling still fails, delete any saved "
29
+ "'git.overleaf.com' credential from your OS credential manager (Windows "
30
+ "Credential Manager, macOS Keychain, or your Linux keyring) and try again."
31
+ )
32
+
19
33
 
20
34
  def _extract_title_from_tex(tex_file_path: str) -> str | None:
21
35
  """Extract the title from a LaTeX file."""
@@ -169,8 +183,6 @@ def import_publication(
169
183
  ] = False,
170
184
  ):
171
185
  """Import a publication from an Overleaf project."""
172
- import git
173
-
174
186
  from calkit.cli.main import ignore as git_ignore
175
187
  from calkit.cli.new import new_latex_stage
176
188
 
@@ -202,16 +214,13 @@ def import_publication(
202
214
  overleaf_dir = os.path.join(".calkit", "overleaf")
203
215
  os.makedirs(overleaf_dir, exist_ok=True)
204
216
  git_ignore(overleaf_dir, no_commit=no_commit)
205
- overleaf_project_dir = os.path.join(overleaf_dir, overleaf_project_id)
206
- git_clone_url = calkit.overleaf.get_git_remote_url(
207
- project_id=overleaf_project_id, token=overleaf_token
208
- )
217
+ overleaf_project_dir = calkit.overleaf.get_project_dir(overleaf_project_id)
209
218
  if os.path.isdir(overleaf_project_dir):
210
219
  warn("This Overleaf project has already been cloned; removing")
211
220
  shutil.rmtree(overleaf_project_dir)
212
221
  # Clone the Overleaf project
213
222
  typer.echo("Cloning Overleaf project")
214
- git.Repo.clone_from(git_clone_url, overleaf_project_dir)
223
+ calkit.overleaf.clone(overleaf_project_id, overleaf_token)
215
224
  # Detect target path if not specified
216
225
  if target_path is None:
217
226
  ol_contents = os.listdir(
@@ -428,8 +437,6 @@ def sync(
428
437
  ] = False,
429
438
  ):
430
439
  """Sync folders with Overleaf."""
431
- import git
432
-
433
440
  # TODO: We should probably ensure the pipeline isn't stale
434
441
  # Read all synced folders, fixing legacy schema if applicable
435
442
  overleaf_info = calkit.overleaf.get_sync_info(fix_legacy=True)
@@ -504,32 +511,15 @@ def sync(
504
511
  "or use --auto-commit/-a to automatically commit them."
505
512
  )
506
513
  # Ensure we've cloned the Overleaf project
507
- overleaf_project_dir = os.path.join(
508
- ".calkit", "overleaf", overleaf_project_id
514
+ overleaf_repo = calkit.overleaf.get_repo(
515
+ overleaf_project_id, str(overleaf_token)
509
516
  )
510
- overleaf_remote_url = calkit.overleaf.get_git_remote_url(
511
- project_id=overleaf_project_id, token=str(overleaf_token)
512
- )
513
- if not os.path.isdir(overleaf_project_dir):
514
- overleaf_repo = git.Repo.clone_from(
515
- overleaf_remote_url, to_path=overleaf_project_dir
516
- )
517
- else:
518
- overleaf_repo = calkit.git.get_repo(overleaf_project_dir)
519
517
  # Pull the latest version in the Overleaf project
520
518
  typer.echo("Pulling the latest version from Overleaf")
521
- # Ensure that our current Overleaf remote URL is correct
522
- overleaf_repo.git.remote("set-url", "origin", overleaf_remote_url)
523
519
  try:
524
520
  overleaf_repo.git.pull()
525
521
  except Exception:
526
- raise_error(
527
- "Failed to pull from Overleaf; "
528
- "check that your Overleaf token is valid\n"
529
- "Run 'calkit config get overleaf_token' and ensure that "
530
- "it matches one in your Overleaf account settings "
531
- "(https://overleaf.com/user/settings)"
532
- )
522
+ raise_error(PULL_FAILED_MESSAGE)
533
523
  if resolve:
534
524
  last_sync_commit = resolving_info["last_overleaf_commit"]
535
525
  else:
@@ -608,8 +598,6 @@ def get_status(
608
598
  ] = None,
609
599
  ):
610
600
  """Check the status of folders synced with Overleaf in a project."""
611
- import git
612
-
613
601
  # Read all synced folders, fixing legacy schema if applicable
614
602
  overleaf_info = calkit.overleaf.get_sync_info(fix_legacy=False)
615
603
  if not overleaf_info:
@@ -642,32 +630,18 @@ def get_status(
642
630
  )
643
631
  wdir = path_in_project
644
632
  # Ensure we've cloned the Overleaf project
645
- overleaf_project_dir = os.path.join(
646
- ".calkit", "overleaf", overleaf_project_id
633
+ overleaf_project_dir = calkit.overleaf.get_project_dir(
634
+ overleaf_project_id
647
635
  )
648
- overleaf_remote_url = calkit.overleaf.get_git_remote_url(
649
- project_id=overleaf_project_id, token=str(overleaf_token)
636
+ overleaf_repo = calkit.overleaf.get_repo(
637
+ overleaf_project_id, str(overleaf_token)
650
638
  )
651
- if not os.path.isdir(overleaf_project_dir):
652
- overleaf_repo = git.Repo.clone_from(
653
- overleaf_remote_url, to_path=overleaf_project_dir
654
- )
655
- else:
656
- overleaf_repo = calkit.git.get_repo(overleaf_project_dir)
657
639
  # Pull the latest version in the Overleaf project
658
640
  typer.echo("Pulling the latest version from Overleaf")
659
- # Ensure that our current Overleaf remote URL is correct
660
- overleaf_repo.git.remote("set-url", "origin", overleaf_remote_url)
661
641
  try:
662
642
  overleaf_repo.git.pull()
663
643
  except Exception:
664
- raise_error(
665
- "Failed to pull from Overleaf; "
666
- "check that your Overleaf token is valid\n"
667
- "Run 'calkit config get overleaf_token' and ensure that "
668
- "it matches one in your Overleaf account settings "
669
- "(https://overleaf.com/user/settings)"
670
- )
644
+ raise_error(PULL_FAILED_MESSAGE)
671
645
  last_sync_commit = sync_data.get("last_sync_commit")
672
646
  if last_sync_commit:
673
647
  commits_since = calkit.overleaf.get_commits_since_last_sync(
calkit/overleaf.py CHANGED
@@ -30,6 +30,69 @@ def get_git_remote_url(project_id: str, token: str) -> str:
30
30
  return f"https://git:{token}@git.overleaf.com/{project_id}"
31
31
 
32
32
 
33
+ # Git config options that force authentication to use only the token embedded
34
+ # in the Overleaf remote URL, never a credential saved in the operating
35
+ # system's credential store (macOS Keychain, Windows Credential Manager, etc.).
36
+ # An expired token can linger in that store and shadow a freshly set one, which
37
+ # otherwise makes it impossible to recover a project after a token expires.
38
+ _CREDENTIAL_CLONE_OPTIONS = [
39
+ "-c credential.helper=",
40
+ "-c credential.interactive=false",
41
+ ]
42
+
43
+
44
+ def _disable_credential_store(repo: git.Repo) -> None:
45
+ """Configure a cloned Overleaf repo so git authenticates only with the
46
+ token embedded in its remote URL, ignoring the OS credential store.
47
+
48
+ Setting an empty ``credential.helper`` in the repo's local config resets
49
+ the list of helpers inherited from the system and global config, so no
50
+ stale token can be read from (or written to) the credential store.
51
+ """
52
+ repo.git.config("credential.helper", "")
53
+ repo.git.config("credential.interactive", "false")
54
+
55
+
56
+ def get_project_dir(project_id: str) -> str:
57
+ """Return the local directory into which an Overleaf project is cloned,
58
+ relative to the Calkit project working directory.
59
+ """
60
+ return os.path.join(".calkit", "overleaf", project_id)
61
+
62
+
63
+ def clone(project_id: str, token: str) -> git.Repo:
64
+ """Clone an Overleaf project, authenticating only with ``token``."""
65
+ repo = git.Repo.clone_from(
66
+ get_git_remote_url(project_id=project_id, token=token),
67
+ get_project_dir(project_id),
68
+ multi_options=_CREDENTIAL_CLONE_OPTIONS,
69
+ allow_unsafe_options=True,
70
+ )
71
+ _disable_credential_store(repo)
72
+ return repo
73
+
74
+
75
+ def get_repo(project_id: str, token: str) -> git.Repo:
76
+ """Return the Overleaf repo for ``project_id``, cloning it if it does not
77
+ yet exist.
78
+
79
+ When the repo already exists, its remote URL is refreshed so a freshly set
80
+ token takes effect, and credential handling is reset so a stale token from
81
+ the OS credential store is never used.
82
+ """
83
+ dest = get_project_dir(project_id)
84
+ if not os.path.isdir(dest):
85
+ return clone(project_id, token)
86
+ repo = calkit.git.get_repo(dest)
87
+ repo.git.remote(
88
+ "set-url",
89
+ "origin",
90
+ get_git_remote_url(project_id=project_id, token=token),
91
+ )
92
+ _disable_credential_store(repo)
93
+ return repo
94
+
95
+
33
96
  def project_id_to_url(project_id: str) -> str:
34
97
  return f"https://www.overleaf.com/project/{project_id}"
35
98
 
@@ -8,6 +8,7 @@ import sys
8
8
  from datetime import datetime
9
9
  from pathlib import Path
10
10
  from pprint import pprint
11
+ from unittest.mock import Mock
11
12
 
12
13
  import dvc.repo
13
14
  import git
@@ -22,6 +23,7 @@ from calkit.cli.core import complete_stage_names
22
23
  from calkit.cli.main.core import (
23
24
  _get_running_pipeline_status,
24
25
  _prune_run_logs,
26
+ _run_dvc_repro,
25
27
  _stage_run_info_from_log_content,
26
28
  _stage_target_from_cmd,
27
29
  _to_shell_cmd,
@@ -915,6 +917,83 @@ def test_run(tmp_dir):
915
917
  assert "stage_run_info" in res
916
918
 
917
919
 
920
+ def test_run_dvc_repro_tolerates_teardown_failure(monkeypatch, capsys):
921
+ import dvc.cli
922
+
923
+ # Normal invocation returns DVC's exit code unchanged
924
+ monkeypatch.setattr(dvc.cli, "main", Mock(return_value=7))
925
+ assert _run_dvc_repro(["repro", "my-stage"]) == 7
926
+ # DVC lazily imports ``dvc.daemon`` and ``dvc.repo.open_repo`` for
927
+ # analytics/cleanup only after the command has already run. On a broken
928
+ # install those imports fail (issue #1018), crashing the run once the
929
+ # pipeline has finished, so tolerate them and report ``None`` instead.
930
+ for missing in ["dvc.daemon", "dvc.repo.open_repo"]:
931
+ monkeypatch.setattr(
932
+ dvc.cli,
933
+ "main",
934
+ Mock(
935
+ side_effect=ModuleNotFoundError(
936
+ f"No module named {missing!r}", name=missing
937
+ )
938
+ ),
939
+ )
940
+ assert _run_dvc_repro(["repro"]) is None
941
+ assert "teardown failed" in capsys.readouterr().out
942
+ # A module DVC imports *before* running the command (dvc._debug, dvc.config,
943
+ # dvc.logger) failing means the pipeline never ran at all. Swallowing that
944
+ # would leave an empty log and report success, so it must propagate.
945
+ monkeypatch.setattr(
946
+ dvc.cli,
947
+ "main",
948
+ Mock(
949
+ side_effect=ModuleNotFoundError(
950
+ "No module named 'dvc._debug'", name="dvc._debug"
951
+ )
952
+ ),
953
+ )
954
+ with pytest.raises(ModuleNotFoundError, match="dvc._debug"):
955
+ _run_dvc_repro(["repro"])
956
+ # Non-import errors are unexpected too -- DVC turns real command failures
957
+ # into an exit code -- so they must propagate rather than be masked.
958
+ monkeypatch.setattr(
959
+ dvc.cli, "main", Mock(side_effect=RuntimeError("boom"))
960
+ )
961
+ with pytest.raises(RuntimeError, match="boom"):
962
+ _run_dvc_repro(["repro"])
963
+
964
+
965
+ def test_run_isolated_subproject_stage_exit_code(tmp_dir):
966
+ subprocess.check_call(["calkit", "init"])
967
+ # An isolated subproject is its own Git/DVC repo, so its stage targets run
968
+ # directly inside it rather than through the parent pipeline
969
+ os.makedirs("isolated-sp", exist_ok=True)
970
+ subprocess.check_call(["git", "init"], cwd="isolated-sp")
971
+ subprocess.check_call(["calkit", "init"], cwd="isolated-sp")
972
+ ck_info = calkit.load_calkit_info()
973
+ ck_info["subprojects"] = [{"path": "isolated-sp"}]
974
+ with open("calkit.yaml", "w") as f:
975
+ calkit.ryaml.dump(ck_info, f)
976
+ # A failing subproject stage must exit nonzero; the isolated-target path
977
+ # returns before the parent pipeline runs, and used to skip raising
978
+ with open("isolated-sp/dvc.yaml", "w") as f:
979
+ yaml.dump(
980
+ {
981
+ "stages": {
982
+ "stage-b": {"cmd": 'python -c "import sys; sys.exit(1)"'}
983
+ }
984
+ },
985
+ f,
986
+ )
987
+ result = subprocess.run(["calkit", "run", "isolated-sp:stage-b"])
988
+ assert result.returncode != 0
989
+ # A passing one still exits zero
990
+ with open("isolated-sp/dvc.yaml", "w") as f:
991
+ yaml.dump(
992
+ {"stages": {"stage-b": {"cmd": "python -c \"print('ok')\""}}}, f
993
+ )
994
+ subprocess.check_call(["calkit", "run", "isolated-sp:stage-b"])
995
+
996
+
918
997
  def test_run_ignore_errors(tmp_dir):
919
998
  subprocess.check_call(["calkit", "init"])
920
999
  # Create a pipeline with a failing stage and an independent stage
@@ -409,3 +409,35 @@ def test_overleaf_sync_trailing_slash_or_space(tmp_dir):
409
409
  text=True,
410
410
  )
411
411
  assert res2.returncode == 0, f"Trailing space sync failed: {res2.stderr}"
412
+
413
+
414
+ def test_get_repo_disables_credential_store(tmp_dir):
415
+ # Set up a repo to act as the Overleaf remote (in the test env the remote
416
+ # URL is a local directory)
417
+ pid = str(uuid.uuid4())
418
+ _make_temp_overleaf_project(pid)
419
+ dest = calkit.overleaf.get_project_dir(pid)
420
+ # A fresh clone should reset the credential helper for that repo so only
421
+ # the token in its remote URL is used, never a stale one from the OS
422
+ # credential store
423
+ repo = calkit.overleaf.clone(pid, "sometoken")
424
+ assert os.path.isdir(os.path.join(dest, ".git"))
425
+ assert repo.git.config(["--local", "--get", "credential.helper"]) == ""
426
+ assert (
427
+ repo.git.config(["--local", "--get", "credential.interactive"])
428
+ == "false"
429
+ )
430
+ # Opening an already-cloned project should refresh the remote URL so an
431
+ # updated token takes effect, and keep the credential store disabled
432
+ repo2 = calkit.overleaf.get_repo(pid, "newtoken")
433
+ assert repo2.git.remote(
434
+ ["get-url", "origin"]
435
+ ) == calkit.overleaf.get_git_remote_url(pid, "newtoken")
436
+ assert repo2.git.config(["--local", "--get", "credential.helper"]) == ""
437
+ # A project that has not yet been cloned should be cloned
438
+ pid2 = str(uuid.uuid4())
439
+ _make_temp_overleaf_project(pid2)
440
+ calkit.overleaf.get_repo(pid2, "sometoken")
441
+ assert os.path.isdir(
442
+ os.path.join(calkit.overleaf.get_project_dir(pid2), ".git")
443
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: calkit-python
3
- Version: 0.41.21
3
+ Version: 0.41.23
4
4
  Summary: Reproducibility simplified.
5
5
  Project-URL: Homepage, https://calkit.org
6
6
  Project-URL: Issues, https://github.com/calkit/calkit/issues
@@ -25,7 +25,7 @@ calkit/matlab.py,sha256=wa7tjD5m8Xghwfj9u0oaYbuZ702CScvgk7pItFeTXoU,26061
25
25
  calkit/notebooks.py,sha256=SGrVF_O5WmghMi7axr2WzHb4xLK7f6OmqTDMxQ5V5EY,8845
26
26
  calkit/office.py,sha256=mZqCxkIsmWthBAeJZ5SiGe21fn5zD2zXsy1E6nQIpWE,1291
27
27
  calkit/ops.py,sha256=lLlZAFeplU8uLeMavr99d__Iof-YYwKijus74WfLipk,854
28
- calkit/overleaf.py,sha256=5SI8HwglLVtVlzj7d15Bft_3ZC6AHn3IrAbqMKOAPX0,30170
28
+ calkit/overleaf.py,sha256=zLKv5K0p02vkvfDT7kN-gDSkPICVItV6_FamQYNJfxQ,32528
29
29
  calkit/pipeline.py,sha256=mJsh_DhZGY0byO1pGLgZWNX6xhEx5OmVx5O-n37CLGA,73981
30
30
  calkit/releases.py,sha256=rLvvheYM7eC9qup4Ybnl5DgEuJ0y22Tc2kkKUDxL6RI,19227
31
31
  calkit/server.py,sha256=GQm1bI5Q1NLFNwQL-iP6j4iWKUpKpP3cLEyfj5IMwe4,22009
@@ -43,11 +43,11 @@ calkit/cli/list.py,sha256=jzkZC7dgbmYz8aCBfEWibu_ZRm6i0xwXmIgbUR4NZgA,12040
43
43
  calkit/cli/new.py,sha256=UDFUi3_MvQcI7q5VWFnRRrX7pW6KCoTcssmJtxkfXpw,137435
44
44
  calkit/cli/notebooks.py,sha256=mMNHE8yT0BDN0iJE07GCBFAseyDF0jSRshIm1CQjgrY,24645
45
45
  calkit/cli/office.py,sha256=jVSTvbl91TCzlglST5O2b8hdApZA_QHw_UiEQFJqxdc,1754
46
- calkit/cli/overleaf.py,sha256=xgcONFdyItlUHUfSD_iF-bhjddKO_-ObtHz_Khiz-xE,25384
46
+ calkit/cli/overleaf.py,sha256=nwhsYL61QygYsqI2_h7QuLcoaHorP_WsmUZpsAPpDFk,24417
47
47
  calkit/cli/scheduler.py,sha256=OWJpW57G6Ebs5FTZ_nf2PpEG9QNd6WPe0mb3TmbVTyE,42402
48
48
  calkit/cli/update.py,sha256=5Jjo-5uRTxd5UWHvOETPYFWtJJRr81qmKmsibthkLPk,43501
49
49
  calkit/cli/main/__init__.py,sha256=qu1POZPyqs33ZKfasOxv_Wc-EzVcEgK3Dt_vwFL8Bi8,65
50
- calkit/cli/main/core.py,sha256=1qP6pJB7j8Xsxt51naLhCh3A_PebeZrjVeVTuwC5XLs,125197
50
+ calkit/cli/main/core.py,sha256=OE2HrKSiY9BoxSz14h8_l0pbopvpe-QaljMJbebATcM,127668
51
51
  calkit/cli/main/xr.py,sha256=Bug5qJuiIq0tusmdu30t-ZdyaT_Sy5RwPSTiHvCtIqE,25600
52
52
  calkit/dvc/__init__.py,sha256=-B6tilCb_jw7QFmJ2srILez24wDhNKUzIBhZUMt01dE,381
53
53
  calkit/dvc/core.py,sha256=p42i_uCzgZD6ClGnLOn88zaiGTwrdSG09quL8Hb8Aas,30908
@@ -102,11 +102,11 @@ calkit/tests/cli/test_latex.py,sha256=3pG7o-56Rc9_kPbfkoCJ9DKojfNPTQY8yl5JB3SFh2
102
102
  calkit/tests/cli/test_list.py,sha256=bY74qAHlejgF04EIQgwR5RSdv0Oss3nUkLXcUiSoeFo,5491
103
103
  calkit/tests/cli/test_new.py,sha256=G1CpwlhV7a4oiGYep0DgolaAHOrdxQshxE7fE_EeD8M,53283
104
104
  calkit/tests/cli/test_notebooks.py,sha256=2t1KiGhEz9H9LcIdWy4jGM05REUxJpWiIg6fSpX12ME,10678
105
- calkit/tests/cli/test_overleaf.py,sha256=tgGCuOpic0owtOPD_CtZDnffPkknC_73CSDpOT9S3io,18159
105
+ calkit/tests/cli/test_overleaf.py,sha256=D1fMB68s4zNKNY_OkfDlb2FyOcGIle2UOItePCnlwTo,19578
106
106
  calkit/tests/cli/test_scheduler.py,sha256=mE0KLwcb9gozOnylTLsaL_xYGAptlD9hB8ZiKpPhmcc,17934
107
107
  calkit/tests/cli/test_update.py,sha256=bwRF0kpqbCVxNvGH777LHFX3oUP2DyN3XXUBDCEKNoc,6356
108
108
  calkit/tests/cli/main/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
109
- calkit/tests/cli/main/test_core.py,sha256=1OqdxnCreG-OqBMgOOYQDrBRjoE2eyECYEQW6nQcqxM,69420
109
+ calkit/tests/cli/main/test_core.py,sha256=_AX3xSmovVAL1lXB4NAPICZMl_kkmZKg-mMAzs5B0Ns,72681
110
110
  calkit/tests/cli/main/test_lock.py,sha256=1iX8iSbGtr4O9OkaAi4d3gP3_QzNl6Rr6HLtbEpS6iU,9847
111
111
  calkit/tests/cli/main/test_subprojects.py,sha256=ZR2ZQvZ4XZOi-iW8nlZEYu_2CUyUWoc0MABmnFrF9DQ,12730
112
112
  calkit/tests/cli/main/test_xr.py,sha256=shk8LHS33bZpr_iAW5eA5sMD3nQDKm8fIwXlE6dA2uI,22527
@@ -123,22 +123,22 @@ calkit/tests/models/test_pipeline.py,sha256=9F0g6ij7vc8c2hIRIVTHpT0I-JHXC6i2NRB2
123
123
  calkit/agent_skills/add-pipeline-stage/SKILL.md,sha256=kpYYb-rJsS4B9p1Ub3gL21irCG5ZZ4DvWZpdJeEwPZk,3772
124
124
  calkit/agent_skills/conventions/SKILL.md,sha256=nAM2FjSMk6ED56Dr5zh2bL_dhfzDra-h2ZgzHU7ruS4,9524
125
125
  calkit/agent_skills/create-pipeline/SKILL.md,sha256=2FGw1iDQVRk5FUq79GP3lPdgvgof2Wi1O9O-abGGtgs,5422
126
- calkit_python-0.41.21.data/data/etc/jupyter/jupyter_server_config.d/calkit.json,sha256=CWrZP--JDGz8fsvbAlKr_duTL1vDriGT48SL1YCtkY0,81
127
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/package.json,sha256=39PQEWOzw0qtqD7Kep3OPbUR113vI7CG5TeD84v7clM,6224
128
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/schemas/calkit/package.json.orig,sha256=NBG3t7gFYb6_2J-yPU29qS7Ck9pYgm8-wC5Q1LrzQeI,6082
129
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/schemas/calkit/plugin.json,sha256=YSpIrwpwB-lQBk9Mwv-npedWTOOZreO6nlWZhqlWyGI,840
130
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/502.9a2c5772a15466e923ef.js,sha256=mixXcqFUZukj7_jQVxHTavsYl7cdZv83sEe4phJgkh0,59893
131
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/695.2c41003a452d43d2b358.js,sha256=LEEAOkUtQ9KzWEHn-QFv5yGi70B-sBOnrvztzHr0Shw,223
132
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/867.a42a046aa5108f54f8fb.js,sha256=pCoEaqUQj1T4-zAc9SUd__9ZGm7uL2wHQve2xwL89NI,8156
133
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/909.e3f9cc3408834a7fdcc3.js,sha256=4_nMNAiDSn_cw7UjIHEwone4fizrvqrqSgbwUWvjmoU,114571
134
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js,sha256=n_a0yu_gE7l6fauyoXXv9BZ7ZEYt2387mTfs7CbLcs4,51939
135
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js.LICENSE.txt,sha256=eNJ8gc9n9IF8nW1d9sI9niuHstYzjNz5vqXx9UgWSPc,249
136
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/b2f1c3efe70cb539d121.png,sha256=svHD7-cMtTnRITFwugwsVaB9nZ-h8A61ose8z32HiRE,24850
137
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/remoteEntry.ac9035764d5b2adbb542.js,sha256=rJA1dk1bKtu1QkURrp5HEC2WCxzZppPV1SCYz-35GTc,8737
138
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/style.js,sha256=r89Jlk5v1drcwhCpv9FnC3Jig_JH4k24kZNIvxh6Htk,149
139
- calkit_python-0.41.21.data/data/share/jupyter/labextensions/calkit/static/third-party-licenses.json,sha256=2BGdItLJwO3fAopLl4eJvp26TEwuscYC0-yFaF-LaLU,13683
140
- calkit_python-0.41.21.dist-info/METADATA,sha256=ajpJDiEj8nYKRBjH6gYzBithUWfetdaZTv3Myz7lXJY,12567
141
- calkit_python-0.41.21.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
142
- calkit_python-0.41.21.dist-info/entry_points.txt,sha256=2iQBBzjTAOdk66CwS-f3ecXXW5DjUqkG1KBRj8mHI1I,133
143
- calkit_python-0.41.21.dist-info/licenses/LICENSE,sha256=9ZamCaSUTZk9rcrnf-sWFKLOHr3ws-S_dgKMegW4nw8,1056
144
- calkit_python-0.41.21.dist-info/RECORD,,
126
+ calkit_python-0.41.23.data/data/etc/jupyter/jupyter_server_config.d/calkit.json,sha256=CWrZP--JDGz8fsvbAlKr_duTL1vDriGT48SL1YCtkY0,81
127
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/package.json,sha256=39PQEWOzw0qtqD7Kep3OPbUR113vI7CG5TeD84v7clM,6224
128
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/schemas/calkit/package.json.orig,sha256=NBG3t7gFYb6_2J-yPU29qS7Ck9pYgm8-wC5Q1LrzQeI,6082
129
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/schemas/calkit/plugin.json,sha256=YSpIrwpwB-lQBk9Mwv-npedWTOOZreO6nlWZhqlWyGI,840
130
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/502.9a2c5772a15466e923ef.js,sha256=mixXcqFUZukj7_jQVxHTavsYl7cdZv83sEe4phJgkh0,59893
131
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/695.2c41003a452d43d2b358.js,sha256=LEEAOkUtQ9KzWEHn-QFv5yGi70B-sBOnrvztzHr0Shw,223
132
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/867.a42a046aa5108f54f8fb.js,sha256=pCoEaqUQj1T4-zAc9SUd__9ZGm7uL2wHQve2xwL89NI,8156
133
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/909.e3f9cc3408834a7fdcc3.js,sha256=4_nMNAiDSn_cw7UjIHEwone4fizrvqrqSgbwUWvjmoU,114571
134
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js,sha256=n_a0yu_gE7l6fauyoXXv9BZ7ZEYt2387mTfs7CbLcs4,51939
135
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/946.050af2abf7845cfbdbd2.js.LICENSE.txt,sha256=eNJ8gc9n9IF8nW1d9sI9niuHstYzjNz5vqXx9UgWSPc,249
136
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/b2f1c3efe70cb539d121.png,sha256=svHD7-cMtTnRITFwugwsVaB9nZ-h8A61ose8z32HiRE,24850
137
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/remoteEntry.ac9035764d5b2adbb542.js,sha256=rJA1dk1bKtu1QkURrp5HEC2WCxzZppPV1SCYz-35GTc,8737
138
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/style.js,sha256=r89Jlk5v1drcwhCpv9FnC3Jig_JH4k24kZNIvxh6Htk,149
139
+ calkit_python-0.41.23.data/data/share/jupyter/labextensions/calkit/static/third-party-licenses.json,sha256=2BGdItLJwO3fAopLl4eJvp26TEwuscYC0-yFaF-LaLU,13683
140
+ calkit_python-0.41.23.dist-info/METADATA,sha256=u_nh_83ShEO3v5rEPj2BWUmxJZD45gxMaETjF61XGW4,12567
141
+ calkit_python-0.41.23.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
142
+ calkit_python-0.41.23.dist-info/entry_points.txt,sha256=2iQBBzjTAOdk66CwS-f3ecXXW5DjUqkG1KBRj8mHI1I,133
143
+ calkit_python-0.41.23.dist-info/licenses/LICENSE,sha256=9ZamCaSUTZk9rcrnf-sWFKLOHr3ws-S_dgKMegW4nw8,1056
144
+ calkit_python-0.41.23.dist-info/RECORD,,