ultralytics-actions 0.0.43__tar.gz → 0.0.44__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.
Files changed (21) hide show
  1. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/PKG-INFO +1 -1
  2. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/__init__.py +1 -1
  3. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/first_interaction.py +3 -3
  4. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/utils/common_utils.py +22 -8
  5. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/tests/test_urls.py +12 -5
  6. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/PKG-INFO +1 -1
  7. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/LICENSE +0 -0
  8. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/README.md +0 -0
  9. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/summarize_pr.py +0 -0
  10. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/summarize_release.py +0 -0
  11. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/update_markdown_code_blocks.py +0 -0
  12. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/utils/__init__.py +0 -0
  13. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/utils/github_utils.py +0 -0
  14. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/actions/utils/openai_utils.py +0 -0
  15. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/pyproject.toml +0 -0
  16. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/setup.cfg +0 -0
  17. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/SOURCES.txt +0 -0
  18. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/dependency_links.txt +0 -0
  19. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/entry_points.txt +0 -0
  20. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/ultralytics_actions.egg-info/requires.txt +0 -0
  21. {ultralytics_actions-0.0.43 → ultralytics_actions-0.0.44}/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.43
3
+ Version: 0.0.44
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>
@@ -22,4 +22,4 @@
22
22
  # ├── test_summarize_pr.py
23
23
  # └── ...
24
24
 
25
- __version__ = "0.0.43"
25
+ __version__ = "0.0.44"
@@ -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/code_of_conduct)
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 (MRE)[https://docs.ultralytics.com/help/minimum_reproducible_example/] that demonstrates the issue
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
@@ -21,7 +21,7 @@ def clean_url(url):
21
21
 
22
22
 
23
23
  def is_url(url, check=True, max_attempts=3, timeout=2):
24
- """Check if string is URL and check if URL exists."""
24
+ """Check if string is URL and optionally verify it exists."""
25
25
  allow_list = (
26
26
  "localhost",
27
27
  "127.0.0",
@@ -56,15 +56,29 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
56
56
 
57
57
  # Check response
58
58
  if check:
59
+ headers = {
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
+ }
74
+ bad_codes = {404, 410, 500, 502, 503, 504}
59
75
  for attempt in range(max_attempts):
60
76
  try:
61
- headers = {
62
- "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
63
- "Accept": "*/*", # Wildcard for maximum compatibility
64
- "Accept-Language": "*", # Wildcard for any language
65
- "Accept-Encoding": "*", # Wildcard for any encoding
66
- }
67
- return requests.head(url, headers=headers, timeout=timeout, allow_redirects=True).status_code < 400
77
+ response = requests.head(url, headers=headers, timeout=timeout, allow_redirects=True)
78
+ if response.status_code not in bad_codes:
79
+ return True
80
+ response = requests.get(url, headers=headers, timeout=timeout, allow_redirects=True, stream=True)
81
+ return response.status_code not in bad_codes # Try GET if HEAD fails
68
82
  except Exception:
69
83
  if attempt == max_attempts - 1: # last attempt
70
84
  return False
@@ -7,12 +7,19 @@ 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/",
16
23
  ]
17
24
 
18
25
 
@@ -37,7 +44,7 @@ def test_html_links(verbose):
37
44
 
38
45
 
39
46
  def test_markdown_links(verbose):
40
- """Validates URLs in markdown links within a given text using check_links_in_string."""
47
+ """Validates URLs in Markdown links within a given text using check_links_in_string."""
41
48
  text = "Check [Example](https://err.com) or [Test](http://test.org)"
42
49
  result, urls = check_links_in_string(text, verbose, return_bad=True)
43
50
  assert result is False
@@ -49,7 +56,7 @@ def test_mixed_formats(verbose):
49
56
  text = "A <a href='https://1.com'>link</a> and [markdown](https://2.org) and https://3.net"
50
57
  result, urls = check_links_in_string(text, return_bad=True)
51
58
  assert result is False
52
- assert set(urls) == {"https://1.com", "https://2.org", "https://3.net"}
59
+ assert set(urls) == {"https://1.com", "https://3.net"}
53
60
 
54
61
 
55
62
  def test_duplicate_urls(verbose):
@@ -89,7 +96,7 @@ def test_urls_with_different_tlds(verbose):
89
96
  text = "Different TLDs: https://err.ml https://err.org https://err.net https://err.io https://err.ai"
90
97
  result, urls = check_links_in_string(text, verbose, return_bad=True)
91
98
  assert result is False
92
- assert set(urls) == {"https://err.ml", "https://err.org", "https://err.net", "https://err.io", "https://err.ai"}
99
+ assert set(urls) == {"https://err.ml", "https://err.io", "https://err.ai"}
93
100
 
94
101
 
95
102
  def test_case_sensitivity(verbose):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ultralytics-actions
3
- Version: 0.0.43
3
+ Version: 0.0.44
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>