summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/wandb/hardcode-git-path.patch
blob: bb9a5fb6cafc08f083b47a4a498466451e498b75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/landfill/functional_tests/kfp/wandb_probe.py b/landfill/functional_tests/kfp/wandb_probe.py
index 86b18a438..23e237e3b 100644
--- a/landfill/functional_tests/kfp/wandb_probe.py
+++ b/landfill/functional_tests/kfp/wandb_probe.py
@@ -5,7 +5,7 @@ import subprocess
 def wandb_probe_package():
     if not os.environ.get("WB_PROBE_PACKAGE"):
         return
-    s, o = subprocess.getstatusoutput("git rev-parse HEAD")
+    s, o = subprocess.getstatusoutput("@git@ rev-parse HEAD")
     if s:
         return
     wandb_local = f"git+https://github.com/wandb/wandb.git@{o}#egg=wandb"
diff --git a/wandb/cli/cli.py b/wandb/cli/cli.py
index 1453100cc..9dc468201 100644
--- a/wandb/cli/cli.py
+++ b/wandb/cli/cli.py
@@ -2531,7 +2531,7 @@ def restore(ctx, run, no_git, branch, project, entity):
     commit, json_config, patch_content, metadata = api.run_config(
         project, run=run, entity=entity
     )
-    repo = metadata.get("git", {}).get("repo")
+    repo = metadata.get("@git@", {}).get("repo")
     image = metadata.get("docker")
     restore_message = """`wandb restore` needs to be run from the same git repository as the original run.
 Run `git clone {}` and restore from there or pass the --no-git flag.""".format(repo)
@@ -2547,7 +2547,7 @@ Run `git clone {}` and restore from there or pass the --no-git flag.""".format(r
 
     if commit and api.git.enabled:
         wandb.termlog(f"Fetching origin and finding commit: {commit}")
-        subprocess.check_call(["git", "fetch", "--all"])
+        subprocess.check_call(["@git@", "fetch", "--all"])
         try:
             api.git.repo.commit(commit)
         except ValueError:
@@ -2604,7 +2604,7 @@ Run `git clone {}` and restore from there or pass the --no-git flag.""".format(r
             # --reject is necessary or else this fails any time a binary file
             # occurs in the diff
             exit_code = subprocess.call(
-                ["git", "apply", "--reject", patch_rel_path], cwd=root
+                ["@git@", "apply", "--reject", patch_rel_path], cwd=root
             )
             if exit_code == 0:
                 wandb.termlog("Applied patch")
diff --git a/wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py b/wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py
index 47d439145..16118feb0 100644
--- a/wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py
+++ b/wandb/vendor/promise-2.3.0/wandb_promise/pyutils/version.py
@@ -69,7 +69,7 @@ def get_git_changeset():
     repo_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
     try:
         git_log = subprocess.Popen(
-            "git log --pretty=format:%ct --quiet -1 HEAD",
+            "@git@ log --pretty=format:%ct --quiet -1 HEAD",
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
             shell=True,