ultralytics-actions 0.0.54__py3-none-any.whl → 0.0.55__py3-none-any.whl
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.
- actions/__init__.py +1 -1
- actions/summarize_pr.py +4 -4
- actions/update_markdown_code_blocks.py +1 -1
- actions/utils/github_utils.py +3 -3
- actions/utils/openai_utils.py +10 -1
- {ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/METADATA +1 -1
- ultralytics_actions-0.0.55.dist-info/RECORD +15 -0
- ultralytics_actions-0.0.54.dist-info/RECORD +0 -15
- {ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/LICENSE +0 -0
- {ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/WHEEL +0 -0
- {ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/entry_points.txt +0 -0
- {ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/top_level.txt +0 -0
actions/__init__.py
CHANGED
actions/summarize_pr.py
CHANGED
@@ -29,7 +29,7 @@ def generate_merge_message(pr_summary=None, pr_credit=None, pr_url=None):
|
|
29
29
|
f"Write a warm thank-you comment for the merged PR {pr_url} by {pr_credit}. "
|
30
30
|
f"Context:\n{pr_summary}\n\n"
|
31
31
|
f"Start with an enthusiastic note about the merge, incorporate a relevant inspirational quote from a historical "
|
32
|
-
f"figure, and connect it to the PR
|
32
|
+
f"figure, and connect it to the PR's impact. Keep it concise yet meaningful, ensuring contributors feel valued."
|
33
33
|
),
|
34
34
|
},
|
35
35
|
]
|
@@ -120,7 +120,7 @@ def update_pr_description(pr_url, new_summary, headers, max_retries=2):
|
|
120
120
|
|
121
121
|
|
122
122
|
def label_fixed_issues(repository, pr_number, pr_summary, headers, action):
|
123
|
-
"""Labels issues closed by PR when merged, notifies users, returns PR contributors."""
|
123
|
+
"""Labels issues closed by PR when merged, notifies users, and returns PR contributors."""
|
124
124
|
query = """
|
125
125
|
query($owner: String!, $repo: String!, $pr_number: Int!) {
|
126
126
|
repository(owner: $owner, name: $repo) {
|
@@ -143,7 +143,7 @@ query($owner: String!, $repo: String!, $pr_number: Int!) {
|
|
143
143
|
|
144
144
|
if response.status_code != 200:
|
145
145
|
print(f"Failed to fetch linked issues. Status code: {response.status_code}")
|
146
|
-
return
|
146
|
+
return None
|
147
147
|
|
148
148
|
try:
|
149
149
|
data = response.json()["data"]["repository"]["pullRequest"]
|
@@ -197,7 +197,7 @@ query($owner: String!, $repo: String!, $pr_number: Int!) {
|
|
197
197
|
return pr_credit
|
198
198
|
except KeyError as e:
|
199
199
|
print(f"Error parsing GraphQL response: {e}")
|
200
|
-
return
|
200
|
+
return None
|
201
201
|
|
202
202
|
|
203
203
|
def remove_todos_on_merge(pr_number, repository, headers):
|
@@ -158,7 +158,7 @@ def main(root_dir=Path.cwd(), verbose=False):
|
|
158
158
|
for markdown_file in markdown_files:
|
159
159
|
if verbose:
|
160
160
|
print(f"Processing {markdown_file}")
|
161
|
-
markdown_content, temp_files = process_markdown_file(markdown_file, temp_dir)
|
161
|
+
markdown_content, temp_files = process_markdown_file(markdown_file, temp_dir, verbose)
|
162
162
|
if markdown_content and temp_files:
|
163
163
|
all_temp_files.append((markdown_file, markdown_content, temp_files))
|
164
164
|
|
actions/utils/github_utils.py
CHANGED
@@ -32,7 +32,7 @@ class Action:
|
|
32
32
|
|
33
33
|
@staticmethod
|
34
34
|
def _load_event_data(event_path: str) -> dict:
|
35
|
-
"""
|
35
|
+
"""Load GitHub event data from path if it exists."""
|
36
36
|
if event_path and Path(event_path).exists():
|
37
37
|
return json.loads(Path(event_path).read_text())
|
38
38
|
return {}
|
@@ -79,7 +79,7 @@ class Action:
|
|
79
79
|
return result
|
80
80
|
|
81
81
|
def print_info(self):
|
82
|
-
"""Print GitHub Actions information."""
|
82
|
+
"""Print GitHub Actions information including event details and repository information."""
|
83
83
|
info = {
|
84
84
|
"github.event_name": self.event_name,
|
85
85
|
"github.event.action": self.event_data.get("action"),
|
@@ -110,7 +110,7 @@ class Action:
|
|
110
110
|
|
111
111
|
|
112
112
|
def ultralytics_actions_info():
|
113
|
-
"""
|
113
|
+
"""Return GitHub Actions environment information and configuration details for Ultralytics workflows."""
|
114
114
|
Action().print_info()
|
115
115
|
|
116
116
|
|
actions/utils/openai_utils.py
CHANGED
@@ -14,11 +14,19 @@ SYSTEM_PROMPT_ADDITION = """
|
|
14
14
|
Guidance:
|
15
15
|
- Ultralytics Branding: Use YOLO11, YOLO12, etc., not YOLOv11, YOLOv12 (only older versions like YOLOv10 have a v). Always capitalize "HUB" in "Ultralytics HUB"; use "Ultralytics HUB", not "The Ultralytics HUB".
|
16
16
|
- Avoid Equations: Do not include equations or mathematical notations.
|
17
|
-
- Markdown: Always respond in Markdown.
|
18
17
|
- Tone: Adopt a professional, friendly, and concise tone.
|
19
18
|
"""
|
20
19
|
|
21
20
|
|
21
|
+
def remove_outer_codeblocks(string):
|
22
|
+
"""Removes outer code block markers and language identifiers from a string while preserving inner content."""
|
23
|
+
string = string.strip()
|
24
|
+
if string.startswith("```") and string.endswith("```"):
|
25
|
+
# Get everything after first ``` and newline, up to the last ```
|
26
|
+
string = string[string.find("\n") + 1 : string.rfind("```")].strip()
|
27
|
+
return string
|
28
|
+
|
29
|
+
|
22
30
|
def get_completion(
|
23
31
|
messages: List[Dict[str, str]],
|
24
32
|
check_links: bool = True,
|
@@ -45,6 +53,7 @@ def get_completion(
|
|
45
53
|
r = requests.post(url, headers=headers, json=data)
|
46
54
|
r.raise_for_status()
|
47
55
|
content = r.json()["choices"][0]["message"]["content"].strip()
|
56
|
+
content = remove_outer_codeblocks(content)
|
48
57
|
for x in remove:
|
49
58
|
content = content.replace(x, "")
|
50
59
|
if not check_links or check_links_in_string(content): # if no checks or checks are passing return response
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.55
|
4
4
|
Summary: Ultralytics Actions for GitHub automation and PR management.
|
5
5
|
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
6
6
|
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
actions/__init__.py,sha256=DJB5iF9yBtEKiORNXrvFFuRZKrAKH68c_98Wez8VoHs,742
|
2
|
+
actions/first_interaction.py,sha256=1_WvQHCi5RWaSfyi49ClF2Zk_3CKGjFnZqz6FlxPRAc,17868
|
3
|
+
actions/summarize_pr.py,sha256=sPKl6gN7HeGb9o9-QxVTnK2WZJW4iUytK6MApthn6HQ,11086
|
4
|
+
actions/summarize_release.py,sha256=tov6qsYGC68lfobvkwVyoWZBGtJ598G0m097n4Ydzvo,8472
|
5
|
+
actions/update_markdown_code_blocks.py,sha256=tUChNBIZN-B_unGMG9yQk-dohi7bit02Yl3xc4UtycQ,6610
|
6
|
+
actions/utils/__init__.py,sha256=WStdEAYROVnF0nubEOmrFLrejkRiMXIefA5O1ckfcFs,476
|
7
|
+
actions/utils/common_utils.py,sha256=PZkK9Wc3od34J9VSw4ICWHhQQC033o3DCrCy0VIyZE4,6024
|
8
|
+
actions/utils/github_utils.py,sha256=-F--JgxtXE0fSPMFEzakz7iZilp-vonzLiyXfg0b17Y,7117
|
9
|
+
actions/utils/openai_utils.py,sha256=qQbmrJpOUANxSMf7inDSgPIwgf0JHD1fWZuab-y2W6g,2942
|
10
|
+
ultralytics_actions-0.0.55.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
11
|
+
ultralytics_actions-0.0.55.dist-info/METADATA,sha256=9NPBdeMdAU7SaSY9VfYQY8KWIDI-6A0RS9vUL8rh82I,10561
|
12
|
+
ultralytics_actions-0.0.55.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
13
|
+
ultralytics_actions-0.0.55.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
|
14
|
+
ultralytics_actions-0.0.55.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
15
|
+
ultralytics_actions-0.0.55.dist-info/RECORD,,
|
@@ -1,15 +0,0 @@
|
|
1
|
-
actions/__init__.py,sha256=jdvLrgMZ2Flg6xeVVfi6ayAk9bKCZWgtopdmkyIv8CI,742
|
2
|
-
actions/first_interaction.py,sha256=1_WvQHCi5RWaSfyi49ClF2Zk_3CKGjFnZqz6FlxPRAc,17868
|
3
|
-
actions/summarize_pr.py,sha256=WHte6PNJbk_-T8fRDJERs6x3KL4Ah54oH0OH-tsqMUA,11092
|
4
|
-
actions/summarize_release.py,sha256=tov6qsYGC68lfobvkwVyoWZBGtJ598G0m097n4Ydzvo,8472
|
5
|
-
actions/update_markdown_code_blocks.py,sha256=ip-KRIfnTMDrs9IOqdSY7YXR4abNLsylGnXtrvoXjwY,6601
|
6
|
-
actions/utils/__init__.py,sha256=WStdEAYROVnF0nubEOmrFLrejkRiMXIefA5O1ckfcFs,476
|
7
|
-
actions/utils/common_utils.py,sha256=PZkK9Wc3od34J9VSw4ICWHhQQC033o3DCrCy0VIyZE4,6024
|
8
|
-
actions/utils/github_utils.py,sha256=0h0Hz2tgUta61Ymn9YggRXBZ7aZdF5krKnX7Tj9jqRU,7068
|
9
|
-
actions/utils/openai_utils.py,sha256=EQAs1cd-YXXF8xHKLrY3Tsl_AVzgdlXcYOZMYh88_gM,2524
|
10
|
-
ultralytics_actions-0.0.54.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
11
|
-
ultralytics_actions-0.0.54.dist-info/METADATA,sha256=4RFFr5-vHZihzjgS_ZklhfTvhO9-TXjmbIDjMxyeYWY,10561
|
12
|
-
ultralytics_actions-0.0.54.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
13
|
-
ultralytics_actions-0.0.54.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
|
14
|
-
ultralytics_actions-0.0.54.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
15
|
-
ultralytics_actions-0.0.54.dist-info/RECORD,,
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.54.dist-info → ultralytics_actions-0.0.55.dist-info}/entry_points.txt
RENAMED
File without changes
|
File without changes
|