Skip to content

Commit

Permalink
Revert extra formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
swernli committed Dec 3, 2024
1 parent ecf6088 commit 9a1ef7b
Showing 1 changed file with 10 additions and 31 deletions.
41 changes: 10 additions & 31 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@
)

parser.add_argument(
"--ci-bench",
action=argparse.BooleanOptionalAction,
default=False,
help="Run the benchmarking script that is run in CI (default is --no-ci-bench)",
"--ci-bench",
action=argparse.BooleanOptionalAction,
default=False,
help="Run the benchmarking script that is run in CI (default is --no-ci-bench)",
)

args = parser.parse_args()
Expand Down Expand Up @@ -303,46 +303,25 @@ def run_python_integration_tests(cwd, interpreter):
def run_ci_historic_benchmark():
branch = "main"
output = subprocess.check_output(
[
"git",
"rev-list",
"--since=1 week ago",
"--pretty=format:%ad__%h",
"--date=short",
branch,
]
["git", "rev-list", "--since=1 week ago", "--pretty=format:%ad__%h", "--date=short", branch]
).decode("utf-8")
print("\n".join([line for i, line in enumerate(output.split("\n")) if i % 2 == 1]))
print('\n'.join([line for i, line in enumerate(output.split('\n')) if i % 2 == 1]))

output = subprocess.check_output(
[
"git",
"rev-list",
"--since=1 week ago",
"--pretty=format:%ad__%h",
"--date=short",
branch,
]
["git", "rev-list", "--since=1 week ago", "--pretty=format:%ad__%h", "--date=short", branch]
).decode("utf-8")
date_and_commits = [line for i, line in enumerate(output.split("\n")) if i % 2 == 1]
date_and_commits = [line for i, line in enumerate(output.split('\n')) if i % 2 == 1]

for date_and_commit in date_and_commits:
print("benching commit", date_and_commit)
result = subprocess.run(
[
"cargo",
"criterion",
"--message-format=json",
"--history-id",
date_and_commit,
],
["cargo", "criterion", "--message-format=json", "--history-id", date_and_commit],
capture_output=True,
text=True,
text=True
)
with open(f"{date_and_commit}.json", "w") as f:
f.write(result.stdout)


if build_pip:
step_start("Building the pip package")

Expand Down

0 comments on commit 9a1ef7b

Please sign in to comment.