ultralytics-actions 0.0.67__py3-none-any.whl → 0.0.68__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 CHANGED
@@ -22,4 +22,4 @@
22
22
  # ├── test_summarize_pr.py
23
23
  # └── ...
24
24
 
25
- __version__ = "0.0.67"
25
+ __version__ = "0.0.68"
actions/utils/__init__.py CHANGED
@@ -1,6 +1,13 @@
1
1
  # Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license
2
2
 
3
- from .common_utils import REDIRECT_IGNORE_LIST, REQUESTS_HEADERS, URL_IGNORE_LIST, remove_html_comments
3
+ from .common_utils import (
4
+ REDIRECT_END_IGNORE_LIST,
5
+ REDIRECT_START_IGNORE_LIST,
6
+ REQUESTS_HEADERS,
7
+ URL_IGNORE_LIST,
8
+ allow_redirect,
9
+ remove_html_comments,
10
+ )
4
11
  from .github_utils import GITHUB_API_URL, Action, check_pypi_version, ultralytics_actions_info
5
12
  from .openai_utils import get_completion
6
13
 
@@ -8,8 +15,10 @@ __all__ = (
8
15
  "GITHUB_API_URL",
9
16
  "REQUESTS_HEADERS",
10
17
  "URL_IGNORE_LIST",
11
- "REDIRECT_IGNORE_LIST",
18
+ "REDIRECT_START_IGNORE_LIST",
19
+ "REDIRECT_END_IGNORE_LIST",
12
20
  "Action",
21
+ "allow_redirect",
13
22
  "check_pypi_version",
14
23
  "get_completion",
15
24
  "remove_html_comments",
@@ -57,10 +57,24 @@ URL_IGNORE_LIST = { # use a set (not frozenset) to update with possible private
57
57
  "(", # breaks pattern matches
58
58
  "api.", # ignore api endpoints
59
59
  }
60
- REDIRECT_IGNORE_LIST = frozenset(
60
+ REDIRECT_START_IGNORE_LIST = frozenset(
61
61
  {
62
62
  "{", # possible f-string
63
63
  "}", # possible f-string
64
+ "https://youtu.be",
65
+ "bit.ly",
66
+ "ow.ly",
67
+ "shields.io",
68
+ "badge",
69
+ "ultralytics.com/actions",
70
+ "ultralytics.com/bilibili",
71
+ "ultralytics.com/images",
72
+ "app.gong.io/call?",
73
+ "docs.openvino.ai",
74
+ }
75
+ )
76
+ REDIRECT_END_IGNORE_LIST = frozenset(
77
+ {
64
78
  "/es/",
65
79
  "/us/",
66
80
  "en-us",
@@ -76,20 +90,11 @@ REDIRECT_IGNORE_LIST = frozenset(
76
90
  "login",
77
91
  "consent",
78
92
  "verify",
79
- "badge",
80
- "shields.io",
81
- "bit.ly",
82
- "ow.ly",
83
- "https://youtu.be/",
84
93
  "latex.codecogs.com",
85
94
  "svg.image",
86
95
  "?view=azureml",
87
96
  "?utm_",
88
97
  "redirect",
89
- "ultralytics.com/actions",
90
- "ultralytics.com/bilibili",
91
- "ultralytics.com/images",
92
- "app.gong.io/call?",
93
98
  "https://code.visualstudio.com/", # errors
94
99
  "?rdt=", # problems with reddit redirecting to https://www.reddit.com/r/ultralytics/?rdt=48616
95
100
  "objects.githubusercontent.com", # Prevent replacement with temporary signed GitHub asset URLs
@@ -120,10 +125,16 @@ def clean_url(url):
120
125
  return url
121
126
 
122
127
 
123
- def allow_redirect(url):
128
+ def allow_redirect(start="", end=""):
124
129
  """Check if URL should be skipped based on simple rules."""
125
- url_lower = url.lower()
126
- return url and url.startswith("https://") and not any(item in url_lower for item in REDIRECT_IGNORE_LIST)
130
+ start_lower = start.lower()
131
+ end_lower = end.lower()
132
+ return (
133
+ end
134
+ and end.startswith("https://")
135
+ and not any(item in end_lower for item in REDIRECT_END_IGNORE_LIST)
136
+ and not any(item in start_lower for item in REDIRECT_START_IGNORE_LIST)
137
+ )
127
138
 
128
139
 
129
140
  def brave_search(query, api_key, count=5):
@@ -164,7 +175,7 @@ def is_url(url, session=None, check=True, max_attempts=3, timeout=3, return_url=
164
175
  # Try HEAD first, then GET if needed
165
176
  for method in (requester.head, requester.get):
166
177
  response = method(url, stream=method == requester.get, **kwargs)
167
- if redirect and allow_redirect(response.url):
178
+ if redirect and allow_redirect(start=url, end=response.url):
168
179
  url = response.url
169
180
  if response.status_code not in BAD_HTTP_CODES:
170
181
  return (True, url) if return_url else True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ultralytics-actions
3
- Version: 0.0.67
3
+ Version: 0.0.68
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>
@@ -1,15 +1,15 @@
1
- actions/__init__.py,sha256=YkxqhvItOspqmgAGHOpRxSY9A4iCKpN5l6_JYyEjSUM,742
1
+ actions/__init__.py,sha256=JRXgdKfSoTN4UJEHO2P9prHZYIHPLBQo9hbiRD1WC20,742
2
2
  actions/first_interaction.py,sha256=1_WvQHCi5RWaSfyi49ClF2Zk_3CKGjFnZqz6FlxPRAc,17868
3
3
  actions/summarize_pr.py,sha256=BKttOq-MGaanVaChLU5B1ewKUA8K6S05Cy3FQtyRmxU,11681
4
4
  actions/summarize_release.py,sha256=tov6qsYGC68lfobvkwVyoWZBGtJ598G0m097n4Ydzvo,8472
5
5
  actions/update_markdown_code_blocks.py,sha256=9PL7YIQfApRNAa0que2hYHv7umGZTZoHlblesB0xFj4,8587
6
- actions/utils/__init__.py,sha256=XjFyREuhiA7pHfHHBQQqHYKokHhq_px1P9sezk_f1vA,545
7
- actions/utils/common_utils.py,sha256=tJ0yZl5t_u3BykTdG8F3m4WcypR6uzfGwxPKCgR1wIU,10752
6
+ actions/utils/__init__.py,sha256=ZE0RmC9qOCt9TUhvORd6uVhbxOKVFWJDobR454v55_M,682
7
+ actions/utils/common_utils.py,sha256=YRdEz8qluwzCZfWgqXNmyhKqNhdxNMpoHhGaHUD4AaM,11013
8
8
  actions/utils/github_utils.py,sha256=-F--JgxtXE0fSPMFEzakz7iZilp-vonzLiyXfg0b17Y,7117
9
9
  actions/utils/openai_utils.py,sha256=qQbmrJpOUANxSMf7inDSgPIwgf0JHD1fWZuab-y2W6g,2942
10
- ultralytics_actions-0.0.67.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- ultralytics_actions-0.0.67.dist-info/METADATA,sha256=lonA_wg0YB7kD5yMgTgCRsK2mMjLb3Dx0t1cQQ6WzFw,10923
12
- ultralytics_actions-0.0.67.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
- ultralytics_actions-0.0.67.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
- ultralytics_actions-0.0.67.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
- ultralytics_actions-0.0.67.dist-info/RECORD,,
10
+ ultralytics_actions-0.0.68.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ ultralytics_actions-0.0.68.dist-info/METADATA,sha256=CpcyV3LeuvtCpvOAzycM_EwA3Gsnq190EPQQuTZ3vUw,10923
12
+ ultralytics_actions-0.0.68.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
13
+ ultralytics_actions-0.0.68.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
+ ultralytics_actions-0.0.68.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
+ ultralytics_actions-0.0.68.dist-info/RECORD,,