github-rest-api 0.46.0__tar.gz → 0.47.0__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.
Files changed (49) hide show
  1. github_rest_api-0.47.0/.github/workflows/claude-code-review.yml +44 -0
  2. github_rest_api-0.47.0/.github/workflows/claude.yml +50 -0
  3. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/PKG-INFO +1 -1
  4. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/create_github_repo.py +21 -13
  5. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/pyproject.toml +1 -1
  6. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/uv.lock +1 -1
  7. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.devcontainer/devcontainer.json +0 -0
  8. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.github/workflows/create_pr_to_main.yaml +0 -0
  9. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.github/workflows/lint.yaml +0 -0
  10. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.github/workflows/release.yaml +0 -0
  11. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.github/workflows/remove_branch.yaml +0 -0
  12. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.github/workflows/test.yaml +0 -0
  13. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/.gitignore +0 -0
  14. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/GEMINI.md +0 -0
  15. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/README.md +0 -0
  16. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/__init__.py +0 -0
  17. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/github.py +0 -0
  18. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/pr_content.py +0 -0
  19. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/__init__.py +0 -0
  20. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/cargo/__init__.py +0 -0
  21. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/cargo/benchmark.py +0 -0
  22. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/cargo/profiling.py +0 -0
  23. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/cargo/utils.py +0 -0
  24. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/container/__init__.py +0 -0
  25. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/container/build_container_images.py +0 -0
  26. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/container/config_container.py +0 -0
  27. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
  28. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/__init__.py +0 -0
  29. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/auto_merge_pull_request.py +0 -0
  30. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/create_pull_request.py +0 -0
  31. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/release_on_github.py +0 -0
  32. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/remove_branch.py +0 -0
  33. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -0
  34. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -0
  35. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -0
  36. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -0
  37. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/python/test.yaml +0 -0
  38. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -0
  39. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/scripts/utils.py +0 -0
  40. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/github_rest_api/utils.py +0 -0
  41. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/memory/MEMORY.md +0 -0
  42. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/memory/feedback_test_runner.md +0 -0
  43. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/__init__.py +0 -0
  44. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_build_container_images.py +0 -0
  45. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_create_pull_request.py +0 -0
  46. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_github.py +0 -0
  47. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_pr_content.py +0 -0
  48. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_release_on_github.py +0 -0
  49. {github_rest_api-0.46.0 → github_rest_api-0.47.0}/tests/test_utils.py +0 -0
@@ -0,0 +1,44 @@
1
+ name: Claude Code Review
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, ready_for_review, reopened]
6
+ # Optional: Only run on specific file changes
7
+ # paths:
8
+ # - "src/**/*.ts"
9
+ # - "src/**/*.tsx"
10
+ # - "src/**/*.js"
11
+ # - "src/**/*.jsx"
12
+
13
+ jobs:
14
+ claude-review:
15
+ # Optional: Filter by PR author
16
+ # if: |
17
+ # github.event.pull_request.user.login == 'external-contributor' ||
18
+ # github.event.pull_request.user.login == 'new-developer' ||
19
+ # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20
+
21
+ runs-on: ubuntu-latest
22
+ permissions:
23
+ contents: read
24
+ pull-requests: read
25
+ issues: read
26
+ id-token: write
27
+
28
+ steps:
29
+ - name: Checkout repository
30
+ uses: actions/checkout@v4
31
+ with:
32
+ fetch-depth: 1
33
+
34
+ - name: Run Claude Code Review
35
+ id: claude-review
36
+ uses: anthropics/claude-code-action@v1
37
+ with:
38
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39
+ plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
40
+ plugins: 'code-review@claude-code-plugins'
41
+ prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
42
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
43
+ # or https://code.claude.com/docs/en/cli-reference for available options
44
+
@@ -0,0 +1,50 @@
1
+ name: Claude Code
2
+
3
+ on:
4
+ issue_comment:
5
+ types: [created]
6
+ pull_request_review_comment:
7
+ types: [created]
8
+ issues:
9
+ types: [opened, assigned]
10
+ pull_request_review:
11
+ types: [submitted]
12
+
13
+ jobs:
14
+ claude:
15
+ if: |
16
+ (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17
+ (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18
+ (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19
+ (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20
+ runs-on: ubuntu-latest
21
+ permissions:
22
+ contents: read
23
+ pull-requests: read
24
+ issues: read
25
+ id-token: write
26
+ actions: read # Required for Claude to read CI results on PRs
27
+ steps:
28
+ - name: Checkout repository
29
+ uses: actions/checkout@v4
30
+ with:
31
+ fetch-depth: 1
32
+
33
+ - name: Run Claude Code
34
+ id: claude
35
+ uses: anthropics/claude-code-action@v1
36
+ with:
37
+ claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38
+
39
+ # This is an optional setting that allows Claude to read CI results on PRs
40
+ additional_permissions: |
41
+ actions: read
42
+
43
+ # Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
44
+ # prompt: 'Update the pull request description to include a summary of changes.'
45
+
46
+ # Optional: Add claude_args to customize behavior and configuration
47
+ # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
48
+ # or https://code.claude.com/docs/en/cli-reference for available options
49
+ # claude_args: '--allowed-tools Bash(gh pr *)'
50
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: github-rest-api
3
- Version: 0.46.0
3
+ Version: 0.47.0
4
4
  Summary: Simple wrapper of GitHub REST APIs.
5
5
  Author-email: Ben Du <longendu@yahoo.com>
6
6
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -38,6 +38,13 @@ def _remote_url(repo: str, protocol: str) -> str:
38
38
  return f"https://github.com/{repo}.git"
39
39
 
40
40
 
41
+ def _ensure_remote(path: Path, repo: str, protocol: str) -> None:
42
+ try:
43
+ porcelain.remote_add(path, "origin", _remote_url(repo, protocol))
44
+ except porcelain.RemoteExists:
45
+ pass
46
+
47
+
41
48
  def _init_local_repo(
42
49
  repo: str,
43
50
  language: str,
@@ -54,29 +61,30 @@ def _init_local_repo(
54
61
  readme.write_text(f"# {repo_name}\n")
55
62
  if not (path / ".git").exists():
56
63
  porcelain.init(path=path)
57
- porcelain.remote_add(path, "origin", _remote_url(repo, protocol))
58
64
  initial_branch = (
59
65
  (path / ".git" / "HEAD").read_text().strip().partition("refs/heads/")[-1]
60
66
  )
61
67
  porcelain.add(repo=path)
62
68
  porcelain.commit(repo=path, message="first commit")
63
-
64
- def _create_push_branch(branch: str):
69
+ for branch in branches:
65
70
  if branch != initial_branch:
66
71
  porcelain.branch_create(repo=path, name=branch)
67
- porcelain.checkout(repo=path, target=branch)
68
- porcelain.push(
69
- repo=path,
70
- remote_location=_remote_url(repo, "https"),
71
- username="x-access-token",
72
- password=token,
73
- )
74
-
75
- for branch in branches:
76
- _create_push_branch(branch)
77
72
  porcelain.checkout(repo=path, target=branches[0])
78
73
  if initial_branch not in branches:
79
74
  porcelain.branch_delete(repo=path, name=initial_branch)
75
+ _ensure_remote(path, repo, protocol)
76
+ local_branches = {b.decode() for b in porcelain.branch_list(path)}
77
+ branches_to_push = [branch for branch in branches if branch in local_branches]
78
+ if not branches_to_push:
79
+ branches_to_push = [porcelain.active_branch(path).decode()]
80
+ for branch in branches_to_push:
81
+ porcelain.push(
82
+ repo=path,
83
+ remote_location=_remote_url(repo, "https"),
84
+ refspecs=[branch.encode()],
85
+ username="x-access-token",
86
+ password=token,
87
+ )
80
88
  _add_workflow(path, language)
81
89
 
82
90
 
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
4
4
 
5
5
  [project]
6
6
  name = "github-rest-api"
7
- version = "0.46.0"
7
+ version = "0.47.0"
8
8
  description = "Simple wrapper of GitHub REST APIs."
9
9
  readme = "README.md"
10
10
  authors = [ { name = "Ben Du", email = "longendu@yahoo.com" } ]
@@ -542,7 +542,7 @@ wheels = [
542
542
 
543
543
  [[package]]
544
544
  name = "github-rest-api"
545
- version = "0.46.0"
545
+ version = "0.47.0"
546
546
  source = { editable = "." }
547
547
  dependencies = [
548
548
  { name = "dulwich" },