ultralytics-actions 0.0.56__py3-none-any.whl → 0.0.58__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_markdown_code_blocks.py +77 -32
- actions/utils/common_utils.py +2 -0
- ultralytics_actions-0.0.58.dist-info/METADATA +148 -0
- ultralytics_actions-0.0.58.dist-info/RECORD +15 -0
- {ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info}/WHEEL +1 -1
- ultralytics_actions-0.0.56.dist-info/METADATA +0 -144
- ultralytics_actions-0.0.56.dist-info/RECORD +0 -15
- {ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info}/entry_points.txt +0 -0
- {ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info/licenses}/LICENSE +0 -0
- {ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info}/top_level.txt +0 -0
actions/__init__.py
CHANGED
@@ -8,10 +8,16 @@ from pathlib import Path
|
|
8
8
|
|
9
9
|
|
10
10
|
def extract_code_blocks(markdown_content):
|
11
|
-
"""Extracts Python code blocks from markdown content using regex pattern matching."""
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
"""Extracts Python and Bash code blocks from markdown content using regex pattern matching."""
|
12
|
+
# Python code blocks
|
13
|
+
py_pattern = r"^( *)```(?:python|py|\{[ ]*\.py[ ]*\.annotate[ ]*\})\n(.*?)\n\1```"
|
14
|
+
py_code_blocks = re.compile(py_pattern, re.DOTALL | re.MULTILINE).findall(markdown_content)
|
15
|
+
|
16
|
+
# Bash code blocks
|
17
|
+
bash_pattern = r"^( *)```(?:bash|sh|shell)\n(.*?)\n\1```"
|
18
|
+
bash_code_blocks = re.compile(bash_pattern, re.DOTALL | re.MULTILINE).findall(markdown_content)
|
19
|
+
|
20
|
+
return {"python": py_code_blocks, "bash": bash_code_blocks}
|
15
21
|
|
16
22
|
|
17
23
|
def remove_indentation(code_block, num_spaces):
|
@@ -89,31 +95,62 @@ def format_code_with_ruff(temp_dir):
|
|
89
95
|
print(f"ERROR running docformatter ❌ {e}")
|
90
96
|
|
91
97
|
|
92
|
-
def
|
93
|
-
"""
|
94
|
-
|
95
|
-
|
96
|
-
|
98
|
+
def format_bash_with_prettier(temp_dir):
|
99
|
+
"""Formats bash script files in the specified directory using prettier."""
|
100
|
+
try:
|
101
|
+
# Run prettier with explicit config path
|
102
|
+
result = subprocess.run(
|
103
|
+
"npx prettier --write --plugin=$(npm root -g)/prettier-plugin-sh/lib/index.cjs ./**/*.sh",
|
104
|
+
shell=True, # must use shell=True to expand internal $(cmd)
|
105
|
+
capture_output=True,
|
106
|
+
text=True,
|
107
|
+
)
|
108
|
+
if result.returncode != 0:
|
109
|
+
print(f"ERROR running prettier-plugin-sh ❌ {result.stderr}")
|
110
|
+
else:
|
111
|
+
print("Completed bash formatting ✅")
|
112
|
+
except Exception as e:
|
113
|
+
print(f"ERROR running prettier-plugin-sh ❌ {e}")
|
114
|
+
|
115
|
+
|
116
|
+
def generate_temp_filename(file_path, index, code_type):
|
117
|
+
"""Creates unique temp filename with full path info for debugging."""
|
118
|
+
stem = file_path.stem
|
119
|
+
code_letter = code_type[0] # 'p' for python, 'b' for bash
|
120
|
+
path_part = str(file_path.parent).replace("/", "_").replace("\\", "_").replace(" ", "-")
|
121
|
+
hash_val = hashlib.md5(f"{file_path}_{index}".encode()).hexdigest()[:6]
|
122
|
+
ext = ".py" if code_type == "python" else ".sh"
|
123
|
+
filename = f"{stem}_{path_part}_{code_letter}{index}_{hash_val}{ext}"
|
124
|
+
return re.sub(r"[^\w\-.]", "_", filename)
|
97
125
|
|
98
126
|
|
99
|
-
def process_markdown_file(file_path, temp_dir, verbose=False):
|
100
|
-
"""Processes a markdown file, extracting
|
127
|
+
def process_markdown_file(file_path, temp_dir, process_python=True, process_bash=True, verbose=False):
|
128
|
+
"""Processes a markdown file, extracting code blocks for formatting and updating the original file."""
|
101
129
|
try:
|
102
130
|
markdown_content = Path(file_path).read_text()
|
103
|
-
|
131
|
+
code_blocks_by_type = extract_code_blocks(markdown_content)
|
104
132
|
temp_files = []
|
105
133
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
134
|
+
# Process all code block types based on flags
|
135
|
+
code_types = []
|
136
|
+
if process_python:
|
137
|
+
code_types.append(("python", 0))
|
138
|
+
if process_bash:
|
139
|
+
code_types.append(("bash", 1000))
|
140
|
+
|
141
|
+
for code_type, offset in code_types:
|
142
|
+
for i, (num_spaces, code_block) in enumerate(code_blocks_by_type[code_type]):
|
143
|
+
if verbose:
|
144
|
+
print(f"Extracting {code_type} code block {i} from {file_path}")
|
145
|
+
|
146
|
+
num_spaces = len(num_spaces)
|
147
|
+
code_without_indentation = remove_indentation(code_block, num_spaces)
|
148
|
+
temp_file_path = temp_dir / generate_temp_filename(file_path, i + offset, code_type)
|
111
149
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
temp_files.append((num_spaces, code_block, temp_file_path))
|
150
|
+
with open(temp_file_path, "w") as temp_file:
|
151
|
+
temp_file.write(code_without_indentation)
|
152
|
+
|
153
|
+
temp_files.append((num_spaces, code_block, temp_file_path, code_type))
|
117
154
|
|
118
155
|
return markdown_content, temp_files
|
119
156
|
|
@@ -123,15 +160,18 @@ def process_markdown_file(file_path, temp_dir, verbose=False):
|
|
123
160
|
|
124
161
|
|
125
162
|
def update_markdown_file(file_path, markdown_content, temp_files):
|
126
|
-
"""Updates a markdown file with formatted
|
127
|
-
for num_spaces, original_code_block, temp_file_path in temp_files:
|
163
|
+
"""Updates a markdown file with formatted code blocks."""
|
164
|
+
for num_spaces, original_code_block, temp_file_path, code_type in temp_files:
|
128
165
|
try:
|
129
166
|
with open(temp_file_path) as temp_file:
|
130
167
|
formatted_code = temp_file.read().rstrip("\n") # Strip trailing newlines
|
131
168
|
formatted_code_with_indentation = add_indentation(formatted_code, num_spaces)
|
132
169
|
|
133
|
-
#
|
134
|
-
|
170
|
+
# Define the language tags for each code type
|
171
|
+
lang_tags = {"python": ["python", "py", "{ .py .annotate }"], "bash": ["bash", "sh", "shell"]}
|
172
|
+
|
173
|
+
# Replace the code blocks with the formatted version
|
174
|
+
for lang in lang_tags[code_type]:
|
135
175
|
markdown_content = markdown_content.replace(
|
136
176
|
f"{' ' * num_spaces}```{lang}\n{original_code_block}\n{' ' * num_spaces}```",
|
137
177
|
f"{' ' * num_spaces}```{lang}\n{formatted_code_with_indentation}\n{' ' * num_spaces}```",
|
@@ -146,8 +186,8 @@ def update_markdown_file(file_path, markdown_content, temp_files):
|
|
146
186
|
print(f"Error writing file {file_path}: {e}")
|
147
187
|
|
148
188
|
|
149
|
-
def main(root_dir=Path.cwd(), verbose=False):
|
150
|
-
"""Processes markdown files, extracts and formats
|
189
|
+
def main(root_dir=Path.cwd(), process_python=True, process_bash=True, verbose=False):
|
190
|
+
"""Processes markdown files, extracts and formats code blocks, and updates the original files."""
|
151
191
|
root_path = Path(root_dir)
|
152
192
|
markdown_files = list(root_path.rglob("*.md"))
|
153
193
|
temp_dir = Path("temp_code_blocks")
|
@@ -158,12 +198,17 @@ def main(root_dir=Path.cwd(), verbose=False):
|
|
158
198
|
for markdown_file in markdown_files:
|
159
199
|
if verbose:
|
160
200
|
print(f"Processing {markdown_file}")
|
161
|
-
markdown_content, temp_files = process_markdown_file(
|
201
|
+
markdown_content, temp_files = process_markdown_file(
|
202
|
+
markdown_file, temp_dir, process_python, process_bash, verbose
|
203
|
+
)
|
162
204
|
if markdown_content and temp_files:
|
163
205
|
all_temp_files.append((markdown_file, markdown_content, temp_files))
|
164
206
|
|
165
|
-
# Format
|
166
|
-
|
207
|
+
# Format code blocks based on flags
|
208
|
+
if process_python:
|
209
|
+
format_code_with_ruff(temp_dir) # Format Python files
|
210
|
+
if process_bash:
|
211
|
+
format_bash_with_prettier(temp_dir) # Format Bash files
|
167
212
|
|
168
213
|
# Update markdown files with formatted code blocks
|
169
214
|
for markdown_file, markdown_content, temp_files in all_temp_files:
|
@@ -174,4 +219,4 @@ def main(root_dir=Path.cwd(), verbose=False):
|
|
174
219
|
|
175
220
|
|
176
221
|
if __name__ == "__main__":
|
177
|
-
main()
|
222
|
+
main(process_python=True, process_bash=True)
|
actions/utils/common_utils.py
CHANGED
@@ -52,6 +52,8 @@ URL_IGNORE_LIST = { # use a set (not frozenset) to update with possible private
|
|
52
52
|
"x.com",
|
53
53
|
"storage.googleapis.com", # private GCS buckets
|
54
54
|
"{", # possible Python fstring
|
55
|
+
"(", # breaks pattern matches
|
56
|
+
"api", # ignore api endpoints
|
55
57
|
}
|
56
58
|
URL_PATTERN = re.compile(
|
57
59
|
r"\[([^]]+)]\(([^)]+)\)" # Matches Markdown links [text](url)
|
@@ -0,0 +1,148 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: ultralytics-actions
|
3
|
+
Version: 0.0.58
|
4
|
+
Summary: Ultralytics Actions for GitHub automation and PR management.
|
5
|
+
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
6
|
+
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
7
|
+
License: AGPL-3.0
|
8
|
+
Project-URL: Homepage, https://ultralytics.com
|
9
|
+
Project-URL: Source, https://github.com/ultralytics/actions
|
10
|
+
Project-URL: Documentation, https://docs.ultralytics.com
|
11
|
+
Project-URL: Bug Reports, https://github.com/ultralytics/actions/issues
|
12
|
+
Project-URL: Changelog, https://github.com/ultralytics/actions/releases
|
13
|
+
Keywords: github-actions,ci-cd,workflow-automation,pull-request-automation,code-review,release-automation,markdown-processing,devops,github-integration,continuous-integration
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
15
|
+
Classifier: Intended Audience :: Developers
|
16
|
+
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
24
|
+
Classifier: Topic :: Software Development
|
25
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
26
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
27
|
+
Classifier: Operating System :: OS Independent
|
28
|
+
Requires-Python: >=3.8
|
29
|
+
Description-Content-Type: text/markdown
|
30
|
+
License-File: LICENSE
|
31
|
+
Requires-Dist: requests>=2.32.3
|
32
|
+
Requires-Dist: ruff>=0.9.1
|
33
|
+
Requires-Dist: docformatter>=1.7.5
|
34
|
+
Provides-Extra: dev
|
35
|
+
Requires-Dist: pytest; extra == "dev"
|
36
|
+
Dynamic: license-file
|
37
|
+
|
38
|
+
<a href="https://www.ultralytics.com/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/logo/Ultralytics_Logotype_Original.svg" width="320" alt="Ultralytics logo"></a>
|
39
|
+
|
40
|
+
# 🚀 Ultralytics Actions: Auto-Formatting for Python, Markdown, and Swift
|
41
|
+
|
42
|
+
Welcome to the [Ultralytics Actions](https://github.com/ultralytics/actions) repository, your go-to solution for maintaining consistent code quality across Ultralytics Python and Swift projects. This GitHub Action is designed to automate the formatting of Python, Markdown, and Swift files, ensuring adherence to our coding standards and enhancing project maintainability.
|
43
|
+
|
44
|
+
[](https://github.com/marketplace/actions/ultralytics-actions)
|
45
|
+
[](https://github.com/ultralytics/actions/actions/workflows/format.yml)
|
46
|
+
[](https://discord.com/invite/ultralytics)
|
47
|
+
[](https://community.ultralytics.com/)
|
48
|
+
[](https://reddit.com/r/ultralytics)
|
49
|
+
[](https://badge.fury.io/py/ultralytics-actions)
|
50
|
+
[](https://www.pepy.tech/projects/ultralytics-actions)
|
51
|
+
|
52
|
+
## 📄 Actions Description
|
53
|
+
|
54
|
+
Ultralytics Actions automatically applies formats, updates, and enhancements using a suite of powerful tools:
|
55
|
+
|
56
|
+
- **Python Code:** Formatted using [Ruff](https://github.com/astral-sh/ruff), an extremely fast Python linter and formatter.
|
57
|
+
- **Markdown Files:** Styled with [Prettier](https://github.com/prettier/prettier) to ensure consistent documentation appearance.
|
58
|
+
- **Docstrings:** Cleaned and standardized using [docformatter](https://github.com/PyCQA/docformatter).
|
59
|
+
- **Swift Code:** Formatted with [`swift-format`](https://github.com/swiftlang/swift-format) to maintain a uniform coding style across Swift projects. _(Note: Requires the `macos-latest` runner.)_
|
60
|
+
- **Spell Check:** Common misspellings are caught using [codespell](https://github.com/codespell-project/codespell).
|
61
|
+
- **Broken Links Check:** Broken links in documentation and Markdown files are identified using [Lychee](https://github.com/lycheeverse/lychee).
|
62
|
+
- **PR Summary:** Concise Pull Request summaries are generated using [OpenAI](https://openai.com/) GPT-4o, improving clarity and review efficiency.
|
63
|
+
- **Auto-labeling:** Relevant labels are applied to issues and pull requests via [OpenAI](https://openai.com/) GPT-4o for intelligent categorization.
|
64
|
+
|
65
|
+
## 🛠️ How It Works
|
66
|
+
|
67
|
+
Ultralytics Actions triggers on various GitHub events to streamline workflows:
|
68
|
+
|
69
|
+
- **Push Events:** Automatically formats code when changes are pushed to the `main` branch.
|
70
|
+
- **Pull Requests:**
|
71
|
+
- Ensures contributions meet formatting standards before merging.
|
72
|
+
- Generates a concise summary of changes using GPT-4o.
|
73
|
+
- Applies relevant labels using GPT-4o for intelligent categorization.
|
74
|
+
- **Issues:** Automatically applies relevant labels using GPT-4o when new issues are created.
|
75
|
+
|
76
|
+
These automated actions help maintain high code quality, improve documentation clarity, and streamline the review process by providing consistent formatting, informative summaries, and appropriate categorization.
|
77
|
+
|
78
|
+
## 🔧 Setting Up the Action
|
79
|
+
|
80
|
+
To integrate this action into your Ultralytics repository:
|
81
|
+
|
82
|
+
1. **Create a Workflow File:** In your repository, create a YAML file under `.github/workflows/`, for example, `ultralytics-actions.yml`.
|
83
|
+
|
84
|
+
2. **Add the Action:** Configure the Ultralytics Actions in your workflow file as shown below:
|
85
|
+
|
86
|
+
```yaml
|
87
|
+
name: Ultralytics Actions
|
88
|
+
|
89
|
+
on:
|
90
|
+
issues:
|
91
|
+
types: [opened]
|
92
|
+
pull_request:
|
93
|
+
branches: [main]
|
94
|
+
types: [opened, closed]
|
95
|
+
|
96
|
+
jobs:
|
97
|
+
format:
|
98
|
+
runs-on: ubuntu-latest # Use 'macos-latest' if 'swift: true'
|
99
|
+
steps:
|
100
|
+
- name: Run Ultralytics Formatting
|
101
|
+
uses: ultralytics/actions@main
|
102
|
+
with:
|
103
|
+
token: ${{ secrets.GITHUB_TOKEN }} # Automatically generated, do not modify
|
104
|
+
labels: true # Autolabel issues and PRs using GPT-4o (requires 'openai_api_key')
|
105
|
+
python: true # Format Python code and docstrings with Ruff and docformatter
|
106
|
+
prettier: true # Format YAML, JSON, Markdown, and CSS with Prettier
|
107
|
+
swift: false # Format Swift code with swift-format (requires 'runs-on: macos-latest')
|
108
|
+
spelling: true # Check spelling with codespell
|
109
|
+
links: true # Check for broken links with Lychee
|
110
|
+
summary: true # Generate PR summary with GPT-4o (requires 'openai_api_key')
|
111
|
+
openai_api_key: ${{ secrets.OPENAI_API_KEY }} # Add your OpenAI API key as a repository secret
|
112
|
+
```
|
113
|
+
|
114
|
+
3. **Customize:** Adjust the `runs-on` runner and the boolean flags (`labels`, `python`, `prettier`, `swift`, `spelling`, `links`, `summary`) based on your project's needs. Remember to add your `OPENAI_API_KEY` as a secret in your repository settings if you enable `labels` or `summary`.
|
115
|
+
|
116
|
+
## 💡 Contribute
|
117
|
+
|
118
|
+
Ultralytics thrives on community collaboration, and we deeply value your contributions! Please see our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for details on how you can get involved. We also encourage you to share your feedback through our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A huge thank you 🙏 to all our contributors!
|
119
|
+
|
120
|
+
[](https://github.com/ultralytics/ultralytics/graphs/contributors)
|
121
|
+
|
122
|
+
## 📄 License
|
123
|
+
|
124
|
+
Ultralytics offers two licensing options:
|
125
|
+
|
126
|
+
- **AGPL-3.0 License**: An [OSI-approved](https://opensource.org/license/agpl-v3) open-source license ideal for students, researchers, and enthusiasts who value open collaboration. See the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) file for details.
|
127
|
+
- **Enterprise License**: Designed for commercial use, this license allows integrating Ultralytics software and AI models into commercial products without AGPL-3.0's open-source requirements. For enterprise solutions, contact [Ultralytics Licensing](https://www.ultralytics.com/license).
|
128
|
+
|
129
|
+
## 📫 Contact
|
130
|
+
|
131
|
+
For bug reports or feature suggestions related to Ultralytics Actions, please submit an issue via [GitHub Issues](https://github.com/ultralytics/actions/issues). Join our [Discord](https://discord.com/invite/ultralytics) community for discussions and support!
|
132
|
+
|
133
|
+
<br>
|
134
|
+
<div align="center">
|
135
|
+
<a href="https://github.com/ultralytics"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
136
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
137
|
+
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
138
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
139
|
+
<a href="https://twitter.com/ultralytics"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
140
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
141
|
+
<a href="https://youtube.com/ultralytics"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
142
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
143
|
+
<a href="https://www.tiktok.com/@ultralytics"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
144
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
145
|
+
<a href="https://ultralytics.com/bilibili"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics BiliBili"></a>
|
146
|
+
<img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-transparent.png" width="3%" alt="space">
|
147
|
+
<a href="https://discord.com/invite/ultralytics"><img src="https://raw.githubusercontent.com/ultralytics/assets/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
148
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
actions/__init__.py,sha256=6Y9w-2wmcfeoTzPGK6EuKj1QUEZQ4puqm_g29PweRMY,742
|
2
|
+
actions/first_interaction.py,sha256=1_WvQHCi5RWaSfyi49ClF2Zk_3CKGjFnZqz6FlxPRAc,17868
|
3
|
+
actions/summarize_pr.py,sha256=BKttOq-MGaanVaChLU5B1ewKUA8K6S05Cy3FQtyRmxU,11681
|
4
|
+
actions/summarize_release.py,sha256=tov6qsYGC68lfobvkwVyoWZBGtJ598G0m097n4Ydzvo,8472
|
5
|
+
actions/update_markdown_code_blocks.py,sha256=9PL7YIQfApRNAa0que2hYHv7umGZTZoHlblesB0xFj4,8587
|
6
|
+
actions/utils/__init__.py,sha256=WStdEAYROVnF0nubEOmrFLrejkRiMXIefA5O1ckfcFs,476
|
7
|
+
actions/utils/common_utils.py,sha256=0ZUphOWBu8gFWnFVnyye2UX8iJCtSgxv_nZYFiyER8M,6094
|
8
|
+
actions/utils/github_utils.py,sha256=-F--JgxtXE0fSPMFEzakz7iZilp-vonzLiyXfg0b17Y,7117
|
9
|
+
actions/utils/openai_utils.py,sha256=qQbmrJpOUANxSMf7inDSgPIwgf0JHD1fWZuab-y2W6g,2942
|
10
|
+
ultralytics_actions-0.0.58.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
11
|
+
ultralytics_actions-0.0.58.dist-info/METADATA,sha256=eQGJsnbvwi1MNC3vsQUZlK8w6kWphACueNhQuvMpows,10923
|
12
|
+
ultralytics_actions-0.0.58.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
13
|
+
ultralytics_actions-0.0.58.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
|
14
|
+
ultralytics_actions-0.0.58.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
15
|
+
ultralytics_actions-0.0.58.dist-info/RECORD,,
|
@@ -1,144 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.2
|
2
|
-
Name: ultralytics-actions
|
3
|
-
Version: 0.0.56
|
4
|
-
Summary: Ultralytics Actions for GitHub automation and PR management.
|
5
|
-
Author-email: Glenn Jocher <glenn.jocher@ultralytics.com>
|
6
|
-
Maintainer-email: Ultralytics <hello@ultralytics.com>
|
7
|
-
License: AGPL-3.0
|
8
|
-
Project-URL: Homepage, https://ultralytics.com
|
9
|
-
Project-URL: Source, https://github.com/ultralytics/actions
|
10
|
-
Project-URL: Documentation, https://docs.ultralytics.com
|
11
|
-
Project-URL: Bug Reports, https://github.com/ultralytics/actions/issues
|
12
|
-
Project-URL: Changelog, https://github.com/ultralytics/actions/releases
|
13
|
-
Keywords: github-actions,ci-cd,workflow-automation,pull-request-automation,code-review,release-automation,markdown-processing,devops,github-integration,continuous-integration
|
14
|
-
Classifier: Development Status :: 4 - Beta
|
15
|
-
Classifier: Intended Audience :: Developers
|
16
|
-
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
23
|
-
Classifier: Programming Language :: Python :: 3.13
|
24
|
-
Classifier: Topic :: Software Development
|
25
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
26
|
-
Classifier: Topic :: Internet :: WWW/HTTP
|
27
|
-
Classifier: Operating System :: OS Independent
|
28
|
-
Requires-Python: >=3.8
|
29
|
-
Description-Content-Type: text/markdown
|
30
|
-
License-File: LICENSE
|
31
|
-
Requires-Dist: requests>=2.32.3
|
32
|
-
Requires-Dist: ruff>=0.9.1
|
33
|
-
Requires-Dist: docformatter>=1.7.5
|
34
|
-
Provides-Extra: dev
|
35
|
-
Requires-Dist: pytest; extra == "dev"
|
36
|
-
|
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>
|
38
|
-
|
39
|
-
# 🚀 Ultralytics Actions: Auto-Formatting for Python, Markdown, and Swift
|
40
|
-
|
41
|
-
Welcome to the [Ultralytics Actions](https://github.com/ultralytics/actions) repository, your go-to solution for maintaining consistent code quality across Ultralytics Python and Swift projects. This GitHub Action is designed to automate the formatting of Python, Markdown, and Swift files, ensuring adherence to our coding standards.
|
42
|
-
|
43
|
-
[](https://github.com/marketplace/actions/ultralytics-actions) [](https://github.com/ultralytics/actions/actions/workflows/format.yml) <a href="https://discord.com/invite/ultralytics"><img alt="Discord" src="https://img.shields.io/discord/1089800235347353640?logo=discord&logoColor=white&label=Discord&color=blue"></a> <a href="https://community.ultralytics.com/"><img alt="Ultralytics Forums" src="https://img.shields.io/discourse/users?server=https%3A%2F%2Fcommunity.ultralytics.com&logo=discourse&label=Forums&color=blue"></a> <a href="https://reddit.com/r/ultralytics"><img alt="Ultralytics Reddit" src="https://img.shields.io/reddit/subreddit-subscribers/ultralytics?style=flat&logo=reddit&logoColor=white&label=Reddit&color=blue"></a>
|
44
|
-
|
45
|
-
[](https://badge.fury.io/py/ultralytics-actions) [](https://www.pepy.tech/projects/ultralytics-actions)
|
46
|
-
|
47
|
-
## 📄 Actions Description
|
48
|
-
|
49
|
-
Ultralytics Actions automatically applies formats, updates, and enhancements:
|
50
|
-
|
51
|
-
- **Python Code:** Using [Ruff](https://github.com/astral-sh/ruff), a fast Python auto-formatter.
|
52
|
-
- **Markdown Files:** With [Prettier](https://github.com/prettier/prettier), ensuring a consistent style in documentation.
|
53
|
-
- **Docstrings:** Utilizing [docformatter](https://github.com/PyCQA/docformatter) for clean and standardized documentation comments.
|
54
|
-
- **Swift Code:** Formatting Swift files using `swift-format` to ensure consistent coding style across Swift projects. _(Requires `macos-latest` to run correctly.)_
|
55
|
-
- **Spell Check:** Employing [codespell](https://github.com/codespell-project/codespell) for catching common misspellings.
|
56
|
-
- **Broken Links Check:** Implementing [Lychee](https://github.com/lycheeverse/lychee) to report broken links in docs and markdown files.
|
57
|
-
- **PR Summary:** Generating concise [OpenAI](https://openai.com/) GPT4o-powered PR summaries, enhancing PR clarity.
|
58
|
-
- **Auto-labeling:** Applying relevant labels to issues and pull requests using [OpenAI](https://openai.com/) GPT-4o for intelligent categorization.
|
59
|
-
|
60
|
-
## 🛠 How It Works
|
61
|
-
|
62
|
-
Ultralytics Actions triggers on various GitHub events:
|
63
|
-
|
64
|
-
- **Push Events:** Automatically formats code when changes are pushed to the `main` branch.
|
65
|
-
- **Pull Requests:**
|
66
|
-
- Ensures that contributions meet our formatting standards before merging.
|
67
|
-
- Generates a concise summary of the changes using GPT-4o.
|
68
|
-
- Automatically applies relevant labels using GPT-4o for intelligent categorization.
|
69
|
-
- **Issues:** Automatically applies relevant labels using GPT-4o when new issues are created.
|
70
|
-
|
71
|
-
These actions help maintain code quality, improve documentation clarity, and streamline the review process by providing consistent formatting, informative summaries, and appropriate categorization of issues and pull requests.
|
72
|
-
|
73
|
-
## 🔧 Setting Up the Action
|
74
|
-
|
75
|
-
To use this action in your Ultralytics repository:
|
76
|
-
|
77
|
-
1. **Create a Workflow File:** In your repository, create a file under `.github/workflows/`, e.g., `ultralytics-actions.yml`.
|
78
|
-
|
79
|
-
2. **Add the Action:** Use the Ultralytics Actions in your workflow file as follows:
|
80
|
-
|
81
|
-
```yaml
|
82
|
-
name: Ultralytics Actions
|
83
|
-
|
84
|
-
on:
|
85
|
-
issues:
|
86
|
-
types: [opened]
|
87
|
-
pull_request:
|
88
|
-
branches: [main]
|
89
|
-
types: [opened, closed]
|
90
|
-
|
91
|
-
jobs:
|
92
|
-
format:
|
93
|
-
runs-on: ubuntu-latest
|
94
|
-
steps:
|
95
|
-
- name: Run Ultralytics Formatting
|
96
|
-
uses: ultralytics/actions@main
|
97
|
-
with:
|
98
|
-
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify
|
99
|
-
labels: true # autolabel issues and PRs
|
100
|
-
python: true # format Python code and docstrings
|
101
|
-
prettier: true # format YAML, JSON, Markdown and CSS
|
102
|
-
swift: true # format Swift code (requires 'macos-latest' runner)
|
103
|
-
spelling: true # check spelling
|
104
|
-
links: true # check broken links
|
105
|
-
summary: true # print PR summary with GPT4o (requires 'openai_api_key')
|
106
|
-
openai_api_key: # your OpenAI API key
|
107
|
-
```
|
108
|
-
|
109
|
-
3. **Customize:** Adjust the workflow settings as necessary for your project.
|
110
|
-
|
111
|
-
## 💡 Contribute
|
112
|
-
|
113
|
-
Ultralytics thrives on community collaboration; we immensely value your involvement! We urge you to peruse our [Contributing Guide](https://docs.ultralytics.com/help/contributing/) for detailed insights on how you can participate. Don't forget to share your feedback with us by contributing to our [Survey](https://www.ultralytics.com/survey?utm_source=github&utm_medium=social&utm_campaign=Survey). A heartfelt thank you 🙏 goes out to everyone who has already contributed!
|
114
|
-
|
115
|
-
<a href="https://github.com/ultralytics/yolov5/graphs/contributors">
|
116
|
-
<img width="100%" src="https://github.com/ultralytics/assets/raw/main/im/image-contributors.png" alt="Ultralytics open-source contributors"></a>
|
117
|
-
|
118
|
-
## 📄 License
|
119
|
-
|
120
|
-
Ultralytics presents two distinct licensing paths to accommodate a variety of scenarios:
|
121
|
-
|
122
|
-
- **AGPL-3.0 License**: This official [OSI-approved](https://opensource.org/license) open-source license is perfectly aligned with the goals of students, enthusiasts, and researchers who believe in the virtues of open collaboration and shared wisdom. Details are available in the [LICENSE](https://github.com/ultralytics/ultralytics/blob/main/LICENSE) document.
|
123
|
-
- **Enterprise License**: Tailored for commercial deployment, this license authorizes the unfettered integration of Ultralytics software and AI models within commercial goods and services, without the copyleft stipulations of AGPL-3.0. Should your use case demand an enterprise solution, direct your inquiries to [Ultralytics Licensing](https://www.ultralytics.com/license).
|
124
|
-
|
125
|
-
## 📮 Contact
|
126
|
-
|
127
|
-
For bugs or feature suggestions pertaining to Ultralytics, please lodge an issue via [GitHub Issues](https://github.com/ultralytics/pre-commit/issues). You're also invited to participate in our [Discord](https://discord.com/invite/ultralytics) community to engage in discussions and seek advice!
|
128
|
-
|
129
|
-
<br>
|
130
|
-
<div align="center">
|
131
|
-
<a href="https://github.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-github.png" width="3%" alt="Ultralytics GitHub"></a>
|
132
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
133
|
-
<a href="https://www.linkedin.com/company/ultralytics/"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-linkedin.png" width="3%" alt="Ultralytics LinkedIn"></a>
|
134
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
135
|
-
<a href="https://twitter.com/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-twitter.png" width="3%" alt="Ultralytics Twitter"></a>
|
136
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
137
|
-
<a href="https://youtube.com/ultralytics?sub_confirmation=1"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-youtube.png" width="3%" alt="Ultralytics YouTube"></a>
|
138
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
139
|
-
<a href="https://www.tiktok.com/@ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-tiktok.png" width="3%" alt="Ultralytics TikTok"></a>
|
140
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
141
|
-
<a href="https://ultralytics.com/bilibili"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-bilibili.png" width="3%" alt="Ultralytics BiliBili"></a>
|
142
|
-
<img src="https://github.com/ultralytics/assets/raw/main/social/logo-transparent.png" width="3%" alt="space">
|
143
|
-
<a href="https://discord.com/invite/ultralytics"><img src="https://github.com/ultralytics/assets/raw/main/social/logo-social-discord.png" width="3%" alt="Ultralytics Discord"></a>
|
144
|
-
</div>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
actions/__init__.py,sha256=OsA1f_zloRyT6FbnRCGPxd76Cu-N-Vf5WReu9UDlbqY,742
|
2
|
-
actions/first_interaction.py,sha256=1_WvQHCi5RWaSfyi49ClF2Zk_3CKGjFnZqz6FlxPRAc,17868
|
3
|
-
actions/summarize_pr.py,sha256=BKttOq-MGaanVaChLU5B1ewKUA8K6S05Cy3FQtyRmxU,11681
|
4
|
-
actions/summarize_release.py,sha256=tov6qsYGC68lfobvkwVyoWZBGtJ598G0m097n4Ydzvo,8472
|
5
|
-
actions/update_markdown_code_blocks.py,sha256=tUChNBIZN-B_unGMG9yQk-dohi7bit02Yl3xc4UtycQ,6610
|
6
|
-
actions/utils/__init__.py,sha256=WStdEAYROVnF0nubEOmrFLrejkRiMXIefA5O1ckfcFs,476
|
7
|
-
actions/utils/common_utils.py,sha256=PZkK9Wc3od34J9VSw4ICWHhQQC033o3DCrCy0VIyZE4,6024
|
8
|
-
actions/utils/github_utils.py,sha256=-F--JgxtXE0fSPMFEzakz7iZilp-vonzLiyXfg0b17Y,7117
|
9
|
-
actions/utils/openai_utils.py,sha256=qQbmrJpOUANxSMf7inDSgPIwgf0JHD1fWZuab-y2W6g,2942
|
10
|
-
ultralytics_actions-0.0.56.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
11
|
-
ultralytics_actions-0.0.56.dist-info/METADATA,sha256=lvqelxqPqg0UiVc-ocGZ6Dy884vQtnjxwlqHqW34AcQ,10561
|
12
|
-
ultralytics_actions-0.0.56.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
|
13
|
-
ultralytics_actions-0.0.56.dist-info/entry_points.txt,sha256=GowvOFplj0C7JmsjbKcbpgLpdf2r921pcaOQkAHWZRA,378
|
14
|
-
ultralytics_actions-0.0.56.dist-info/top_level.txt,sha256=5apM5x80QlJcGbACn1v3fkmIuL1-XQCKcItJre7w7Tw,8
|
15
|
-
ultralytics_actions-0.0.56.dist-info/RECORD,,
|
{ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info}/entry_points.txt
RENAMED
File without changes
|
{ultralytics_actions-0.0.56.dist-info → ultralytics_actions-0.0.58.dist-info/licenses}/LICENSE
RENAMED
File without changes
|
File without changes
|