ultralytics-actions 0.0.74__py3-none-any.whl → 0.0.75__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 +1 -1
- actions/update_file_headers.py +63 -65
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/METADATA +1 -1
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/RECORD +8 -8
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/WHEEL +0 -0
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/entry_points.txt +0 -0
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/licenses/LICENSE +0 -0
- {ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/top_level.txt +0 -0
actions/__init__.py
CHANGED
actions/update_file_headers.py
CHANGED
@@ -83,72 +83,70 @@ def update_file(file_path, prefix, block_start, block_end, base_header):
|
|
83
83
|
else:
|
84
84
|
formatted_header = f"# {base_header}\n"
|
85
85
|
|
86
|
-
#
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
if
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
if second_line == "" or second_line in ["#", "//", "/*", "*", "<!--", "%"]:
|
122
|
-
# Keep existing blank/comment line
|
123
|
-
new_lines.append(remaining_lines[1])
|
124
|
-
new_lines.extend(remaining_lines[2:])
|
125
|
-
else:
|
126
|
-
# Add blank line
|
127
|
-
new_lines.append("\n")
|
128
|
-
new_lines.extend(remaining_lines[1:])
|
129
|
-
else:
|
130
|
-
# Only header line, no need for blank line after
|
131
|
-
pass
|
132
|
-
# No header found, add it
|
86
|
+
# Save original content for comparison
|
87
|
+
original_content = "".join(lines)
|
88
|
+
|
89
|
+
# Create two separate line collections:
|
90
|
+
# 1. prefix_lines: Special first line + header + blank line
|
91
|
+
# 2. content_lines: The actual file content (excluding header)
|
92
|
+
prefix_lines = []
|
93
|
+
|
94
|
+
# Check for special first line
|
95
|
+
special_line_index = -1
|
96
|
+
if lines and (lines[0].startswith("#!") or lines[0].startswith("<?xml") or lines[0].startswith("<!DOCTYPE")):
|
97
|
+
special_line_index = 0
|
98
|
+
prefix_lines.append(lines[0])
|
99
|
+
|
100
|
+
# Find existing header
|
101
|
+
header_index = -1
|
102
|
+
start_idx = special_line_index + 1 if special_line_index >= 0 else 0
|
103
|
+
end_idx = min(start_idx + 5, len(lines)) # Look in first few lines
|
104
|
+
|
105
|
+
for i in range(start_idx, end_idx):
|
106
|
+
if "Ultralytics " in lines[i]:
|
107
|
+
header_index = i
|
108
|
+
break
|
109
|
+
|
110
|
+
# Add the formatted header to prefix lines
|
111
|
+
prefix_lines.append(formatted_header)
|
112
|
+
|
113
|
+
# Determine where content starts
|
114
|
+
if header_index >= 0:
|
115
|
+
# Content starts after existing header
|
116
|
+
content_start = header_index + 1
|
117
|
+
# Skip blank line after header if present
|
118
|
+
if content_start < len(lines) and not lines[content_start].strip():
|
119
|
+
content_start += 1
|
120
|
+
content_lines = lines[content_start:]
|
133
121
|
else:
|
134
|
-
#
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
if
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
122
|
+
# No header found
|
123
|
+
if special_line_index >= 0:
|
124
|
+
# Content starts after special line
|
125
|
+
content_lines = lines[special_line_index + 1 :]
|
126
|
+
else:
|
127
|
+
# No special line, content starts at beginning
|
128
|
+
content_lines = lines
|
129
|
+
|
130
|
+
# Add blank line before content if first content line isn't already blank
|
131
|
+
if content_lines and content_lines[0].strip():
|
132
|
+
prefix_lines.append("\n")
|
133
|
+
|
134
|
+
# Combine prefix lines and content lines
|
135
|
+
final_lines = prefix_lines + content_lines
|
136
|
+
|
137
|
+
# Check if content changed
|
138
|
+
new_content = "".join(final_lines)
|
139
|
+
if new_content == original_content:
|
140
|
+
return False
|
141
|
+
|
142
|
+
# Write updated content
|
143
|
+
try:
|
144
|
+
with open(file_path, "w", encoding="utf-8") as f:
|
145
|
+
f.writelines(final_lines)
|
146
|
+
return True
|
147
|
+
except Exception as e:
|
148
|
+
print(f"Error writing {file_path}: {e}")
|
149
|
+
return False
|
152
150
|
|
153
151
|
|
154
152
|
def main(*args, **kwargs):
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ultralytics-actions
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.75
|
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,17 +1,17 @@
|
|
1
|
-
actions/__init__.py,sha256=
|
1
|
+
actions/__init__.py,sha256=ydPwQPnjTrOGpUcAFNDo38-7IPTfXGKKfexNWuU6JWk,742
|
2
2
|
actions/dispatch_actions.py,sha256=vbA4w_B8vMXMen__ck2WoDsUFCELjXOQbpLzZCmqTXg,4240
|
3
3
|
actions/first_interaction.py,sha256=whphdBrWkcWRt6RgOeK2dUoGq3aBTqttQdokxVjkye4,16309
|
4
4
|
actions/summarize_pr.py,sha256=NCaDSbw4PVoRbPJzji_Ua2HadI2pn7QOE_dy3VK9_cc,10463
|
5
5
|
actions/summarize_release.py,sha256=OncODHx7XsmB-nPf-B1tnxUTcaJx6hM4JAMa9frypzM,7922
|
6
|
-
actions/update_file_headers.py,sha256=
|
6
|
+
actions/update_file_headers.py,sha256=jXXV-mdxAoV_bF2Ot3YR-0Z7kDz5V6WB_L0OJME7Ykw,6013
|
7
7
|
actions/update_markdown_code_blocks.py,sha256=9PL7YIQfApRNAa0que2hYHv7umGZTZoHlblesB0xFj4,8587
|
8
8
|
actions/utils/__init__.py,sha256=TXYvhFgDeAnosePM4jfOrEd6PlC7tWC-WMOgCB_T6Tw,728
|
9
9
|
actions/utils/common_utils.py,sha256=2eNwGJFigl9bBXcyWzdr8mr97Lrx7zFKWIFYugZcUJw,11736
|
10
10
|
actions/utils/github_utils.py,sha256=gdObDzOGmoLl8LXJ-fza7Dr2qLKfDsX2HbpcyFBEMtE,10097
|
11
11
|
actions/utils/openai_utils.py,sha256=09kW4K2LOc6KsWz5tijf2Piinhu3PIKPDVkRC3KyIxU,2943
|
12
|
-
ultralytics_actions-0.0.
|
13
|
-
ultralytics_actions-0.0.
|
14
|
-
ultralytics_actions-0.0.
|
15
|
-
ultralytics_actions-0.0.
|
16
|
-
ultralytics_actions-0.0.
|
17
|
-
ultralytics_actions-0.0.
|
12
|
+
ultralytics_actions-0.0.75.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
13
|
+
ultralytics_actions-0.0.75.dist-info/METADATA,sha256=typ-_UzWp0Afv9bnPlYsstJcaOZQ8TzHfXSTVgG1HSM,11638
|
14
|
+
ultralytics_actions-0.0.75.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
15
|
+
ultralytics_actions-0.0.75.dist-info/entry_points.txt,sha256=rvqr6Juj7lCJL1DQLwMmOrA8R2Q8tyR_dvCe0mYuJ8s,441
|
16
|
+
ultralytics_actions-0.0.75.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
17
|
+
ultralytics_actions-0.0.75.dist-info/RECORD,,
|
File without changes
|
{ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/entry_points.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.74.dist-info → ultralytics_actions-0.0.75.dist-info}/licenses/LICENSE
RENAMED
File without changes
|
File without changes
|