github-rest-api 0.10.1__tar.gz → 0.10.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: github-rest-api
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: Simple wrapper of GitHub REST APIs.
5
5
  Author: Ben Du
6
6
  Author-email: longendu@yahoo.com
@@ -12,11 +12,11 @@ def _gen_temp_branch() -> str:
12
12
  return "_branch_" + "".join(str(num) for num in nums)
13
13
 
14
14
 
15
- def _copy_last_dev_bench() -> None:
15
+ def _copy_last_dev_bench(bench_dir: Path) -> None:
16
16
  branch = _gen_temp_branch()
17
17
  create_branch(branch)
18
18
  switch_branch(branch="gh-pages", fetch=True)
19
- src = Path("dev/criterion")
19
+ src = bench_dir / "dev/criterion"
20
20
  if src.is_dir():
21
21
  target = Path("target/criterion")
22
22
  target.mkdir(parents=True, exist_ok=True)
@@ -24,12 +24,12 @@ def _copy_last_dev_bench() -> None:
24
24
  switch_branch(branch=branch, fetch=False)
25
25
 
26
26
 
27
- def _cargo_criterion() -> None:
27
+ def _cargo_criterion(bench_dir: Path) -> None:
28
28
  """Run `cargo criterion` to benchmark the specified branch.
29
29
 
30
30
  :param branch: The branch to benchmark.
31
31
  """
32
- _copy_last_dev_bench()
32
+ _copy_last_dev_bench(bench_dir=bench_dir)
33
33
  cmd = "cargo criterion --message-format=json"
34
34
  sp.run(cmd, shell=True, check=True)
35
35
 
@@ -203,7 +203,7 @@ def benchmark(
203
203
  user_email=f"bench-bot@{repo}.com",
204
204
  user_name="bench-bot",
205
205
  )
206
- _cargo_criterion()
206
+ _cargo_criterion(bench_dir=bench_dir)
207
207
  _copy_bench_results(bench_dir=bench_dir, storage=storage)
208
208
  dirs = _clean_bench_dirs(bench_dir=bench_dir, history=history)
209
209
  _rename_bench_reports(dirs)
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "github_rest_api"
3
- version = "0.10.1"
3
+ version = "0.10.2"
4
4
  description = "Simple wrapper of GitHub REST APIs."
5
5
  authors = ["Ben Du <longendu@yahoo.com>"]
6
6
  readme = "README.md"