github-rest-api 0.36.0__tar.gz → 0.37.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.
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/PKG-INFO +1 -1
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/container/build_container_images.py +27 -10
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/pyproject.toml +1 -1
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/uv.lock +1 -1
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.gemini/system.md +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.github/workflows/create_pr_to_main.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.github/workflows/lint.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.github/workflows/release.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.github/workflows/remove_branch.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.github/workflows/test.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.gitignore +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/.gitpod.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/GEMINI.md +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/README.md +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/benchmark.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/profiling.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/utils.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/container/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/container/config_container.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/container/update_version_containerfile.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/add_github_repo.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/create_pull_request.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/release_on_github.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/remove_branch.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/create_pr_dev_to_main.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/create_pr_to_dev.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/create_pr_to_main.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/python/lint.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/python/test.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/workflows/remove_branch.yml +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/utils.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/github.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/utils.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/memory/MEMORY.md +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/memory/feedback_test_runner.md +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/tests/__init__.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/tests/test_build_container_images.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/tests/test_github.py +0 -0
- {github_rest_api-0.36.0 → github_rest_api-0.37.1}/tests/test_utils.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import argparse
|
|
2
|
+
from collections.abc import Sequence
|
|
2
3
|
import datetime
|
|
3
4
|
from pathlib import Path
|
|
4
5
|
import subprocess as sp
|
|
@@ -59,7 +60,8 @@ def changed_files_between(
|
|
|
59
60
|
def has_relevant_changes(
|
|
60
61
|
commit1: str | bytes,
|
|
61
62
|
commit2: str | bytes,
|
|
62
|
-
image_dirs:
|
|
63
|
+
image_dirs: Sequence[str],
|
|
64
|
+
paths_monitoring: Sequence[str] = (),
|
|
63
65
|
name1: str = "",
|
|
64
66
|
name2: str = "",
|
|
65
67
|
) -> bool:
|
|
@@ -69,20 +71,25 @@ def has_relevant_changes(
|
|
|
69
71
|
commit1 = commit1.encode()
|
|
70
72
|
if isinstance(commit2, str):
|
|
71
73
|
commit2 = commit2.encode()
|
|
72
|
-
|
|
74
|
+
monitored = [Path(m).resolve() for m in (*image_dirs, *paths_monitoring)]
|
|
73
75
|
for p in changed_files_between(commit1, commit2, name1=name1, name2=name2):
|
|
74
|
-
|
|
76
|
+
p_resolved = p.resolve()
|
|
77
|
+
if any(p_resolved.is_relative_to(m) for m in monitored):
|
|
75
78
|
return True
|
|
76
79
|
return False
|
|
77
80
|
|
|
78
81
|
|
|
79
|
-
def has_relevant_changes_main_dev(
|
|
82
|
+
def has_relevant_changes_main_dev(
|
|
83
|
+
image_dirs: Sequence[str], paths_monitoring: Sequence[str] = ()
|
|
84
|
+
) -> bool:
|
|
80
85
|
try:
|
|
81
86
|
c_main = _get_commit(b"main")
|
|
82
87
|
c_dev = _get_commit(b"dev")
|
|
83
88
|
except (KeyError, NotGitRepository):
|
|
84
89
|
return True
|
|
85
|
-
return has_relevant_changes(
|
|
90
|
+
return has_relevant_changes(
|
|
91
|
+
c_main, c_dev, image_dirs, paths_monitoring, name1="main", name2="dev"
|
|
92
|
+
)
|
|
86
93
|
|
|
87
94
|
|
|
88
95
|
def _tag_date(tag: str) -> str:
|
|
@@ -127,11 +134,12 @@ def _build_image(
|
|
|
127
134
|
def build_images(
|
|
128
135
|
commit1: str,
|
|
129
136
|
commit2: str,
|
|
130
|
-
image_dirs:
|
|
137
|
+
image_dirs: Sequence[str],
|
|
138
|
+
paths_monitoring: Sequence[str] = (),
|
|
131
139
|
tool: str = "podman",
|
|
132
140
|
registry: str = "quay.io/legendu",
|
|
133
141
|
):
|
|
134
|
-
if not has_relevant_changes(commit1, commit2, image_dirs):
|
|
142
|
+
if not has_relevant_changes(commit1, commit2, image_dirs, paths_monitoring):
|
|
135
143
|
print(
|
|
136
144
|
f"Skip building {tool} images as there are no relevant changes between {
|
|
137
145
|
commit1
|
|
@@ -139,7 +147,7 @@ def build_images(
|
|
|
139
147
|
)
|
|
140
148
|
return
|
|
141
149
|
tags = ["next"]
|
|
142
|
-
if not has_relevant_changes_main_dev(image_dirs):
|
|
150
|
+
if not has_relevant_changes_main_dev(image_dirs, paths_monitoring):
|
|
143
151
|
tags.append("latest")
|
|
144
152
|
tags.extend([_tag_date(tag) for tag in tags])
|
|
145
153
|
print(f"Building {tool} images using tags:", ", ".join(tags), "\n", flush=True)
|
|
@@ -207,14 +215,22 @@ def parse_args():
|
|
|
207
215
|
metavar="FILE",
|
|
208
216
|
help="Path to a file listing image directories to build, one per line.",
|
|
209
217
|
)
|
|
218
|
+
parser.add_argument(
|
|
219
|
+
"--paths-monitoring",
|
|
220
|
+
dest="paths_monitoring",
|
|
221
|
+
nargs="*",
|
|
222
|
+
default=(),
|
|
223
|
+
metavar="PATH",
|
|
224
|
+
help="Extra paths to monitor for changes in addition to the image directories.",
|
|
225
|
+
)
|
|
210
226
|
return parser.parse_args()
|
|
211
227
|
|
|
212
228
|
|
|
213
229
|
def _resolve_image_dirs(args: argparse.Namespace) -> list[str]:
|
|
214
230
|
if args.image_dirs:
|
|
215
231
|
return args.image_dirs
|
|
216
|
-
|
|
217
|
-
|
|
232
|
+
with Path(args.file_image_dirs).open(encoding="utf-8") as fin:
|
|
233
|
+
return [s for line in fin if (s := line.strip()) and not s.startswith("#")]
|
|
218
234
|
|
|
219
235
|
|
|
220
236
|
def main():
|
|
@@ -223,6 +239,7 @@ def main():
|
|
|
223
239
|
args.commit1,
|
|
224
240
|
args.commit2,
|
|
225
241
|
_resolve_image_dirs(args),
|
|
242
|
+
paths_monitoring=args.paths_monitoring,
|
|
226
243
|
tool=args.tool,
|
|
227
244
|
registry=args.registry,
|
|
228
245
|
)
|
|
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.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/benchmark.py
RENAMED
|
File without changes
|
{github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/cargo/profiling.py
RENAMED
|
File without changes
|
|
File without changes
|
{github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/container/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/__init__.py
RENAMED
|
File without changes
|
{github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/github/add_github_repo.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{github_rest_api-0.36.0 → github_rest_api-0.37.1}/github_rest_api/actions/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
|