ultralytics-actions 0.0.43__tar.gz → 0.0.45__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.43 → ultralytics_actions-0.0.45}/PKG-INFO +1 -1
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/__init__.py +1 -1
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/first_interaction.py +6 -6
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/utils/__init__.py +2 -1
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/utils/common_utils.py +32 -14
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/tests/test_urls.py +16 -6
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/PKG-INFO +1 -1
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/LICENSE +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/README.md +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/summarize_pr.py +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/summarize_release.py +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/update_markdown_code_blocks.py +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/utils/github_utils.py +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/utils/openai_utils.py +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/pyproject.toml +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/setup.cfg +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/SOURCES.txt +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/entry_points.txt +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/requires.txt +0 -0
- {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.45
|
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,8 @@ def update_issue_pr_content(event, number: int, node_id: str, issue_type: str):
|
|
47
47
|
new_title = "Content Under Review"
|
48
48
|
new_body = """This post has been flagged for review by [Ultralytics Actions](https://ultralytics.com/actions) due to possible spam, abuse, or off-topic content. For more information please see our:
|
49
49
|
|
50
|
-
- [Code of Conduct](https://docs.ultralytics.com/help/
|
51
|
-
- [Security Policy](https://docs.ultralytics.com/help/security)
|
50
|
+
- [Code of Conduct](https://docs.ultralytics.com/help/code-of-conduct/)
|
51
|
+
- [Security Policy](https://docs.ultralytics.com/help/security/)
|
52
52
|
|
53
53
|
For questions or bug reports related to this action please visit https://github.com/ultralytics/actions.
|
54
54
|
|
@@ -285,7 +285,7 @@ def get_first_interaction_response(event, issue_type: str, title: str, body: str
|
|
285
285
|
|
286
286
|
1. For bug reports:
|
287
287
|
- A clear and concise description of the bug
|
288
|
-
- A minimum reproducible example (
|
288
|
+
- A minimum reproducible example [MRE](https://docs.ultralytics.com/help/minimum-reproducible-example/) that demonstrates the issue
|
289
289
|
- Your environment details (OS, Python version, package versions)
|
290
290
|
- Expected behavior vs. actual behavior
|
291
291
|
- Any error messages or logs related to the issue
|
@@ -298,7 +298,7 @@ def get_first_interaction_response(event, issue_type: str, title: str, body: str
|
|
298
298
|
3. For questions:
|
299
299
|
- Provide as much context as possible about your question
|
300
300
|
- Include any research you've already done on the topic
|
301
|
-
- Specify which parts of the [documentation](https://docs.ultralytics.com), if any, you've already consulted
|
301
|
+
- Specify which parts of the [documentation](https://docs.ultralytics.com/), if any, you've already consulted
|
302
302
|
|
303
303
|
Please make sure you've searched existing {issue_type}s to avoid duplicates. If you need to add any additional information, please comment on this {issue_type}.
|
304
304
|
|
@@ -311,12 +311,12 @@ Thank you for your contribution to improving our project!
|
|
311
311
|
- ✅ **Define a Purpose**: Clearly explain the purpose of your fix or feature in your PR description, and link to any [relevant issues](https://github.com/{event.repository}/issues). Ensure your commit messages are clear, concise, and adhere to the project's conventions.
|
312
312
|
- ✅ **Synchronize with Source**: Confirm your PR is synchronized with the `{event.repository}` `main` branch. If it's behind, update it by clicking the 'Update branch' button or by running `git pull` and `git merge main` locally.
|
313
313
|
- ✅ **Ensure CI Checks Pass**: Verify all Ultralytics [Continuous Integration (CI)](https://docs.ultralytics.com/help/CI/) checks are passing. If any checks fail, please address the issues.
|
314
|
-
- ✅ **Update Documentation**: Update the relevant [documentation](https://docs.ultralytics.com) for any new or modified features.
|
314
|
+
- ✅ **Update Documentation**: Update the relevant [documentation](https://docs.ultralytics.com/) for any new or modified features.
|
315
315
|
- ✅ **Add Tests**: If applicable, include or update tests to cover your changes, and confirm that all tests are passing.
|
316
316
|
- ✅ **Sign the CLA**: Please ensure you have signed our [Contributor License Agreement](https://docs.ultralytics.com/help/CLA/) if this is your first Ultralytics PR by writing "I have read the CLA Document and I sign the CLA" in a new message.
|
317
317
|
- ✅ **Minimize Changes**: Limit your changes to the **minimum** necessary for your bug fix or feature addition. _"It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is."_ — Bruce Lee
|
318
318
|
|
319
|
-
For more guidance, please refer to our [Contributing Guide](https://docs.ultralytics.com/help/contributing). Don’t hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀
|
319
|
+
For more guidance, please refer to our [Contributing Guide](https://docs.ultralytics.com/help/contributing/). Don’t hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀
|
320
320
|
"""
|
321
321
|
|
322
322
|
if issue_type == "pull request":
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
|
2
2
|
|
3
|
-
from .common_utils import remove_html_comments
|
3
|
+
from .common_utils import REQUESTS_HEADERS, remove_html_comments
|
4
4
|
from .github_utils import (
|
5
5
|
GITHUB_API_URL,
|
6
6
|
Action,
|
@@ -11,6 +11,7 @@ from .openai_utils import get_completion
|
|
11
11
|
|
12
12
|
__all__ = (
|
13
13
|
"GITHUB_API_URL",
|
14
|
+
"REQUESTS_HEADERS",
|
14
15
|
"Action",
|
15
16
|
"check_pypi_version",
|
16
17
|
"get_completion",
|
@@ -7,6 +7,22 @@ from urllib import parse
|
|
7
7
|
|
8
8
|
import requests
|
9
9
|
|
10
|
+
REQUESTS_HEADERS = {
|
11
|
+
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36",
|
12
|
+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
|
13
|
+
"Accept-Language": "en-US,en;q=0.9,es;q=0.8,zh-CN;q=0.7,zh;q=0.6",
|
14
|
+
"Accept-Encoding": "gzip, deflate, br, zstd",
|
15
|
+
"sec-ch-ua": '"Chromium";v="132", "Google Chrome";v="132", "Not_A Brand";v="99"',
|
16
|
+
"sec-ch-ua-mobile": "?0",
|
17
|
+
"sec-ch-ua-platform": '"macOS"',
|
18
|
+
"Sec-Fetch-Site": "none",
|
19
|
+
"Sec-Fetch-Mode": "navigate",
|
20
|
+
"Sec-Fetch-User": "?1",
|
21
|
+
"Sec-Fetch-Dest": "document",
|
22
|
+
"Referer": "https://www.google.com/",
|
23
|
+
"Origin": "https://www.google.com/",
|
24
|
+
}
|
25
|
+
|
10
26
|
|
11
27
|
def remove_html_comments(body: str) -> str:
|
12
28
|
"""Removes HTML comments from a string using regex pattern matching."""
|
@@ -20,8 +36,8 @@ def clean_url(url):
|
|
20
36
|
return url
|
21
37
|
|
22
38
|
|
23
|
-
def is_url(url, check=True, max_attempts=3, timeout=2):
|
24
|
-
"""Check if string is URL and
|
39
|
+
def is_url(url, session=None, check=True, max_attempts=3, timeout=2):
|
40
|
+
"""Check if string is URL and optionally verify it exists."""
|
25
41
|
allow_list = (
|
26
42
|
"localhost",
|
27
43
|
"127.0.0",
|
@@ -36,8 +52,6 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
|
|
36
52
|
"example",
|
37
53
|
"mailto:",
|
38
54
|
"github.com", # ignore GitHub links that may be private repos
|
39
|
-
"kaggle.com", # blocks automated header requests
|
40
|
-
"reddit.com", # blocks automated header requests
|
41
55
|
"linkedin.com",
|
42
56
|
"twitter.com",
|
43
57
|
"x.com",
|
@@ -54,17 +68,20 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
|
|
54
68
|
if not result.scheme or not partition[0] or not partition[2]:
|
55
69
|
return False
|
56
70
|
|
57
|
-
# Check response
|
58
71
|
if check:
|
72
|
+
requester = session if session else requests
|
73
|
+
bad_codes = {404, 410, 500, 502, 503, 504}
|
74
|
+
kwargs = {"timeout": timeout, "allow_redirects": True}
|
75
|
+
if not session:
|
76
|
+
kwargs["headers"] = REQUESTS_HEADERS
|
77
|
+
|
59
78
|
for attempt in range(max_attempts):
|
60
79
|
try:
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
}
|
67
|
-
return requests.head(url, headers=headers, timeout=timeout, allow_redirects=True).status_code < 400
|
80
|
+
# Try HEAD first, then GET if needed
|
81
|
+
for method in (requester.head, requester.get):
|
82
|
+
if method(url, stream=method == requester.get, **kwargs).status_code not in bad_codes:
|
83
|
+
return True
|
84
|
+
return False
|
68
85
|
except Exception:
|
69
86
|
if attempt == max_attempts - 1: # last attempt
|
70
87
|
return False
|
@@ -97,8 +114,9 @@ def check_links_in_string(text, verbose=True, return_bad=False):
|
|
97
114
|
|
98
115
|
urls = set(map(clean_url, all_urls)) # remove extra characters and make unique
|
99
116
|
# bad_urls = [x for x in urls if not is_url(x, check=True)] # single-thread
|
100
|
-
with ThreadPoolExecutor(max_workers=16) as executor:
|
101
|
-
|
117
|
+
with requests.Session() as session, ThreadPoolExecutor(max_workers=16) as executor:
|
118
|
+
session.headers.update(REQUESTS_HEADERS)
|
119
|
+
bad_urls = [url for url, valid in zip(urls, executor.map(lambda x: not is_url(x, session), urls)) if valid]
|
102
120
|
|
103
121
|
passing = not bad_urls
|
104
122
|
if verbose and not passing:
|
@@ -7,12 +7,22 @@ import pytest
|
|
7
7
|
from actions.utils.common_utils import check_links_in_string, is_url
|
8
8
|
|
9
9
|
URLS = [
|
10
|
-
"https://docs.ultralytics.com/help/CLA/",
|
11
10
|
"https://docs.ultralytics.com/help/contributing",
|
12
|
-
"https://docs.ultralytics.com",
|
13
11
|
"https://ultralytics.com",
|
14
12
|
"https://ultralytics.com/images/bus.jpg",
|
15
13
|
"https://github.com/ultralytics/ultralytics",
|
14
|
+
"https://azure.microsoft.com/",
|
15
|
+
"https://www.tableau.com/",
|
16
|
+
"https://openai.com/research/gpt-4",
|
17
|
+
"https://azure.microsoft.com/en-us/services/machine-learning/",
|
18
|
+
"https://azure.microsoft.com/en-us/products/storage/blobs",
|
19
|
+
"https://www.reuters.com/article/idUSKCN1MK08G/",
|
20
|
+
"https://www.kdnuggets.com/",
|
21
|
+
"https://www.datacamp.com/tutorial/understanding-logistic-regression-python",
|
22
|
+
"https://www.statisticshowto.com/probability-and-statistics/find-outliers/",
|
23
|
+
"https://www.reddit.com/r/Ultralytics/comments/1fw3605/release_megathread/",
|
24
|
+
"https://www.kaggle.com/models/ultralytics/yolo11",
|
25
|
+
"https://apps.apple.com/xk/app/ultralytics/id1583935240",
|
16
26
|
]
|
17
27
|
|
18
28
|
|
@@ -37,7 +47,7 @@ def test_html_links(verbose):
|
|
37
47
|
|
38
48
|
|
39
49
|
def test_markdown_links(verbose):
|
40
|
-
"""Validates URLs in
|
50
|
+
"""Validates URLs in Markdown links within a given text using check_links_in_string."""
|
41
51
|
text = "Check [Example](https://err.com) or [Test](http://test.org)"
|
42
52
|
result, urls = check_links_in_string(text, verbose, return_bad=True)
|
43
53
|
assert result is False
|
@@ -46,10 +56,10 @@ def test_markdown_links(verbose):
|
|
46
56
|
|
47
57
|
def test_mixed_formats(verbose):
|
48
58
|
"""Tests URL detection in mixed text formats (HTML, Markdown, plain text) using check_links_in_string."""
|
49
|
-
text = "A <a href='https://1.com'>link</a> and [markdown](https://2.org) and https://3.net"
|
59
|
+
text = "A <a href='https://1.com'>link</a> and [markdown](https://2.org/) and https://3.net"
|
50
60
|
result, urls = check_links_in_string(text, return_bad=True)
|
51
61
|
assert result is False
|
52
|
-
assert set(urls) == {"https://1.com", "https://
|
62
|
+
assert set(urls) == {"https://1.com", "https://3.net"}
|
53
63
|
|
54
64
|
|
55
65
|
def test_duplicate_urls(verbose):
|
@@ -89,7 +99,7 @@ def test_urls_with_different_tlds(verbose):
|
|
89
99
|
text = "Different TLDs: https://err.ml https://err.org https://err.net https://err.io https://err.ai"
|
90
100
|
result, urls = check_links_in_string(text, verbose, return_bad=True)
|
91
101
|
assert result is False
|
92
|
-
assert set(urls) == {"https://err.ml", "https://err.
|
102
|
+
assert set(urls) == {"https://err.ml", "https://err.io", "https://err.ai"}
|
93
103
|
|
94
104
|
|
95
105
|
def test_case_sensitivity(verbose):
|
{ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.45
|
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>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/actions/update_markdown_code_blocks.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/requires.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.43 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/top_level.txt
RENAMED
File without changes
|