ultralytics-actions 0.0.95__tar.gz → 0.0.97__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.
- {ultralytics_actions-0.0.95/ultralytics_actions.egg-info → ultralytics_actions-0.0.97}/PKG-INFO +13 -3
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/README.md +12 -2
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/__init__.py +1 -1
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/dispatch_actions.py +5 -5
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/first_interaction.py +7 -6
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/summarize_pr.py +2 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/summarize_release.py +2 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/update_file_headers.py +2 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/update_markdown_code_blocks.py +2 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/utils/common_utils.py +8 -7
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/utils/github_utils.py +3 -2
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/utils/openai_utils.py +8 -7
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/utils/version_utils.py +3 -1
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_file_headers.py +0 -2
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_update_markdown_codeblocks.py +1 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_urls.py +1 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97/ultralytics_actions.egg-info}/PKG-INFO +13 -3
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/LICENSE +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/actions/utils/__init__.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/pyproject.toml +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/setup.cfg +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_cli_commands.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_common_utils.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_dispatch_actions.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_first_interaction.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_github_utils.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_init.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_openai_utils.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_summarize_pr.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/tests/test_summarize_release.py +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/SOURCES.txt +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/entry_points.txt +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/requires.txt +0 -0
- {ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/top_level.txt +0 -0
{ultralytics_actions-0.0.95/ultralytics_actions.egg-info → ultralytics_actions-0.0.97}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.97
|
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>
|
@@ -47,8 +47,6 @@ Welcome to the [Ultralytics Actions](https://github.com/ultralytics/actions) rep
|
|
47
47
|
[](https://github.com/ultralytics/actions/actions/workflows/ci.yml)
|
48
48
|
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
49
49
|
[](https://codecov.io/github/ultralytics/actions)
|
50
|
-
[](https://badge.fury.io/py/ultralytics-actions)
|
51
|
-
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
52
50
|
|
53
51
|
[](https://discord.com/invite/ultralytics)
|
54
52
|
[](https://community.ultralytics.com/)
|
@@ -130,6 +128,18 @@ To integrate this action into your Ultralytics repository:
|
|
130
128
|
|
131
129
|
3. **Customize:** Adjust the `runs-on` runner and the boolean flags (`labels`, `python`, `prettier`, `swift`, `spelling`, `links`, `summary`) based on your project's needs. Remember to add your `OPENAI_API_KEY` as a secret in your repository settings if you enable `labels` or `summary`.
|
132
130
|
|
131
|
+
## Python Package
|
132
|
+
|
133
|
+
Install the `ultralytics-actions` Python package directly with Pip:
|
134
|
+
|
135
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
136
|
+
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
137
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
138
|
+
|
139
|
+
```sh
|
140
|
+
pip install ultralytics-actions
|
141
|
+
```
|
142
|
+
|
133
143
|
## 💡 Contribute
|
134
144
|
|
135
145
|
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
@@ -9,8 +9,6 @@ Welcome to the [Ultralytics Actions](https://github.com/ultralytics/actions) rep
|
|
9
9
|
[](https://github.com/ultralytics/actions/actions/workflows/ci.yml)
|
10
10
|
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
11
11
|
[](https://codecov.io/github/ultralytics/actions)
|
12
|
-
[](https://badge.fury.io/py/ultralytics-actions)
|
13
|
-
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
14
12
|
|
15
13
|
[](https://discord.com/invite/ultralytics)
|
16
14
|
[](https://community.ultralytics.com/)
|
@@ -92,6 +90,18 @@ To integrate this action into your Ultralytics repository:
|
|
92
90
|
|
93
91
|
3. **Customize:** Adjust the `runs-on` runner and the boolean flags (`labels`, `python`, `prettier`, `swift`, `spelling`, `links`, `summary`) based on your project's needs. Remember to add your `OPENAI_API_KEY` as a secret in your repository settings if you enable `labels` or `summary`.
|
94
92
|
|
93
|
+
## Python Package
|
94
|
+
|
95
|
+
Install the `ultralytics-actions` Python package directly with Pip:
|
96
|
+
|
97
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
98
|
+
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
99
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
100
|
+
|
101
|
+
```sh
|
102
|
+
pip install ultralytics-actions
|
103
|
+
```
|
104
|
+
|
95
105
|
## 💡 Contribute
|
96
106
|
|
97
107
|
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
3
5
|
import time
|
4
6
|
from datetime import datetime
|
5
|
-
from typing import Dict, List
|
6
7
|
|
7
8
|
from .utils import GITHUB_API_URL, Action
|
8
9
|
|
@@ -18,7 +19,7 @@ def get_pr_branch(event) -> str:
|
|
18
19
|
return pr_data.get("head", {}).get("ref", "main")
|
19
20
|
|
20
21
|
|
21
|
-
def trigger_and_get_workflow_info(event, branch: str) ->
|
22
|
+
def trigger_and_get_workflow_info(event, branch: str) -> list[dict]:
|
22
23
|
"""Triggers workflows and returns their information."""
|
23
24
|
repo = event.repository
|
24
25
|
results = []
|
@@ -47,8 +48,7 @@ def trigger_and_get_workflow_info(event, branch: str) -> List[Dict]:
|
|
47
48
|
)
|
48
49
|
|
49
50
|
if runs_response.status_code == 200:
|
50
|
-
runs
|
51
|
-
if runs:
|
51
|
+
if runs := runs_response.json().get("workflow_runs", []):
|
52
52
|
run_url = runs[0].get("html_url", run_url)
|
53
53
|
run_number = runs[0].get("run_number")
|
54
54
|
|
@@ -57,7 +57,7 @@ def trigger_and_get_workflow_info(event, branch: str) -> List[Dict]:
|
|
57
57
|
return results
|
58
58
|
|
59
59
|
|
60
|
-
def update_comment(event, comment_body: str, triggered_actions:
|
60
|
+
def update_comment(event, comment_body: str, triggered_actions: list[dict], branch: str) -> bool:
|
61
61
|
"""Updates the comment with workflow information."""
|
62
62
|
if not triggered_actions:
|
63
63
|
return False
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
3
5
|
import os
|
4
|
-
from typing import Dict, List, Tuple
|
5
6
|
|
6
7
|
from .utils import GITHUB_API_URL, Action, get_completion, remove_html_comments
|
7
8
|
|
@@ -9,7 +10,7 @@ from .utils import GITHUB_API_URL, Action, get_completion, remove_html_comments
|
|
9
10
|
BLOCK_USER = os.getenv("BLOCK_USER", "false").lower() == "true"
|
10
11
|
|
11
12
|
|
12
|
-
def get_event_content(event) ->
|
13
|
+
def get_event_content(event) -> tuple[int, str, str, str, str, str, str]:
|
13
14
|
"""Extracts key information from GitHub event data for issues, pull requests, or discussions."""
|
14
15
|
data = event.event_data
|
15
16
|
name = event.event_name
|
@@ -108,8 +109,8 @@ def block_user(event, username: str):
|
|
108
109
|
|
109
110
|
|
110
111
|
def get_relevant_labels(
|
111
|
-
issue_type: str, title: str, body: str, available_labels:
|
112
|
-
) ->
|
112
|
+
issue_type: str, title: str, body: str, available_labels: dict, current_labels: list
|
113
|
+
) -> list[str]:
|
113
114
|
"""Determines relevant labels for GitHub issues/PRs using OpenAI, considering title, body, and existing labels."""
|
114
115
|
# Remove mutually exclusive labels like both 'bug' and 'question' or inappropriate labels like 'help wanted'
|
115
116
|
for label in {
|
@@ -178,7 +179,7 @@ YOUR RESPONSE (label names only):
|
|
178
179
|
]
|
179
180
|
|
180
181
|
|
181
|
-
def get_label_ids(event, labels:
|
182
|
+
def get_label_ids(event, labels: list[str]) -> list[str]:
|
182
183
|
"""Retrieves GitHub label IDs for a list of label names using the GraphQL API."""
|
183
184
|
query = """
|
184
185
|
query($owner: String!, $name: String!) {
|
@@ -202,7 +203,7 @@ query($owner: String!, $name: String!) {
|
|
202
203
|
return []
|
203
204
|
|
204
205
|
|
205
|
-
def apply_labels(event, number: int, node_id: str, labels:
|
206
|
+
def apply_labels(event, number: int, node_id: str, labels: list[str], issue_type: str):
|
206
207
|
"""Applies specified labels to a GitHub issue, pull request, or discussion using the appropriate API."""
|
207
208
|
if "Alert" in labels:
|
208
209
|
create_alert_label(event)
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
3
5
|
import os
|
4
6
|
import re
|
5
7
|
import time
|
@@ -148,8 +150,8 @@ def allow_redirect(start="", end=""):
|
|
148
150
|
return (
|
149
151
|
end
|
150
152
|
and end.startswith("https://")
|
151
|
-
and
|
152
|
-
and
|
153
|
+
and all(item not in end_lower for item in REDIRECT_END_IGNORE_LIST)
|
154
|
+
and all(item not in start_lower for item in REDIRECT_START_IGNORE_LIST)
|
153
155
|
)
|
154
156
|
|
155
157
|
|
@@ -241,11 +243,10 @@ def check_links_in_string(text, verbose=True, return_bad=False, replace=False):
|
|
241
243
|
if not valid and brave_api_key:
|
242
244
|
query = f"{(redirect or url)[:200]} {title[:199]}"
|
243
245
|
if search_urls := brave_search(query, brave_api_key, count=3):
|
244
|
-
best_url =
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
break
|
246
|
+
best_url = next(
|
247
|
+
(alt_url for alt_url in search_urls if is_url(alt_url, session)),
|
248
|
+
search_urls[0],
|
249
|
+
)
|
249
250
|
if url != best_url:
|
250
251
|
replacements[url] = best_url
|
251
252
|
modified_text = modified_text.replace(url, best_url)
|
@@ -1,9 +1,10 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
3
5
|
import json
|
4
6
|
import os
|
5
7
|
from pathlib import Path
|
6
|
-
from typing import Union
|
7
8
|
|
8
9
|
import requests
|
9
10
|
|
@@ -96,7 +97,7 @@ class Action:
|
|
96
97
|
"""Checks if the repository is public using event data or GitHub API if needed."""
|
97
98
|
return self.event_data.get("repository", {}).get("private")
|
98
99
|
|
99
|
-
def get_username(self) ->
|
100
|
+
def get_username(self) -> str | None:
|
100
101
|
"""Gets username associated with the GitHub token."""
|
101
102
|
response = self.post(GITHUB_GRAPHQL_URL, json={"query": "query { viewer { login } }"})
|
102
103
|
if response.status_code == 200:
|
@@ -1,8 +1,9 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
+
from __future__ import annotations
|
4
|
+
|
3
5
|
import os
|
4
6
|
import time
|
5
|
-
from typing import Dict, List
|
6
7
|
|
7
8
|
import requests
|
8
9
|
|
@@ -10,11 +11,11 @@ from actions.utils.common_utils import check_links_in_string
|
|
10
11
|
|
11
12
|
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
12
13
|
OPENAI_MODEL = os.getenv("OPENAI_MODEL", "gpt-5-2025-08-07")
|
13
|
-
SYSTEM_PROMPT_ADDITION = """
|
14
|
-
|
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".
|
14
|
+
SYSTEM_PROMPT_ADDITION = """Guidance:
|
15
|
+
- Ultralytics Branding: Use YOLO11, YOLO26, etc., not YOLOv11, YOLOv26 (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
|
-
-
|
17
|
+
- Markdown: Reply in Markdown format.
|
18
|
+
- Links: Use descriptive anchor text for all URLs.
|
18
19
|
- Code:
|
19
20
|
- Provide minimal code examples if helpful.
|
20
21
|
- Enclose code in backticks: `pip install ultralytics` for inline code or e.g. ```python for larger code blocks.
|
@@ -34,9 +35,9 @@ def remove_outer_codeblocks(string):
|
|
34
35
|
|
35
36
|
|
36
37
|
def get_completion(
|
37
|
-
messages:
|
38
|
+
messages: list[dict[str, str]],
|
38
39
|
check_links: bool = True,
|
39
|
-
remove:
|
40
|
+
remove: list[str] = (" @giscus[bot]",), # strings to remove from response
|
40
41
|
temperature: float = 1.0, # note GPT-5 requires temperature=1.0
|
41
42
|
reasoning_effort: str = None, # reasoning effort for GPT-5 models: minimal, low, medium, high
|
42
43
|
) -> str:
|
@@ -3,6 +3,8 @@
|
|
3
3
|
# from actions.utils.version_utils import check_pypi_version
|
4
4
|
# check_pypi_version()
|
5
5
|
|
6
|
+
from __future__ import annotations
|
7
|
+
|
6
8
|
import re
|
7
9
|
from pathlib import Path
|
8
10
|
|
@@ -13,7 +15,7 @@ def should_publish(local_version, remote_version):
|
|
13
15
|
"""Determine if version should be published based on semver rules."""
|
14
16
|
if remote_version:
|
15
17
|
local_ver, remote_ver = [tuple(map(int, v.split("."))) for v in [local_version, remote_version]]
|
16
|
-
major_diff, minor_diff, patch_diff = [
|
18
|
+
major_diff, minor_diff, patch_diff = [local - remote for local, remote in zip(local_ver, remote_ver)]
|
17
19
|
return (
|
18
20
|
(major_diff == 0 and minor_diff == 0 and 0 < patch_diff <= 2) # patch diff <=2
|
19
21
|
or (major_diff == 0 and minor_diff == 1 and local_ver[2] == 0) # new minor version
|
{ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97/ultralytics_actions.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.97
|
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>
|
@@ -47,8 +47,6 @@ Welcome to the [Ultralytics Actions](https://github.com/ultralytics/actions) rep
|
|
47
47
|
[](https://github.com/ultralytics/actions/actions/workflows/ci.yml)
|
48
48
|
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
49
49
|
[](https://codecov.io/github/ultralytics/actions)
|
50
|
-
[](https://badge.fury.io/py/ultralytics-actions)
|
51
|
-
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
52
50
|
|
53
51
|
[](https://discord.com/invite/ultralytics)
|
54
52
|
[](https://community.ultralytics.com/)
|
@@ -130,6 +128,18 @@ To integrate this action into your Ultralytics repository:
|
|
130
128
|
|
131
129
|
3. **Customize:** Adjust the `runs-on` runner and the boolean flags (`labels`, `python`, `prettier`, `swift`, `spelling`, `links`, `summary`) based on your project's needs. Remember to add your `OPENAI_API_KEY` as a secret in your repository settings if you enable `labels` or `summary`.
|
132
130
|
|
131
|
+
## Python Package
|
132
|
+
|
133
|
+
Install the `ultralytics-actions` Python package directly with Pip:
|
134
|
+
|
135
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
136
|
+
[](https://clickpy.clickhouse.com/dashboard/ultralytics-actions)
|
137
|
+
[](https://pypi.org/project/ultralytics-actions/)
|
138
|
+
|
139
|
+
```sh
|
140
|
+
pip install ultralytics-actions
|
141
|
+
```
|
142
|
+
|
133
143
|
## 💡 Contribute
|
134
144
|
|
135
145
|
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
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
|
{ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/requires.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.95 → ultralytics_actions-0.0.97}/ultralytics_actions.egg-info/top_level.txt
RENAMED
File without changes
|