github-rest-api 0.48.0__tar.gz → 0.51.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.
Files changed (69) hide show
  1. github_rest_api-0.51.1/.github/workflows/auto_merge_pull_request.yaml +64 -0
  2. github_rest_api-0.51.1/.github/workflows/check_workflow_template.yaml +20 -0
  3. github_rest_api-0.51.1/.github/workflows/claude.yaml +27 -0
  4. github_rest_api-0.51.1/.github/workflows/create_pr_dev_to_main.yaml +9 -0
  5. github_rest_api-0.51.1/.github/workflows/create_pr_to_dev.yaml +11 -0
  6. github_rest_api-0.51.1/.github/workflows/create_pr_to_main.yaml +10 -0
  7. github_rest_api-0.51.1/.github/workflows/pr-workflow.yaml +34 -0
  8. github_rest_api-0.51.1/.github/workflows/release.yaml +12 -0
  9. github_rest_api-0.51.1/.github/workflows/remove_branch.yaml +9 -0
  10. github_rest_api-0.48.0/GEMINI.md → github_rest_api-0.51.1/AGENTS.md +1 -1
  11. github_rest_api-0.51.1/CLAUDE.md +1 -0
  12. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/PKG-INFO +3 -3
  13. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/__init__.py +8 -0
  14. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/github.py +561 -27
  15. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/container/build_container_images.py +6 -0
  16. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/github/auto_merge_pull_request.py +3 -2
  17. github_rest_api-0.51.1/github_rest_api/scripts/github/create_github_repo.py +392 -0
  18. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/github/create_pull_request.py +10 -1
  19. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/github/release_on_github.py +16 -12
  20. github_rest_api-0.51.1/github_rest_api/scripts/github/upload_image_to_issue.py +533 -0
  21. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/utils.py +80 -1
  22. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/utils.py +19 -0
  23. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/pyproject.toml +9 -3
  24. github_rest_api-0.51.1/tests/test_auto_merge_pull_request.py +16 -0
  25. github_rest_api-0.51.1/tests/test_create_github_repo.py +326 -0
  26. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/tests/test_create_pull_request.py +12 -0
  27. github_rest_api-0.51.1/tests/test_github.py +1426 -0
  28. github_rest_api-0.51.1/tests/test_release_on_github.py +121 -0
  29. github_rest_api-0.51.1/tests/test_upload_image_to_issue.py +701 -0
  30. github_rest_api-0.51.1/tests/test_utils.py +90 -0
  31. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/uv.lock +2 -2
  32. github_rest_api-0.48.0/.github/workflows/auto_merge_pull_request.yaml +0 -31
  33. github_rest_api-0.48.0/.github/workflows/claude-code-review.yml +0 -61
  34. github_rest_api-0.48.0/.github/workflows/claude.yml +0 -50
  35. github_rest_api-0.48.0/.github/workflows/create_pr_to_main.yaml +0 -20
  36. github_rest_api-0.48.0/.github/workflows/lint.yaml +0 -34
  37. github_rest_api-0.48.0/.github/workflows/release.yaml +0 -22
  38. github_rest_api-0.48.0/.github/workflows/remove_branch.yaml +0 -18
  39. github_rest_api-0.48.0/.github/workflows/test.yaml +0 -27
  40. github_rest_api-0.48.0/github_rest_api/scripts/github/create_github_repo.py +0 -285
  41. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/auto_merge_pull_request.yaml +0 -30
  42. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -19
  43. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -21
  44. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -20
  45. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -27
  46. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/python/test.yaml +0 -31
  47. github_rest_api-0.48.0/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -18
  48. github_rest_api-0.48.0/tests/test_github.py +0 -746
  49. github_rest_api-0.48.0/tests/test_release_on_github.py +0 -64
  50. github_rest_api-0.48.0/tests/test_utils.py +0 -34
  51. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/.devcontainer/devcontainer.json +0 -0
  52. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/.gitignore +0 -0
  53. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/README.md +0 -0
  54. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/pr_content.py +0 -0
  55. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/__init__.py +0 -0
  56. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/cargo/__init__.py +0 -0
  57. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/cargo/benchmark.py +0 -0
  58. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/cargo/profiling.py +0 -0
  59. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/cargo/utils.py +0 -0
  60. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/container/__init__.py +0 -0
  61. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/container/config_container.py +0 -0
  62. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
  63. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/github/__init__.py +0 -0
  64. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/github_rest_api/scripts/github/remove_branch.py +0 -0
  65. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/memory/MEMORY.md +0 -0
  66. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/memory/feedback_test_runner.md +0 -0
  67. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/tests/__init__.py +0 -0
  68. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/tests/test_build_container_images.py +0 -0
  69. {github_rest_api-0.48.0 → github_rest_api-0.51.1}/tests/test_pr_content.py +0 -0
@@ -0,0 +1,64 @@
1
+ name: Auto Merge PR
2
+ on:
3
+ # The Claude review runs with `track_progress`, which creates its tracking
4
+ # comment when the review *starts* and then edits that same comment as the
5
+ # review progresses. The AUTO_MERGE_APPROVED marker therefore lands via an
6
+ # edit, so `issue_comment: created` fires far too early (the head commit is
7
+ # still seconds old and the marker is not written yet). Waiting for the review
8
+ # workflow to complete is what reliably lands after the marker exists and
9
+ # after the head-commit age gate has been cleared. The other PR checks
10
+ # are listed too because the merge gate additionally needs `mergeable_state
11
+ # == clean`, i.e. every check green -- whichever check finishes last is the
12
+ # one that makes the PR mergeable, and that is not always the review.
13
+ # Renaming any of these silently disables the trigger.
14
+ workflow_run:
15
+ workflows:
16
+ - PR Workflow
17
+ types:
18
+ - completed
19
+ # Kept for approvals that come from a human rather than from Claude.
20
+ #
21
+ # `issue_comment: created` is deliberately absent: the only comment created on
22
+ # a PR here is the review's tracking comment, created seconds after the push,
23
+ # when the head commit is still under the age gate and the marker has not been
24
+ # written. It fired on every PR and could never merge anything. A marker typed
25
+ # by hand is picked up by the cron, or immediately via `workflow_dispatch`.
26
+ pull_request_review:
27
+ types:
28
+ - submitted
29
+ # Backstop for anything the event triggers miss.
30
+ schedule:
31
+ - cron: '0 * * * *'
32
+ timezone: 'America/Los_Angeles'
33
+ # Manual escape hatch. Run with `dry_run` to have the tool log its per-PR
34
+ # `Skipping auto-merge of PR #N: <reason>` verdicts without merging anything,
35
+ # which is the fastest way to diagnose why a PR is not being picked up.
36
+ workflow_dispatch:
37
+ inputs:
38
+ dry_run:
39
+ description: Log eligible PRs without merging them
40
+ type: boolean
41
+ default: false
42
+ permissions:
43
+ contents: write
44
+ pull-requests: write
45
+ concurrency:
46
+ # Every run rescans all open PRs, so overlapping runs are pure duplicate work
47
+ # and the newest run always sees the freshest state. Do not cancel in
48
+ # progress: a run cancelled midway through the merge API call is worse than a
49
+ # redundant one.
50
+ group: auto-merge-pull-request
51
+ cancel-in-progress: false
52
+ jobs:
53
+ auto_merge_pull_request:
54
+ # A triggering workflow that failed, was cancelled or was skipped left the
55
+ # PR unmergeable or wrote no marker, so there is nothing new to act on.
56
+ # This job checks out no PR code, so the elevated `workflow_run` context is
57
+ # never exposed to PR-controlled input.
58
+ if: |
59
+ github.event_name != 'workflow_run'
60
+ || github.event.workflow_run.conclusion == 'success'
61
+ uses: legendu-net/.github/.github/workflows/auto_merge_pull_request.yaml@main
62
+ with:
63
+ dry_run: ${{ inputs.dry_run || false }}
64
+ secrets: inherit
@@ -0,0 +1,20 @@
1
+ name: Check Workflow Templates
2
+
3
+ on:
4
+ pull_request:
5
+ paths:
6
+ - .github/workflows/**
7
+
8
+ jobs:
9
+ check_workflow_template:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v6
13
+ - name: Check workflow templates use .yaml extension
14
+ run: |
15
+ yml_files=$(find .github/workflows/ -name '*.yml')
16
+ if [ -n "$yml_files" ]; then
17
+ echo "The following workflow templates must use the .yaml extension instead of .yml:"
18
+ echo "$yml_files"
19
+ exit 1
20
+ fi
@@ -0,0 +1,27 @@
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
+ permissions:
21
+ actions: read
22
+ contents: read
23
+ issues: read
24
+ pull-requests: read
25
+ id-token: write
26
+ uses: legendu-net/.github/.github/workflows/claude.yml@main
27
+ secrets: inherit
@@ -0,0 +1,9 @@
1
+ name: Create PR From dev To main
2
+ on:
3
+ push:
4
+ branches:
5
+ - dev
6
+ jobs:
7
+ create_pr_dev_to_main:
8
+ uses: legendu-net/.github/.github/workflows/create_pr_dev_to_main.yaml@main
9
+ secrets: inherit
@@ -0,0 +1,11 @@
1
+ name: Create PR to dev
2
+ on:
3
+ push:
4
+ branches-ignore:
5
+ - main
6
+ - dev
7
+ - gh-pages*
8
+ jobs:
9
+ create_pr_to_dev:
10
+ uses: legendu-net/.github/.github/workflows/create_pr_to_dev.yaml@main
11
+ secrets: inherit
@@ -0,0 +1,10 @@
1
+ name: Create PR To main
2
+ on:
3
+ push:
4
+ branches-ignore:
5
+ - main
6
+ - _**
7
+ jobs:
8
+ create_pr_main:
9
+ uses: legendu-net/.github/.github/workflows/create_pr_to_main.yaml@main
10
+ secrets: inherit
@@ -0,0 +1,34 @@
1
+ name: PR Workflow
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, synchronize, ready_for_review, reopened]
6
+ branches:
7
+ - dev
8
+ - main
9
+
10
+ jobs:
11
+ lint_code:
12
+ uses: legendu-net/.github/.github/workflows/lint.yaml@main
13
+ secrets: inherit
14
+
15
+ test_code:
16
+ permissions:
17
+ contents: read
18
+ pull-requests: read
19
+ uses: legendu-net/.github/.github/workflows/test.yaml@main
20
+ secrets: inherit
21
+
22
+ claude-review:
23
+ needs: [lint_code, test_code]
24
+ permissions:
25
+ contents: read
26
+ issues: write
27
+ pull-requests: write
28
+ id-token: write
29
+ uses: legendu-net/.github/.github/workflows/claude-code-review.yml@main
30
+ with:
31
+ pr_number: ${{ github.event.pull_request.number }}
32
+ draft: ${{ github.event.pull_request.draft }}
33
+ head_repo_full_name: ${{ github.event.pull_request.head.repo.full_name }}
34
+ secrets: inherit
@@ -0,0 +1,12 @@
1
+ name: Release
2
+ on:
3
+ release:
4
+ types: [published]
5
+ jobs:
6
+ release:
7
+ permissions:
8
+ contents: write
9
+ issues: write
10
+ pull-requests: write
11
+ uses: legendu-net/.github/.github/workflows/release.yaml@main
12
+ secrets: inherit
@@ -0,0 +1,9 @@
1
+ name: Remove Branches
2
+ on:
3
+ schedule:
4
+ - cron: '0 3 * * *'
5
+ timezone: 'America/Los_Angeles'
6
+ jobs:
7
+ remove_branch:
8
+ uses: legendu-net/.github/.github/workflows/remove_branch.yaml@main
9
+ secrets: inherit
@@ -7,7 +7,7 @@ A simple Python wrapper for GitHub REST APIs, optimized for use in GitHub Action
7
7
  - **Purpose:** Provide a streamlined interface for interacting with GitHub's REST API
8
8
  and performing Git operations within automation scripts.
9
9
  - **Main Technologies:**
10
- - **Python 3.12+**: Core language.
10
+ - **Python 3.12.7+**: Core language.
11
11
  - **requests**: For HTTP interactions with the GitHub API.
12
12
  - **dulwich**: A pure-Python implementation of Git for repository operations.
13
13
  - **tenacity**: For retry logic on API requests.
@@ -0,0 +1 @@
1
+ AGENTS.md
@@ -1,13 +1,13 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: github-rest-api
3
- Version: 0.48.0
3
+ Version: 0.51.1
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
7
7
  Classifier: Programming Language :: Python :: 3.12
8
8
  Classifier: Programming Language :: Python :: 3.13
9
9
  Classifier: Programming Language :: Python :: 3.14
10
- Requires-Python: <4,>=3.12
10
+ Requires-Python: <4,>=3.12.7
11
11
  Requires-Dist: dulwich>=0.25.1
12
12
  Requires-Dist: psutil>=5.9.4
13
13
  Requires-Dist: pynacl>=1.5
@@ -1,19 +1,27 @@
1
1
  """GitHub REST APIs."""
2
2
 
3
3
  from .github import (
4
+ UNSET,
5
+ IssueState,
6
+ IssueStateReason,
4
7
  MergeMethod,
5
8
  Organization,
6
9
  Repository,
7
10
  RepositoryType,
8
11
  SecretVisibility,
12
+ Unset,
9
13
  User,
10
14
  )
11
15
 
12
16
  __all__ = [
17
+ "UNSET",
18
+ "IssueState",
19
+ "IssueStateReason",
13
20
  "MergeMethod",
14
21
  "Organization",
15
22
  "Repository",
16
23
  "RepositoryType",
17
24
  "SecretVisibility",
25
+ "Unset",
18
26
  "User",
19
27
  ]