|
15 | 15 | # set in home |
16 | 16 | local_testing_data_folder = Path.home() / "ephy_testing_data" |
17 | 17 |
|
| 18 | +# local copies already updated in this process, so each one asks its remote at most once |
| 19 | +_updated_folders = set() |
| 20 | + |
18 | 21 |
|
19 | 22 | def get_local_testing_data_folder(): |
20 | 23 | global local_testing_data_folder |
@@ -65,10 +68,12 @@ def download_dataset(repo=default_testing_repo, remote_path=None, local_folder=N |
65 | 68 | # make sure git repo is in clean state |
66 | 69 | repo = dataset.repo |
67 | 70 | repo.call_git(["checkout", "--force", "master"]) |
68 | | - # the remote can be unreachable (gin answers 403 to CI runners at times), so keep the local copy then |
69 | | - results = dataset.update(merge=True, on_failure="ignore") |
70 | | - if any(result["status"] == "error" for result in results): |
71 | | - warnings.warn(f"Could not update {local_folder} from its remote, using the local copy as it is") |
| 71 | + if local_folder not in _updated_folders: |
| 72 | + _updated_folders.add(local_folder) |
| 73 | + # the remote can be unreachable (gin answers 403 to CI runners at times), so keep the local copy then |
| 74 | + results = dataset.update(merge=True, on_failure="ignore") |
| 75 | + if any(result["status"] in ("impossible", "error") for result in results): |
| 76 | + warnings.warn(f"Could not update {local_folder} from its remote, using the local copy as it is") |
72 | 77 | else: |
73 | 78 | dataset = datalad.api.install(path=local_folder, source=repo) |
74 | 79 |
|
|
0 commit comments