Skip to content

Commit 6b2ae2e

Browse files
committed
minor cleanup to make numpy benchmarks behave more consistently
1 parent ca1a0b1 commit 6b2ae2e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

mx.graalpython/mx_graalpython_python_benchmarks.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
285285

286286
if not hasattr(self, "prepared"):
287287
self.prepared = True
288-
vm.run(workdir, ["-m", "venv", vm_venv])
288+
vm.run(workdir, ["-m", "venv", join(workdir, vm_venv)])
289289
mx.run(
290290
[
291291
join(vm_venv, "bin", "pip"),
@@ -368,7 +368,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
368368
with open(join(workdir, "benchmarks", "nullpython.py"), "w") as f:
369369
f.write(content)
370370

371-
vm.run(workdir, ["-m", "venv", vm_venv])
371+
vm.run(workdir, ["-m", "venv", join(workdir, vm_venv)])
372372

373373
json_file = f"{vm_venv}.json"
374374
if benchmarks:
@@ -428,11 +428,6 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
428428
npdir = join(workdir, "numpy")
429429
if artifact := os.environ.get("NUMPY_BENCHMARKS_DIR"):
430430
shutil.copytree(artifact, npdir)
431-
mx.run(["git", "init", "."], cwd=npdir, nonZeroIsFatal=False)
432-
mx.run(["git", "config", "user.email", "[email protected]"])
433-
mx.run(["git", "config", "user.name", "YourName"])
434-
mx.run(["git", "commit", "--allow-empty", "-m", "init"], cwd=npdir, nonZeroIsFatal=False)
435-
mx.run(["git", "branch", self.VERSION], cwd=npdir, nonZeroIsFatal=False)
436431
else:
437432
mx.warn("NUMPY_BENCHMARKS_DIR is not set, cloning numpy repository")
438433
mx.run(
@@ -448,10 +443,16 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
448443
],
449444
cwd=workdir,
450445
)
446+
shutil.rmtree(join(npdir, ".git"))
447+
mx.run(["git", "init", "."], cwd=npdir)
448+
mx.run(["git", "config", "user.email", "[email protected]"], cwd=npdir)
449+
mx.run(["git", "config", "user.name", "YourName"], cwd=npdir)
450+
mx.run(["git", "commit", "--allow-empty", "-m", "init"], cwd=npdir)
451+
mx.run(["git", "branch", self.VERSION], cwd=npdir)
451452
mx.run(["git", "branch", "main"], cwd=npdir, nonZeroIsFatal=False)
452453
mx.run(["git", "branch", "master"], cwd=npdir, nonZeroIsFatal=False)
453454

454-
vm.run(workdir, ["-m", "venv", vm_venv])
455+
vm.run(workdir, ["-m", "venv", join(workdir, vm_venv)])
455456
mx.run(
456457
[
457458
join(workdir, vm_venv, "bin", "pip"),

0 commit comments

Comments
 (0)