ultralytics-actions 0.0.44__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.44 → ultralytics_actions-0.0.45}/PKG-INFO +1 -1
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/__init__.py +1 -1
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/first_interaction.py +3 -3
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/utils/__init__.py +2 -1
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/utils/common_utils.py +30 -26
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/tests/test_urls.py +4 -1
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/PKG-INFO +1 -1
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/LICENSE +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/README.md +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/summarize_pr.py +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/summarize_release.py +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/update_markdown_code_blocks.py +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/utils/github_utils.py +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/actions/utils/openai_utils.py +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/pyproject.toml +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/setup.cfg +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/SOURCES.txt +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/entry_points.txt +0 -0
- {ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/requires.txt +0 -0
- {ultralytics_actions-0.0.44 → 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>
|
@@ -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,7 +36,7 @@ def clean_url(url):
|
|
20
36
|
return url
|
21
37
|
|
22
38
|
|
23
|
-
def is_url(url, check=True, max_attempts=3, timeout=2):
|
39
|
+
def is_url(url, session=None, check=True, max_attempts=3, timeout=2):
|
24
40
|
"""Check if string is URL and optionally verify it exists."""
|
25
41
|
allow_list = (
|
26
42
|
"localhost",
|
@@ -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,31 +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:
|
59
|
-
|
60
|
-
"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",
|
61
|
-
"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",
|
62
|
-
"Accept-Language": "en-US,en;q=0.9,es;q=0.8,zh-CN;q=0.7,zh;q=0.6",
|
63
|
-
"Accept-Encoding": "gzip, deflate, br, zstd",
|
64
|
-
"sec-ch-ua": '"Chromium";v="132", "Google Chrome";v="132", "Not_A Brand";v="99"',
|
65
|
-
"sec-ch-ua-mobile": "?0",
|
66
|
-
"sec-ch-ua-platform": '"macOS"',
|
67
|
-
"Sec-Fetch-Site": "none",
|
68
|
-
"Sec-Fetch-Mode": "navigate",
|
69
|
-
"Sec-Fetch-User": "?1",
|
70
|
-
"Sec-Fetch-Dest": "document",
|
71
|
-
"Referer": "https://www.google.com/",
|
72
|
-
"Origin": "https://www.google.com/",
|
73
|
-
}
|
72
|
+
requester = session if session else requests
|
74
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
|
+
|
75
78
|
for attempt in range(max_attempts):
|
76
79
|
try:
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
return
|
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
|
82
85
|
except Exception:
|
83
86
|
if attempt == max_attempts - 1: # last attempt
|
84
87
|
return False
|
@@ -111,8 +114,9 @@ def check_links_in_string(text, verbose=True, return_bad=False):
|
|
111
114
|
|
112
115
|
urls = set(map(clean_url, all_urls)) # remove extra characters and make unique
|
113
116
|
# bad_urls = [x for x in urls if not is_url(x, check=True)] # single-thread
|
114
|
-
with ThreadPoolExecutor(max_workers=16) as executor:
|
115
|
-
|
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]
|
116
120
|
|
117
121
|
passing = not bad_urls
|
118
122
|
if verbose and not passing:
|
@@ -20,6 +20,9 @@ URLS = [
|
|
20
20
|
"https://www.kdnuggets.com/",
|
21
21
|
"https://www.datacamp.com/tutorial/understanding-logistic-regression-python",
|
22
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",
|
23
26
|
]
|
24
27
|
|
25
28
|
|
@@ -53,7 +56,7 @@ def test_markdown_links(verbose):
|
|
53
56
|
|
54
57
|
def test_mixed_formats(verbose):
|
55
58
|
"""Tests URL detection in mixed text formats (HTML, Markdown, plain text) using check_links_in_string."""
|
56
|
-
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"
|
57
60
|
result, urls = check_links_in_string(text, return_bad=True)
|
58
61
|
assert result is False
|
59
62
|
assert set(urls) == {"https://1.com", "https://3.net"}
|
{ultralytics_actions-0.0.44 → 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.44 → 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.44 → 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.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/requires.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.44 → ultralytics_actions-0.0.45}/ultralytics_actions.egg-info/top_level.txt
RENAMED
File without changes
|