ultralytics-actions 0.0.36__py3-none-any.whl → 0.0.38__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.36"
25
+ __version__ = "0.0.38"
@@ -50,7 +50,8 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
50
50
 
51
51
  # Check structure
52
52
  result = parse.urlparse(url)
53
- if not all([result.scheme, result.netloc]):
53
+ partition = result.netloc.partition(".") # i.e. netloc = "github.com" -> ("github", ".", "com")
54
+ if not result.scheme or not partition[0] or not partition[2]:
54
55
  return False
55
56
 
56
57
  # Check response
@@ -58,10 +59,10 @@ def is_url(url, check=True, max_attempts=3, timeout=2):
58
59
  for attempt in range(max_attempts):
59
60
  try:
60
61
  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": "*",
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
65
66
  }
66
67
  return requests.head(url, headers=headers, timeout=timeout, allow_redirects=True).status_code < 400
67
68
  except Exception:
@@ -82,7 +83,7 @@ def check_links_in_string(text, verbose=True, return_bad=False):
82
83
  r"(" # Start capturing group for plaintext URLs
83
84
  r"(?:https?://)?" # Optional http:// or https://
84
85
  r"(?:www\.)?" # Optional www.
85
- r"[\w.-]+" # Domain name and subdomains
86
+ r"(?:[\w.-]+)?" # Optional domain name and subdomains
86
87
  r"\.[a-zA-Z]{2,}" # TLD
87
88
  r"(?:/[^\s\"')\]]*)?" # Optional path
88
89
  r")"
@@ -104,3 +105,7 @@ def check_links_in_string(text, verbose=True, return_bad=False):
104
105
  print(f"WARNING ⚠️ errors found in URLs {bad_urls}")
105
106
 
106
107
  return (passing, bad_urls) if return_bad else passing
108
+
109
+
110
+ if __name__ == "__main__":
111
+ print(is_url("https://ultralytics.com/images/bus.jpg"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ultralytics-actions
3
- Version: 0.0.36
3
+ Version: 0.0.38
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>
@@ -99,7 +99,7 @@ To use this action in your Ultralytics repository:
99
99
  labels: true # autolabel issues and PRs
100
100
  python: true # format Python code and docstrings
101
101
  prettier: true # format YAML, JSON, Markdown and CSS
102
- swift: true # format Swift code (requires 'macos-latest')
102
+ swift: true # format Swift code (requires 'macos-latest' runner)
103
103
  spelling: true # check spelling
104
104
  links: true # check broken links
105
105
  summary: true # print PR summary with GPT4o (requires 'openai_api_key')
@@ -1,15 +1,15 @@
1
- actions/__init__.py,sha256=6HSEr5TtfbTe7XlYxlXaAbkcw0hvzobTx2m0qzJghIw,749
1
+ actions/__init__.py,sha256=5yvKNTDxSTb_QhQHYiYOlUEwdpeezCgp2UGhe4QdNcw,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=rVF3Vi4c7Q8oZnlXu67wlyftUT0Y_HXTkUlZHGOuv8Y,3716
7
+ actions/utils/common_utils.py,sha256=wnpp541-toZU0CSxihXyk7WSbGI_s5j3TRFOlb-OSEI,4093
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.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,,
10
+ ultralytics_actions-0.0.38.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ ultralytics_actions-0.0.38.dist-info/METADATA,sha256=FYnDhUxm6lUvhFsb9xuo4bwFaaEPNFglt6jkYlMPE98,10561
12
+ ultralytics_actions-0.0.38.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
13
+ ultralytics_actions-0.0.38.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
14
+ ultralytics_actions-0.0.38.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
15
+ ultralytics_actions-0.0.38.dist-info/RECORD,,