github-rest-api 0.9.0__tar.gz → 0.10.1__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.9.0
3
+ Version: 0.10.1
4
4
  Summary: Simple wrapper of GitHub REST APIs.
5
5
  Author: Ben Du
6
6
  Author-email: longendu@yahoo.com
@@ -38,7 +38,7 @@ def _copy_bench_results(bench_dir: Path, storage: str) -> None:
38
38
  """Copy benchmark results into the right directory.
39
39
  :param bench_dir: The root benchmark directory
40
40
  (under the gh-pages branch).
41
- :param pr_merge_name: The corresponding PR merge name.
41
+ :param storage: The directory relative to bench_dir for storing this benchmark results.
42
42
  """
43
43
  switch_branch("gh-pages", fetch=True)
44
44
  src = Path("target/criterion")
@@ -159,11 +159,13 @@ def _sort_cips(
159
159
 
160
160
 
161
161
  def _clean_bench_dirs(bench_dir: Path, history: int) -> list[Path]:
162
- dirs = sorted(p / "merge" for p in bench_dir.glob("[1-9]*/"))
162
+ dirs = sorted(bench_dir.glob("[1-9]*/"))
163
163
  for path in dirs[:-history]:
164
164
  shutil.rmtree(path)
165
165
  dirs = dirs[-history:]
166
- dirs.append(Path("dev"))
166
+ dev = bench_dir / "dev"
167
+ if dev.is_dir():
168
+ dirs.append(dev)
167
169
  return dirs
168
170
 
169
171
 
@@ -177,7 +179,7 @@ def benchmark(
177
179
  repo: str,
178
180
  local_repo_dir: str,
179
181
  bench_dir: str | Path,
180
- pr_merge_name: str,
182
+ pr_number: str,
181
183
  storage: str = "",
182
184
  history: int = 20,
183
185
  ):
@@ -187,15 +189,15 @@ def benchmark(
187
189
  :param repo: The name of the repository.
188
190
  :param local_repo_dir: Root directory of the local repository.
189
191
  :param bench_dir: The root benchmark directory (under the gh-pages branch).
190
- :param pr_merge_name: The corresponding PR merge name.
192
+ :param pr_number: The number of the corresponding PR.
191
193
  :param storage: The directory relative to bench_dir for storing this benchmark results.
192
- If not specified (empty or None), pr_merge_name is used.
194
+ If not specified (empty or None), pr_number is used.
193
195
  :param history: The number of historical benchmark results to keep.
194
196
  """
195
197
  if isinstance(bench_dir, str):
196
198
  bench_dir = Path(bench_dir)
197
199
  if not storage:
198
- storage = pr_merge_name
200
+ storage = pr_number
199
201
  config_git(
200
202
  local_repo_dir=local_repo_dir,
201
203
  user_email=f"bench-bot@{repo}.com",
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "github_rest_api"
3
- version = "0.9.0"
3
+ version = "0.10.1"
4
4
  description = "Simple wrapper of GitHub REST APIs."
5
5
  authors = ["Ben Du <longendu@yahoo.com>"]
6
6
  readme = "README.md"