github-rest-api 0.48.0__tar.gz → 0.50.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 (60) hide show
  1. github_rest_api-0.50.0/.github/workflows/auto_merge_pull_request.yaml +81 -0
  2. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/claude-code-review.yml +11 -5
  3. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/test.yaml +6 -2
  4. github_rest_api-0.48.0/GEMINI.md → github_rest_api-0.50.0/AGENTS.md +1 -1
  5. github_rest_api-0.50.0/CLAUDE.md +1 -0
  6. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/PKG-INFO +2 -2
  7. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/__init__.py +8 -0
  8. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/github.py +561 -27
  9. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/container/build_container_images.py +6 -0
  10. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/auto_merge_pull_request.py +3 -2
  11. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/create_github_repo.py +48 -24
  12. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/create_pull_request.py +10 -1
  13. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/release_on_github.py +16 -12
  14. github_rest_api-0.50.0/github_rest_api/scripts/github/upload_image_to_issue.py +536 -0
  15. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/utils.py +80 -1
  16. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/utils.py +19 -0
  17. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/pyproject.toml +9 -3
  18. github_rest_api-0.50.0/tests/test_auto_merge_pull_request.py +16 -0
  19. github_rest_api-0.50.0/tests/test_create_github_repo.py +128 -0
  20. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/tests/test_create_pull_request.py +12 -0
  21. github_rest_api-0.50.0/tests/test_github.py +1426 -0
  22. github_rest_api-0.50.0/tests/test_release_on_github.py +121 -0
  23. github_rest_api-0.50.0/tests/test_upload_image_to_issue.py +700 -0
  24. github_rest_api-0.50.0/tests/test_utils.py +90 -0
  25. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/uv.lock +2 -2
  26. github_rest_api-0.48.0/.github/workflows/auto_merge_pull_request.yaml +0 -31
  27. github_rest_api-0.48.0/tests/test_github.py +0 -746
  28. github_rest_api-0.48.0/tests/test_release_on_github.py +0 -64
  29. github_rest_api-0.48.0/tests/test_utils.py +0 -34
  30. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.devcontainer/devcontainer.json +0 -0
  31. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/claude.yml +0 -0
  32. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/create_pr_to_main.yaml +0 -0
  33. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/lint.yaml +0 -0
  34. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/release.yaml +0 -0
  35. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.github/workflows/remove_branch.yaml +0 -0
  36. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/.gitignore +0 -0
  37. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/README.md +0 -0
  38. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/pr_content.py +0 -0
  39. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/__init__.py +0 -0
  40. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/cargo/__init__.py +0 -0
  41. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/cargo/benchmark.py +0 -0
  42. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/cargo/profiling.py +0 -0
  43. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/cargo/utils.py +0 -0
  44. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/container/__init__.py +0 -0
  45. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/container/config_container.py +0 -0
  46. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
  47. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/__init__.py +0 -0
  48. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/remove_branch.py +0 -0
  49. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/auto_merge_pull_request.yaml +0 -0
  50. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -0
  51. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -0
  52. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -0
  53. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -0
  54. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/python/test.yaml +0 -0
  55. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -0
  56. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/memory/MEMORY.md +0 -0
  57. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/memory/feedback_test_runner.md +0 -0
  58. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/tests/__init__.py +0 -0
  59. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/tests/test_build_container_images.py +0 -0
  60. {github_rest_api-0.48.0 → github_rest_api-0.50.0}/tests/test_pr_content.py +0 -0
@@ -0,0 +1,81 @@
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
+ - Claude Code Review
17
+ - Lint Code
18
+ - Run Tests
19
+ types:
20
+ - completed
21
+ # Kept for approvals that come from a human rather than from Claude.
22
+ #
23
+ # `issue_comment: created` is deliberately absent: the only comment created on
24
+ # a PR here is the review's tracking comment, created seconds after the push,
25
+ # when the head commit is still under the age gate and the marker has not been
26
+ # written. It fired on every PR and could never merge anything. A marker typed
27
+ # by hand is picked up by the cron, or immediately via `workflow_dispatch`.
28
+ pull_request_review:
29
+ types:
30
+ - submitted
31
+ # Backstop for anything the event triggers miss.
32
+ schedule:
33
+ - cron: '0 * * * *'
34
+ timezone: 'America/Los_Angeles'
35
+ # Manual escape hatch. Run with `dry_run` to have the tool log its per-PR
36
+ # `Skipping auto-merge of PR #N: <reason>` verdicts without merging anything,
37
+ # which is the fastest way to diagnose why a PR is not being picked up.
38
+ workflow_dispatch:
39
+ inputs:
40
+ dry_run:
41
+ description: Log eligible PRs without merging them
42
+ type: boolean
43
+ default: false
44
+ permissions:
45
+ contents: write
46
+ pull-requests: write
47
+ concurrency:
48
+ # Every run rescans all open PRs, so overlapping runs are pure duplicate work
49
+ # and the newest run always sees the freshest state. Do not cancel in
50
+ # progress: a run cancelled midway through the merge API call is worse than a
51
+ # redundant one.
52
+ group: auto-merge-pull-request
53
+ cancel-in-progress: false
54
+ jobs:
55
+ auto_merge_pull_request:
56
+ # A triggering workflow that failed, was cancelled or was skipped left the
57
+ # PR unmergeable or wrote no marker, so there is nothing new to act on.
58
+ # This job checks out no PR code, so the elevated `workflow_run` context is
59
+ # never exposed to PR-controlled input.
60
+ if: |
61
+ github.event_name != 'workflow_run'
62
+ || github.event.workflow_run.conclusion == 'success'
63
+ runs-on: ubuntu-latest
64
+ # The concurrency group above serializes every run, so a hung run would
65
+ # block all merges until the default 6h timeout.
66
+ timeout-minutes: 10
67
+ steps:
68
+ - name: Install uv
69
+ run: |
70
+ curl -LsSf https://astral.sh/uv/install.sh | sudo env UV_INSTALL_DIR="/usr/local/bin" sh
71
+ - name: Auto Merge PR
72
+ # `--allowed-types` is intentionally left at the upstream default
73
+ # (build, chore, ci, docs, deps) so that only simple PRs auto-merge;
74
+ # anything substantive, `feat` and `fix` included, is merged by hand.
75
+ run: |
76
+ uvx --from github-rest-api@latest auto_merge_pull_request \
77
+ --authors dclong \
78
+ --approvers dclong 'claude[bot]' 'gemini-code-assist[bot]' \
79
+ --marker 'AUTO_MERGE_APPROVED' \
80
+ ${{ inputs.dry_run && '--dry-run' || '' }} \
81
+ --token ${{ secrets.ACTIONS_TOKEN }}
@@ -10,13 +10,19 @@ on:
10
10
  # - "src/**/*.js"
11
11
  # - "src/**/*.jsx"
12
12
 
13
+ concurrency:
14
+ group: claude-review-${{ github.event.pull_request.number }}
15
+ cancel-in-progress: true
16
+
13
17
  jobs:
14
18
  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'
19
+ # Only review non-draft PRs whose branch lives in this repository. A PR from
20
+ # a fork is attacker-controlled input, and reviewing one with the ACTIONS_TOKEN
21
+ # PAT below would let a crafted title/description prompt-inject the
22
+ # AUTO_MERGE_APPROVED marker into a comment attributed to an auto-merge approver.
23
+ if: |
24
+ github.event.pull_request.head.repo.full_name == github.repository
25
+ && github.event.pull_request.draft == false
20
26
 
21
27
  runs-on: ubuntu-latest
22
28
  permissions:
@@ -11,8 +11,12 @@ jobs:
11
11
  os:
12
12
  - macOS-latest
13
13
  - ubuntu-latest
14
- python-version:
15
- - "3.12"
14
+ # The oldest supported patch release, spelled out rather than "3.12":
15
+ # a bare "3.12" resolves to the runner's system interpreter, which is
16
+ # below `requires-python` on ubuntu-latest, and uv then fails outright
17
+ # instead of looking for a compatible interpreter to download.
18
+ python-version:
19
+ - "3.12.7"
16
20
  - "3.13"
17
21
  - "3.14"
18
22
  steps:
@@ -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
1
  Metadata-Version: 2.4
2
2
  Name: github-rest-api
3
- Version: 0.48.0
3
+ Version: 0.50.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
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
  ]