github-rest-api 0.43.0__tar.gz → 0.44.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.
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/PKG-INFO +1 -1
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/github.py +27 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/pyproject.toml +1 -1
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_github.py +19 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/uv.lock +1 -1
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.devcontainer/devcontainer.json +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.github/workflows/create_pr_to_main.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.github/workflows/lint.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.github/workflows/release.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.github/workflows/remove_branch.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.github/workflows/test.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/.gitignore +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/GEMINI.md +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/README.md +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/pr_content.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/benchmark.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/profiling.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/utils.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/container/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/container/build_container_images.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/container/config_container.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/container/update_version_containerfile.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/add_github_repo.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/create_pull_request.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/release_on_github.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/remove_branch.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/create_pr_dev_to_main.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/create_pr_to_dev.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/create_pr_to_main.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/python/lint.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/python/test.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/workflows/remove_branch.yaml +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/utils.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/utils.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/memory/MEMORY.md +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/memory/feedback_test_runner.md +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/__init__.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_build_container_images.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_create_pull_request.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_pr_content.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_release_on_github.py +0 -0
- {github_rest_api-0.43.0 → github_rest_api-0.44.0}/tests/test_utils.py +0 -0
|
@@ -203,6 +203,12 @@ class GitHub:
|
|
|
203
203
|
params["page"] += 1
|
|
204
204
|
|
|
205
205
|
|
|
206
|
+
class IssueState(StrEnum):
|
|
207
|
+
OPEN = "open"
|
|
208
|
+
CLOSED = "closed"
|
|
209
|
+
ALL = "all"
|
|
210
|
+
|
|
211
|
+
|
|
206
212
|
class Repository(GitHub):
|
|
207
213
|
"""Abstraction of a GitHub repository."""
|
|
208
214
|
|
|
@@ -282,6 +288,19 @@ class Repository(GitHub):
|
|
|
282
288
|
"""List pull requests in this repository."""
|
|
283
289
|
return self._extract_all(url=self._url_pull, n=n)
|
|
284
290
|
|
|
291
|
+
def get_issues(
|
|
292
|
+
self, state: IssueState = IssueState.OPEN, n: int = 0
|
|
293
|
+
) -> list[dict[str, Any]]:
|
|
294
|
+
"""List issues in this repository.
|
|
295
|
+
|
|
296
|
+
:param state: Filter issues by state: ``open`` (the default),
|
|
297
|
+
``closed``, or ``all``. Note that GitHub's issues endpoint also
|
|
298
|
+
returns pull requests; each pull request carries a
|
|
299
|
+
``pull_request`` key.
|
|
300
|
+
:param n: The maximum number of issues to return (0 means all).
|
|
301
|
+
"""
|
|
302
|
+
return self._extract_all(url=self._url_issues, params={"state": state}, n=n)
|
|
303
|
+
|
|
285
304
|
def _generate_pull_request_content(
|
|
286
305
|
self, base: str, head: str, model: str
|
|
287
306
|
) -> tuple[str, str] | None:
|
|
@@ -499,6 +518,14 @@ class Repository(GitHub):
|
|
|
499
518
|
"""
|
|
500
519
|
return self.pr_has_change(pr_number=pr_number, pred=pred)
|
|
501
520
|
|
|
521
|
+
def get_issue_comments(self, issue_number: int, n: int = 0) -> list[dict[str, Any]]:
|
|
522
|
+
"""List comments on an issue in this repository.
|
|
523
|
+
|
|
524
|
+
:param issue_number: The number of the issue.
|
|
525
|
+
:param n: The maximum number of comments to return (0 means all).
|
|
526
|
+
"""
|
|
527
|
+
return self._extract_all(url=f"{self._url_issues}/{issue_number}/comments", n=n)
|
|
528
|
+
|
|
502
529
|
def create_issue_comment(self, issue_number: int, body: str) -> dict[str, Any]:
|
|
503
530
|
"""Add a new comment to an issue.
|
|
504
531
|
|
|
@@ -76,6 +76,25 @@ def test_repository_get_branch():
|
|
|
76
76
|
assert branch["name"] == "main"
|
|
77
77
|
|
|
78
78
|
|
|
79
|
+
def test_get_issues_passes_url_and_state():
|
|
80
|
+
repo = Repository("token", "owner/name")
|
|
81
|
+
with patch.object(repo, "_extract_all", return_value=[]) as mock_extract:
|
|
82
|
+
repo.get_issues()
|
|
83
|
+
assert mock_extract.call_args.kwargs["url"] == (
|
|
84
|
+
"https://api.github.com/repos/owner/name/issues"
|
|
85
|
+
)
|
|
86
|
+
assert mock_extract.call_args.kwargs["params"] == {"state": "open"}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def test_get_issue_comments_passes_url():
|
|
90
|
+
repo = Repository("token", "owner/name")
|
|
91
|
+
with patch.object(repo, "_extract_all", return_value=[]) as mock_extract:
|
|
92
|
+
repo.get_issue_comments(7)
|
|
93
|
+
assert mock_extract.call_args.kwargs["url"] == (
|
|
94
|
+
"https://api.github.com/repos/owner/name/issues/7/comments"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
|
|
79
98
|
def test_compare_url_encodes_branch_names():
|
|
80
99
|
repo = Repository("token", "owner/name")
|
|
81
100
|
response = MagicMock()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/benchmark.py
RENAMED
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/cargo/profiling.py
RENAMED
|
File without changes
|
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/container/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/__init__.py
RENAMED
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/add_github_repo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.43.0 → github_rest_api-0.44.0}/github_rest_api/scripts/github/remove_branch.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|