ultralytics-actions 0.0.34__py3-none-any.whl → 0.0.36__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.34"
25
+ __version__ = "0.0.36"
@@ -1,10 +1,11 @@
1
1
  # Ultralytics Actions 🚀, AGPL-3.0 license https://ultralytics.com/license
2
2
 
3
3
  import re
4
- import socket
5
4
  import time
6
- import urllib
7
5
  from concurrent.futures import ThreadPoolExecutor
6
+ from urllib import parse
7
+
8
+ import requests
8
9
 
9
10
 
10
11
  def remove_html_comments(body: str) -> str:
@@ -37,6 +38,10 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
37
38
  "github.com", # ignore GitHub links that may be private repos
38
39
  "kaggle.com", # blocks automated header requests
39
40
  "reddit.com", # blocks automated header requests
41
+ "linkedin.com",
42
+ "twitter.com",
43
+ "x.com",
44
+ "storage.googleapis.com", # private GCS buckets
40
45
  )
41
46
  try:
42
47
  # Check allow list
@@ -44,7 +49,7 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
44
49
  return True
45
50
 
46
51
  # Check structure
47
- result = urllib.parse.urlparse(url)
52
+ result = parse.urlparse(url)
48
53
  if not all([result.scheme, result.netloc]):
49
54
  return False
50
55
 
@@ -52,16 +57,14 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
52
57
  if check:
53
58
  for attempt in range(max_attempts):
54
59
  try:
55
- req = urllib.request.Request(
56
- url,
57
- method="HEAD",
58
- headers={
59
- "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",
60
- },
61
- )
62
- with urllib.request.urlopen(req, timeout=timeout) as response:
63
- return response.getcode() < 400
64
- except (urllib.error.URLError, socket.timeout):
60
+ headers = {
61
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/120.0.0.0",
62
+ "Accept": "*",
63
+ "Accept-Language": "*",
64
+ "Accept-Encoding": "*",
65
+ }
66
+ return requests.head(url, headers=headers, timeout=timeout, allow_redirects=True).status_code < 400
67
+ except Exception:
65
68
  if attempt == max_attempts - 1: # last attempt
66
69
  return False
67
70
  time.sleep(2**attempt) # exponential backoff
@@ -84,13 +87,15 @@ def check_links_in_string(text, verbose=True, return_bad=False):
84
87
  r"(?:/[^\s\"')\]]*)?" # Optional path
85
88
  r")"
86
89
  )
90
+ # all_urls.extend([url for url in match if url and parse.urlparse(url).scheme])
87
91
  all_urls = []
88
92
  for md_text, md_url, plain_url in re.findall(pattern, text):
89
93
  url = md_url or plain_url
90
- if url and urllib.parse.urlparse(url).scheme:
94
+ if url and parse.urlparse(url).scheme:
91
95
  all_urls.append(url)
92
96
 
93
97
  urls = set(map(clean_url, all_urls)) # remove extra characters and make unique
98
+ # bad_urls = [x for x in urls if not is_url(x, check=True)] # single-thread
94
99
  with ThreadPoolExecutor(max_workers=16) as executor: # multi-thread
95
100
  bad_urls = [url for url, valid in zip(urls, executor.map(lambda x: not is_url(x, check=True), urls)) if valid]
96
101
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics-actions
3
- Version: 0.0.34
3
+ Version: 0.0.36
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>
@@ -28,12 +28,11 @@ Classifier: Operating System :: OS Independent
28
28
  Requires-Python: >=3.8
29
29
  Description-Content-Type: text/markdown
30
30
  License-File: LICENSE
31
- Requires-Dist: requests>=2.26.0
32
- Requires-Dist: ruff>=0.1.6
31
+ Requires-Dist: requests>=2.32.3
32
+ Requires-Dist: ruff>=0.8.4
33
33
  Requires-Dist: docformatter>=1.7.5
34
34
  Provides-Extra: dev
35
35
  Requires-Dist: pytest; extra == "dev"
36
- Requires-Dist: black; extra == "dev"
37
36
 
38
37
  <a href="https://www.ultralytics.com/" target="_blank"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
39
38
 
@@ -1,15 +1,15 @@
1
- actions/__init__.py,sha256=GtlE-ku_TTk_fBoKBzCennk6SAk2-Cju6XccN_3qlVI,749
1
+ actions/__init__.py,sha256=6HSEr5TtfbTe7XlYxlXaAbkcw0hvzobTx2m0qzJghIw,749
2
2
  actions/first_interaction.py,sha256=MCjDdpc4TgdeB1IWIdkFvXuvkolySBehdBRm1nPPAgo,17707
3
3
  actions/summarize_pr.py,sha256=Uq5TswlNZuxn7HenU8KhWr3z3m496_THWsW1zlYKQvU,11173
4
4
  actions/summarize_release.py,sha256=eEah_BkvdHaFsR1Nxx-WbiOC_xmoXfzQpfwQS0cGJqc,8462
5
5
  actions/update_markdown_code_blocks.py,sha256=WBNcMD_KKsZS-qSPBn6O1G0ggQ_VrT-jTQffbg7xH_M,6369
6
6
  actions/utils/__init__.py,sha256=W82wrlyOAlIPDOtJkgSKjJVXn6QMAoa43gEI0-aWkjs,441
7
- actions/utils/common_utils.py,sha256=XT8GG0SWBtlZLruA0nKrY4AJpkitvPbM8zndE8etuDo,3548
7
+ actions/utils/common_utils.py,sha256=rVF3Vi4c7Q8oZnlXu67wlyftUT0Y_HXTkUlZHGOuv8Y,3716
8
8
  actions/utils/github_utils.py,sha256=42w9iHRayI275T7PqJaWpDSPCgDADhrbpnoVarT5ERs,6907
9
9
  actions/utils/openai_utils.py,sha256=CU0FdeUW6qeZsxYCC2NUcGjns7w6hDvT8PwaRlG7j9E,1829
10
- ultralytics_actions-0.0.34.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- ultralytics_actions-0.0.34.dist-info/METADATA,sha256=IRDqEbAx1A8IaHxuGzP7SHRQOAiu3WAsptNL7QuPH8I,10591
12
- ultralytics_actions-0.0.34.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
- ultralytics_actions-0.0.34.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
- ultralytics_actions-0.0.34.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
- ultralytics_actions-0.0.34.dist-info/RECORD,,
10
+ ultralytics_actions-0.0.36.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ ultralytics_actions-0.0.36.dist-info/METADATA,sha256=LUcJbOdrU1FNfBsLPgdmS0UlOsoySnz2OzRxo-wribE,10554
12
+ ultralytics_actions-0.0.36.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
+ ultralytics_actions-0.0.36.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
+ ultralytics_actions-0.0.36.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
+ ultralytics_actions-0.0.36.dist-info/RECORD,,