gha-utils 4.19.0__tar.gz → 4.20.0__tar.gz
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.
Potentially problematic release.
This version of gha-utils might be problematic. Click here for more details.
- {gha_utils-4.19.0 → gha_utils-4.20.0}/PKG-INFO +7 -3
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/__init__.py +1 -1
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/mailmap.py +1 -1
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/metadata.py +315 -124
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/PKG-INFO +7 -3
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/requires.txt +2 -2
- {gha_utils-4.19.0 → gha_utils-4.20.0}/pyproject.toml +12 -7
- {gha_utils-4.19.0 → gha_utils-4.20.0}/tests/test_metadata.py +68 -5
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/__main__.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/changelog.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/cli.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/matrix.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/py.typed +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils/test_plan.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/SOURCES.txt +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/dependency_links.txt +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/entry_points.txt +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/gha_utils.egg-info/top_level.txt +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/readme.md +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/setup.cfg +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/tests/test_changelog.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/tests/test_mailmap.py +0 -0
- {gha_utils-4.19.0 → gha_utils-4.20.0}/tests/test_matrix.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gha-utils
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.20.0
|
|
4
4
|
Summary: ⚙️ CLI helpers for GitHub Actions + reuseable workflows
|
|
5
5
|
Author-email: Kevin Deldycke <kevin@deldycke.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/kdeldycke/workflows
|
|
@@ -18,10 +18,14 @@ Classifier: License :: OSI Approved :: GNU General Public License v2 or later (G
|
|
|
18
18
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
19
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
20
20
|
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
|
|
22
|
+
Classifier: Operating System :: POSIX :: BSD :: NetBSD
|
|
23
|
+
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
|
|
21
24
|
Classifier: Programming Language :: Python :: 3
|
|
22
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
30
|
Classifier: Programming Language :: Unix Shell
|
|
27
31
|
Classifier: Topic :: Documentation :: Sphinx
|
|
@@ -46,10 +50,10 @@ Requires-Python: >=3.11
|
|
|
46
50
|
Description-Content-Type: text/markdown
|
|
47
51
|
Requires-Dist: boltons>=24.0.0
|
|
48
52
|
Requires-Dist: bump-my-version<1.1.1,>=0.32.2
|
|
49
|
-
Requires-Dist: click-extra~=
|
|
53
|
+
Requires-Dist: click-extra~=6.0.0
|
|
50
54
|
Requires-Dist: extra-platforms~=3.2.0
|
|
51
|
-
Requires-Dist: gitignore-parser~=0.1.13
|
|
52
55
|
Requires-Dist: packaging~=25.0
|
|
56
|
+
Requires-Dist: py-walk~=0.3.3
|
|
53
57
|
Requires-Dist: PyDriller~=2.6
|
|
54
58
|
Requires-Dist: pyproject-metadata~=0.9.0
|
|
55
59
|
Requires-Dist: pyyaml~=6.0.0
|
|
@@ -128,7 +128,7 @@ class Mailmap:
|
|
|
128
128
|
|
|
129
129
|
@cached_property
|
|
130
130
|
def git_contributors(self) -> set[str]:
|
|
131
|
-
"""Returns the set of all
|
|
131
|
+
"""Returns the set of all contributors found in the Git commit history.
|
|
132
132
|
|
|
133
133
|
No normalization happens: all variations of authors and committers strings
|
|
134
134
|
attached to all commits are considered.
|
|
@@ -20,6 +20,7 @@ The following variables are `printed to the environment file
|
|
|
20
20
|
<https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files>`_:
|
|
21
21
|
|
|
22
22
|
```text
|
|
23
|
+
is_bot=false
|
|
23
24
|
new_commits=346ce664f055fbd042a25ee0b7e96702e95 6f27db47612aaee06fdf08744b09a9f5f6c2
|
|
24
25
|
release_commits=6f27db47612aaee06fdf08744b09a9f5f6c2
|
|
25
26
|
gitignore_exists=true
|
|
@@ -34,119 +35,233 @@ released_version=2.0.0
|
|
|
34
35
|
is_sphinx=true
|
|
35
36
|
active_autodoc=true
|
|
36
37
|
release_notes=[🐍 Available on PyPi](https://pypi.org/project/click-extra/2.21.3).
|
|
37
|
-
new_commits_matrix={
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
38
|
+
new_commits_matrix={
|
|
39
|
+
"commit": [
|
|
40
|
+
"346ce664f055fbd042a25ee0b7e96702e95",
|
|
41
|
+
"6f27db47612aaee06fdf08744b09a9f5f6c2"
|
|
42
|
+
],
|
|
43
|
+
"include": [
|
|
44
|
+
{
|
|
45
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
46
|
+
"short_sha": "346ce66",
|
|
47
|
+
"current_version": "2.0.1"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
51
|
+
"short_sha": "6f27db4",
|
|
52
|
+
"current_version": "2.0.0"
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
release_commits_matrix={
|
|
57
|
+
"commit": ["6f27db47612aaee06fdf08744b09a9f5f6c2"],
|
|
58
|
+
"include": [
|
|
59
|
+
{
|
|
60
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
61
|
+
"short_sha": "6f27db4",
|
|
62
|
+
"current_version": "2.0.0"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
build_targets=[
|
|
67
|
+
{
|
|
68
|
+
"target": "linux-arm64",
|
|
69
|
+
"os": "ubuntu-24.04-arm",
|
|
70
|
+
"platform_id": "linux",
|
|
71
|
+
"arch": "arm64",
|
|
72
|
+
"extension": "bin"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"target": "linux-x64",
|
|
76
|
+
"os": "ubuntu-24.04",
|
|
77
|
+
"platform_id": "linux",
|
|
78
|
+
"arch": "x64",
|
|
79
|
+
"extension": "bin"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"target": "macos-arm64",
|
|
83
|
+
"os": "macos-15",
|
|
84
|
+
"platform_id": "macos",
|
|
85
|
+
"arch": "arm64",
|
|
86
|
+
"extension": "bin"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"target": "macos-x64",
|
|
90
|
+
"os": "macos-13",
|
|
91
|
+
"platform_id": "macos",
|
|
92
|
+
"arch": "x64",
|
|
93
|
+
"extension": "bin"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"target": "windows-arm64",
|
|
97
|
+
"os": "windows-11-arm",
|
|
98
|
+
"platform_id": "windows",
|
|
99
|
+
"arch": "arm64",
|
|
100
|
+
"extension": "exe"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"target": "windows-x64",
|
|
104
|
+
"os": "windows-2025",
|
|
105
|
+
"platform_id": "windows",
|
|
106
|
+
"arch": "x64",
|
|
107
|
+
"extension": "exe"
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
nuitka_matrix={
|
|
111
|
+
"os": [
|
|
112
|
+
"ubuntu-24.04-arm",
|
|
113
|
+
"ubuntu-24.04",
|
|
114
|
+
"macos-15",
|
|
115
|
+
"macos-13",
|
|
116
|
+
"windows-11-arm",
|
|
117
|
+
"windows-2025"
|
|
118
|
+
],
|
|
119
|
+
"entry_point": ["mpm"],
|
|
120
|
+
"commit": [
|
|
121
|
+
"346ce664f055fbd042a25ee0b7e96702e95",
|
|
122
|
+
"6f27db47612aaee06fdf08744b09a9f5f6c2"
|
|
123
|
+
],
|
|
124
|
+
"include": [
|
|
125
|
+
{
|
|
126
|
+
"target": "linux-arm64",
|
|
127
|
+
"os": "ubuntu-24.04-arm",
|
|
128
|
+
"platform_id": "linux",
|
|
129
|
+
"arch": "arm64",
|
|
130
|
+
"extension": "bin"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"target": "linux-x64",
|
|
134
|
+
"os": "ubuntu-24.04",
|
|
135
|
+
"platform_id": "linux",
|
|
136
|
+
"arch": "x64",
|
|
137
|
+
"extension": "bin"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"target": "macos-arm64",
|
|
141
|
+
"os": "macos-15",
|
|
142
|
+
"platform_id": "macos",
|
|
143
|
+
"arch": "arm64",
|
|
144
|
+
"extension": "bin"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"target": "macos-x64",
|
|
148
|
+
"os": "macos-13",
|
|
149
|
+
"platform_id": "macos",
|
|
150
|
+
"arch": "x64",
|
|
151
|
+
"extension": "bin"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"target": "windows-arm64",
|
|
155
|
+
"os": "windows-11-arm",
|
|
156
|
+
"platform_id": "windows",
|
|
157
|
+
"arch": "arm64",
|
|
158
|
+
"extension": "exe"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"target": "windows-x64",
|
|
162
|
+
"os": "windows-2025",
|
|
163
|
+
"platform_id": "windows",
|
|
164
|
+
"arch": "x64",
|
|
165
|
+
"extension": "exe"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"entry_point": "mpm",
|
|
169
|
+
"cli_id": "mpm",
|
|
170
|
+
"module_id": "meta_package_manager.__main__",
|
|
171
|
+
"callable_id": "main",
|
|
172
|
+
"module_path": "meta_package_manager/__main__.py"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
176
|
+
"short_sha": "346ce66",
|
|
177
|
+
"current_version": "2.0.0"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
181
|
+
"short_sha": "6f27db4",
|
|
182
|
+
"current_version": "1.9.1"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"os": "ubuntu-24.04-arm",
|
|
186
|
+
"entry_point": "mpm",
|
|
187
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
188
|
+
"bin_name": "mpm-linux-arm64-346ce66.bin"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"os": "ubuntu-24.04-arm",
|
|
192
|
+
"entry_point": "mpm",
|
|
193
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
194
|
+
"bin_name": "mpm-linux-arm64-6f27db4.bin"
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"os": "ubuntu-24.04",
|
|
198
|
+
"entry_point": "mpm",
|
|
199
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
200
|
+
"bin_name": "mpm-linux-x64-346ce66.bin"
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"os": "ubuntu-24.04",
|
|
204
|
+
"entry_point": "mpm",
|
|
205
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
206
|
+
"bin_name": "mpm-linux-x64-6f27db4.bin"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"os": "macos-15",
|
|
210
|
+
"entry_point": "mpm",
|
|
211
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
212
|
+
"bin_name": "mpm-macos-arm64-346ce66.bin"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"os": "macos-15",
|
|
216
|
+
"entry_point": "mpm",
|
|
217
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
218
|
+
"bin_name": "mpm-macos-arm64-6f27db4.bin"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"os": "macos-13",
|
|
222
|
+
"entry_point": "mpm",
|
|
223
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
224
|
+
"bin_name": "mpm-macos-x64-346ce66.bin"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"os": "macos-13",
|
|
228
|
+
"entry_point": "mpm",
|
|
229
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
230
|
+
"bin_name": "mpm-macos-x64-6f27db4.bin"
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
"os": "windows-11-arm",
|
|
234
|
+
"entry_point": "mpm",
|
|
235
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
236
|
+
"bin_name": "mpm-windows-arm64-346ce66.bin"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"os": "windows-11-arm",
|
|
240
|
+
"entry_point": "mpm",
|
|
241
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
242
|
+
"bin_name": "mpm-windows-arm64-6f27db4.bin"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"os": "windows-2025",
|
|
246
|
+
"entry_point": "mpm",
|
|
247
|
+
"commit": "346ce664f055fbd042a25ee0b7e96702e95",
|
|
248
|
+
"bin_name": "mpm-windows-x64-346ce66.exe"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"os": "windows-2025",
|
|
252
|
+
"entry_point": "mpm",
|
|
253
|
+
"commit": "6f27db47612aaee06fdf08744b09a9f5f6c2",
|
|
254
|
+
"bin_name": "mpm-windows-x64-6f27db4.exe"
|
|
255
|
+
},
|
|
256
|
+
{"state": "stable"}
|
|
257
|
+
]
|
|
258
|
+
}
|
|
143
259
|
```
|
|
144
260
|
|
|
145
261
|
.. warning::
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
actually formatted this way in the environment file, but inlined.
|
|
262
|
+
Fields with serialized lists and dictionaries, like ``new_commits_matrix``,
|
|
263
|
+
``build_targets`` or ``nuitka_matrix``, are pretty-printed in the example above for
|
|
264
|
+
readability. They are inlined in the actual output and not formatted this way.
|
|
150
265
|
"""
|
|
151
266
|
|
|
152
267
|
from __future__ import annotations
|
|
@@ -166,13 +281,13 @@ from random import randint
|
|
|
166
281
|
from re import escape
|
|
167
282
|
from typing import Any, Final, cast
|
|
168
283
|
|
|
169
|
-
import gitignore_parser
|
|
170
284
|
from bumpversion.config import get_configuration # type: ignore[import-untyped]
|
|
171
285
|
from bumpversion.config.files import find_config_file # type: ignore[import-untyped]
|
|
172
286
|
from bumpversion.show import resolve_name # type: ignore[import-untyped]
|
|
173
287
|
from extra_platforms import is_github_ci
|
|
174
288
|
from packaging.specifiers import SpecifierSet
|
|
175
289
|
from packaging.version import Version
|
|
290
|
+
from py_walk import get_parser_from_file
|
|
176
291
|
from pydriller import Commit, Git, Repository # type: ignore[import-untyped]
|
|
177
292
|
from pyproject_metadata import ConfigurationError, StandardMetadata
|
|
178
293
|
from wcmatch.glob import (
|
|
@@ -269,6 +384,13 @@ Values are dictionaries with the following keys:
|
|
|
269
384
|
"""
|
|
270
385
|
|
|
271
386
|
|
|
387
|
+
FLAT_BUILD_TARGETS = [
|
|
388
|
+
{"target": target_id} | target_data
|
|
389
|
+
for target_id, target_data in NUITKA_BUILD_TARGETS.items()
|
|
390
|
+
]
|
|
391
|
+
"""List of build targets in a flat format, suitable for matrix inclusion."""
|
|
392
|
+
|
|
393
|
+
|
|
272
394
|
WorkflowEvent = StrEnum(
|
|
273
395
|
"WorkflowEvent",
|
|
274
396
|
(
|
|
@@ -339,6 +461,7 @@ class TargetVersion(StrEnum):
|
|
|
339
461
|
PY311 = "3.11"
|
|
340
462
|
PY312 = "3.12"
|
|
341
463
|
PY313 = "3.13"
|
|
464
|
+
PY314 = "3.14"
|
|
342
465
|
|
|
343
466
|
|
|
344
467
|
MYPY_VERSION_MIN: Final = (3, 8)
|
|
@@ -570,6 +693,31 @@ class Metadata:
|
|
|
570
693
|
return WorkflowEvent.pull_request
|
|
571
694
|
return WorkflowEvent.push
|
|
572
695
|
|
|
696
|
+
@cached_property
|
|
697
|
+
def event_actor(self) -> str | None:
|
|
698
|
+
"""Returns the GitHub login of the user that triggered the workflow run."""
|
|
699
|
+
return self.github_context.get("actor")
|
|
700
|
+
|
|
701
|
+
@cached_property
|
|
702
|
+
def event_sender_type(self) -> str | None:
|
|
703
|
+
"""Returns the type of the user that triggered the workflow run."""
|
|
704
|
+
sender_type = self.github_context.get("event", {}).get("sender", {}).get("type")
|
|
705
|
+
return cast(str | None, sender_type)
|
|
706
|
+
|
|
707
|
+
@cached_property
|
|
708
|
+
def is_bot(self) -> bool:
|
|
709
|
+
"""Returns ``True`` if the workflow was triggered by a bot or automated process.
|
|
710
|
+
|
|
711
|
+
This is useful to only run some jobs on human-triggered events. Or skip jobs
|
|
712
|
+
triggered by bots to avoid infinite loops.
|
|
713
|
+
"""
|
|
714
|
+
if self.event_sender_type == "Bot" or self.event_actor in (
|
|
715
|
+
"dependabot[bot]",
|
|
716
|
+
"dependabot-preview[bot]",
|
|
717
|
+
):
|
|
718
|
+
return True
|
|
719
|
+
return False
|
|
720
|
+
|
|
573
721
|
@cached_property
|
|
574
722
|
def commit_range(self) -> tuple[str, str] | None:
|
|
575
723
|
"""Range of commits bundled within the triggering event.
|
|
@@ -734,7 +882,7 @@ class Metadata:
|
|
|
734
882
|
gitignore = None
|
|
735
883
|
if self.gitignore_exists:
|
|
736
884
|
logging.debug(f"Load {GITIGNORE_PATH} to filter out ignored files.")
|
|
737
|
-
gitignore =
|
|
885
|
+
gitignore = get_parser_from_file(GITIGNORE_PATH)
|
|
738
886
|
|
|
739
887
|
for file_path in iglob(
|
|
740
888
|
patterns,
|
|
@@ -765,7 +913,7 @@ class Metadata:
|
|
|
765
913
|
continue
|
|
766
914
|
|
|
767
915
|
# Skip files that are ignored by .gitignore.
|
|
768
|
-
if gitignore and gitignore(file_path):
|
|
916
|
+
if gitignore and gitignore.match(file_path):
|
|
769
917
|
logging.debug(f"Skip file matching {GITIGNORE_PATH}: {file_path}")
|
|
770
918
|
continue
|
|
771
919
|
|
|
@@ -775,12 +923,33 @@ class Metadata:
|
|
|
775
923
|
@cached_property
|
|
776
924
|
def python_files(self) -> list[Path]:
|
|
777
925
|
"""Returns a list of python files."""
|
|
778
|
-
return self.glob_files("**/*.py
|
|
926
|
+
return self.glob_files("**/*.{py,pyi,pyw,pyx,ipynb}")
|
|
927
|
+
|
|
928
|
+
@cached_property
|
|
929
|
+
def json_files(self) -> list[Path]:
|
|
930
|
+
"""Returns a list of JSON files."""
|
|
931
|
+
return self.glob_files(
|
|
932
|
+
"**/*.{json,jsonc,json5}",
|
|
933
|
+
"**/.code-workspace",
|
|
934
|
+
"!**/package-lock.json",
|
|
935
|
+
)
|
|
779
936
|
|
|
780
937
|
@cached_property
|
|
781
938
|
def doc_files(self) -> list[Path]:
|
|
782
939
|
"""Returns a list of doc files."""
|
|
783
|
-
return self.glob_files(
|
|
940
|
+
return self.glob_files(
|
|
941
|
+
"**/*.{markdown,mdown,mkdn,mdwn,mkd,md,mdtxt,mdtext,rst,tex}"
|
|
942
|
+
)
|
|
943
|
+
|
|
944
|
+
@cached_property
|
|
945
|
+
def markdown_files(self) -> list[Path]:
|
|
946
|
+
"""Returns a list of Markdown files."""
|
|
947
|
+
return self.glob_files("**/*.{markdown,mdown,mkdn,mdwn,mkd,md,mdtxt,mdtext}")
|
|
948
|
+
|
|
949
|
+
@cached_property
|
|
950
|
+
def zsh_files(self) -> list[Path]:
|
|
951
|
+
"""Returns a list of Zsh files."""
|
|
952
|
+
return self.glob_files("**/*.{sh,zsh}", "**/.{zshrc,zprofile,zshenv,zlogin}")
|
|
784
953
|
|
|
785
954
|
@cached_property
|
|
786
955
|
def is_python_project(self):
|
|
@@ -1186,8 +1355,8 @@ class Metadata:
|
|
|
1186
1355
|
"os", tuple(map(itemgetter("os"), NUITKA_BUILD_TARGETS.values()))
|
|
1187
1356
|
)
|
|
1188
1357
|
# Augment each "os" entry with platform-specific data.
|
|
1189
|
-
for
|
|
1190
|
-
matrix.add_includes(
|
|
1358
|
+
for target_data in FLAT_BUILD_TARGETS:
|
|
1359
|
+
matrix.add_includes(target_data)
|
|
1191
1360
|
|
|
1192
1361
|
# Augment each entry point with some metadata.
|
|
1193
1362
|
for cli_id, module_id, callable_id in self.script_entries:
|
|
@@ -1289,9 +1458,9 @@ class Metadata:
|
|
|
1289
1458
|
- `None` into empty string
|
|
1290
1459
|
- `bool` into lower-cased string
|
|
1291
1460
|
- `Matrix` into JSON string
|
|
1292
|
-
- `Iterable` of strings into a serialized space-separated
|
|
1293
|
-
|
|
1294
|
-
|
|
1461
|
+
- `Iterable` of mixed strings and `Path` into a serialized space-separated
|
|
1462
|
+
string, where `Path` items are double-quoted
|
|
1463
|
+
- other `Iterable` into a JSON string
|
|
1295
1464
|
"""
|
|
1296
1465
|
# Structured metadata to be rendered as JSON.
|
|
1297
1466
|
if isinstance(value, Matrix):
|
|
@@ -1309,9 +1478,26 @@ class Metadata:
|
|
|
1309
1478
|
raise NotImplementedError
|
|
1310
1479
|
|
|
1311
1480
|
elif isinstance(value, Iterable):
|
|
1312
|
-
# Cast all items to
|
|
1313
|
-
|
|
1314
|
-
|
|
1481
|
+
# Cast all items to strings, wrapping Path items with double-quotes.
|
|
1482
|
+
if all(isinstance(i, (str, Path)) for i in value):
|
|
1483
|
+
items = (
|
|
1484
|
+
(f'"{i}"' if isinstance(i, Path) else str(i)) for i in value
|
|
1485
|
+
)
|
|
1486
|
+
value = " ".join(items)
|
|
1487
|
+
# XXX We only support iterables of dict[str, str] for now.
|
|
1488
|
+
else:
|
|
1489
|
+
assert all(
|
|
1490
|
+
isinstance(i, dict)
|
|
1491
|
+
and all(
|
|
1492
|
+
isinstance(k, str) and isinstance(v, str)
|
|
1493
|
+
for k, v in i.items()
|
|
1494
|
+
)
|
|
1495
|
+
for i in value
|
|
1496
|
+
), f"Unsupported iterable value: {value!r}"
|
|
1497
|
+
value = json.dumps(value)
|
|
1498
|
+
|
|
1499
|
+
else:
|
|
1500
|
+
raise NotImplementedError(f"GitHub formatting for: {value!r}")
|
|
1315
1501
|
|
|
1316
1502
|
return cast(str, value)
|
|
1317
1503
|
|
|
@@ -1321,11 +1507,15 @@ class Metadata:
|
|
|
1321
1507
|
Defaults to GitHub dialect.
|
|
1322
1508
|
"""
|
|
1323
1509
|
metadata: dict[str, Any] = {
|
|
1510
|
+
"is_bot": self.is_bot,
|
|
1324
1511
|
"new_commits": self.new_commits_hash,
|
|
1325
1512
|
"release_commits": self.release_commits_hash,
|
|
1326
1513
|
"gitignore_exists": self.gitignore_exists,
|
|
1327
1514
|
"python_files": self.python_files,
|
|
1515
|
+
"json_files": self.json_files,
|
|
1328
1516
|
"doc_files": self.doc_files,
|
|
1517
|
+
"markdown_files": self.markdown_files,
|
|
1518
|
+
"zsh_files": self.zsh_files,
|
|
1329
1519
|
"is_python_project": self.is_python_project,
|
|
1330
1520
|
"package_name": self.package_name,
|
|
1331
1521
|
"blacken_docs_params": self.blacken_docs_params,
|
|
@@ -1337,6 +1527,7 @@ class Metadata:
|
|
|
1337
1527
|
"release_notes": self.release_notes,
|
|
1338
1528
|
"new_commits_matrix": self.new_commits_matrix,
|
|
1339
1529
|
"release_commits_matrix": self.release_commits_matrix,
|
|
1530
|
+
"build_targets": FLAT_BUILD_TARGETS,
|
|
1340
1531
|
"nuitka_matrix": self.nuitka_matrix,
|
|
1341
1532
|
}
|
|
1342
1533
|
|
|
@@ -1353,7 +1544,7 @@ class Metadata:
|
|
|
1353
1544
|
content += f"{env_name}={env_value}\n"
|
|
1354
1545
|
else:
|
|
1355
1546
|
# Use a random unique delimiter to encode multiline value:
|
|
1356
|
-
delimiter = f"
|
|
1547
|
+
delimiter = f"GHA_DELIMITER_{randint(10**8, (10**9) - 1)}"
|
|
1357
1548
|
content += f"{env_name}<<{delimiter}\n{env_value}\n{delimiter}\n"
|
|
1358
1549
|
else:
|
|
1359
1550
|
assert dialect == Dialects.json
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gha-utils
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.20.0
|
|
4
4
|
Summary: ⚙️ CLI helpers for GitHub Actions + reuseable workflows
|
|
5
5
|
Author-email: Kevin Deldycke <kevin@deldycke.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/kdeldycke/workflows
|
|
@@ -18,10 +18,14 @@ Classifier: License :: OSI Approved :: GNU General Public License v2 or later (G
|
|
|
18
18
|
Classifier: Operating System :: MacOS :: MacOS X
|
|
19
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
20
20
|
Classifier: Operating System :: POSIX :: Linux
|
|
21
|
+
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
|
|
22
|
+
Classifier: Operating System :: POSIX :: BSD :: NetBSD
|
|
23
|
+
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
|
|
21
24
|
Classifier: Programming Language :: Python :: 3
|
|
22
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
26
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
27
|
Classifier: Programming Language :: Python :: 3.13
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
25
29
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
26
30
|
Classifier: Programming Language :: Unix Shell
|
|
27
31
|
Classifier: Topic :: Documentation :: Sphinx
|
|
@@ -46,10 +50,10 @@ Requires-Python: >=3.11
|
|
|
46
50
|
Description-Content-Type: text/markdown
|
|
47
51
|
Requires-Dist: boltons>=24.0.0
|
|
48
52
|
Requires-Dist: bump-my-version<1.1.1,>=0.32.2
|
|
49
|
-
Requires-Dist: click-extra~=
|
|
53
|
+
Requires-Dist: click-extra~=6.0.0
|
|
50
54
|
Requires-Dist: extra-platforms~=3.2.0
|
|
51
|
-
Requires-Dist: gitignore-parser~=0.1.13
|
|
52
55
|
Requires-Dist: packaging~=25.0
|
|
56
|
+
Requires-Dist: py-walk~=0.3.3
|
|
53
57
|
Requires-Dist: PyDriller~=2.6
|
|
54
58
|
Requires-Dist: pyproject-metadata~=0.9.0
|
|
55
59
|
Requires-Dist: pyyaml~=6.0.0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
# Docs: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
|
|
3
3
|
name = "gha-utils"
|
|
4
|
-
version = "4.
|
|
4
|
+
version = "4.20.0"
|
|
5
5
|
# Python versions and their status: https://devguide.python.org/versions/
|
|
6
6
|
requires-python = ">= 3.11"
|
|
7
7
|
description = "⚙️ CLI helpers for GitHub Actions + reuseable workflows"
|
|
@@ -41,10 +41,14 @@ classifiers = [
|
|
|
41
41
|
'Operating System :: MacOS :: MacOS X',
|
|
42
42
|
'Operating System :: Microsoft :: Windows',
|
|
43
43
|
'Operating System :: POSIX :: Linux',
|
|
44
|
+
"Operating System :: POSIX :: BSD :: FreeBSD",
|
|
45
|
+
"Operating System :: POSIX :: BSD :: NetBSD",
|
|
46
|
+
"Operating System :: POSIX :: BSD :: OpenBSD",
|
|
44
47
|
"Programming Language :: Python :: 3",
|
|
45
48
|
"Programming Language :: Python :: 3.11",
|
|
46
49
|
"Programming Language :: Python :: 3.12",
|
|
47
50
|
"Programming Language :: Python :: 3.13",
|
|
51
|
+
"Programming Language :: Python :: 3.14",
|
|
48
52
|
'Programming Language :: Python :: Implementation :: CPython',
|
|
49
53
|
'Programming Language :: Unix Shell',
|
|
50
54
|
'Topic :: Documentation :: Sphinx',
|
|
@@ -74,12 +78,13 @@ dependencies = [
|
|
|
74
78
|
# v0.32.2 is the first fixing an issue preventing compilation with Nuitka.
|
|
75
79
|
# v1.1.1 and later have some regressions: see https://github.com/callowayproject/bump-my-version/issues/331
|
|
76
80
|
"bump-my-version >= 0.32.2, < 1.1.1",
|
|
77
|
-
|
|
81
|
+
# Click Extra 6.0.0 fix an isue with --version option.
|
|
82
|
+
"click-extra ~= 6.0.0",
|
|
78
83
|
"extra-platforms ~= 3.2.0",
|
|
79
|
-
# In the future, replace gitignore-parser with wcmatch once the latter supports gitignore files:
|
|
80
|
-
# https://github.com/facelessuser/wcmatch/issues/226
|
|
81
|
-
"gitignore-parser ~= 0.1.13",
|
|
82
84
|
"packaging ~= 25.0",
|
|
85
|
+
# In the future, replace py-walk with wcmatch once the latter supports gitignore files:
|
|
86
|
+
# https://github.com/facelessuser/wcmatch/issues/226
|
|
87
|
+
"py-walk ~= 0.3.3",
|
|
83
88
|
"PyDriller ~= 2.6",
|
|
84
89
|
"pyproject-metadata ~= 0.9.0",
|
|
85
90
|
"pyyaml ~= 6.0.0",
|
|
@@ -121,7 +126,7 @@ pretty = true
|
|
|
121
126
|
|
|
122
127
|
[[tool.mypy.overrides]]
|
|
123
128
|
ignore_missing_imports = true
|
|
124
|
-
module = ["
|
|
129
|
+
module = ["py_walk.*"]
|
|
125
130
|
|
|
126
131
|
[tool.pytest.ini_options]
|
|
127
132
|
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
|
|
@@ -139,7 +144,7 @@ addopts = [
|
|
|
139
144
|
xfail_strict = true
|
|
140
145
|
|
|
141
146
|
[tool.bumpversion]
|
|
142
|
-
current_version = "4.
|
|
147
|
+
current_version = "4.20.0"
|
|
143
148
|
allow_dirty = true
|
|
144
149
|
ignore_missing_files = true
|
|
145
150
|
|
|
@@ -87,6 +87,7 @@ def iter_checks(metadata: Any, expected: Any, context: Any) -> None:
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
expected = {
|
|
90
|
+
"is_bot": False,
|
|
90
91
|
"new_commits": None,
|
|
91
92
|
"release_commits": None,
|
|
92
93
|
"gitignore_exists": True,
|
|
@@ -121,6 +122,7 @@ expected = {
|
|
|
121
122
|
"tests/test_matrix.py",
|
|
122
123
|
"tests/test_metadata.py",
|
|
123
124
|
],
|
|
125
|
+
"json_files": [],
|
|
124
126
|
"doc_files": [
|
|
125
127
|
".github\\code-of-conduct.md",
|
|
126
128
|
"changelog.md",
|
|
@@ -132,9 +134,26 @@ expected = {
|
|
|
132
134
|
"changelog.md",
|
|
133
135
|
"readme.md",
|
|
134
136
|
],
|
|
137
|
+
"markdown_files": [
|
|
138
|
+
".github\\code-of-conduct.md",
|
|
139
|
+
"changelog.md",
|
|
140
|
+
"readme.md",
|
|
141
|
+
]
|
|
142
|
+
if is_windows()
|
|
143
|
+
else [
|
|
144
|
+
".github/code-of-conduct.md",
|
|
145
|
+
"changelog.md",
|
|
146
|
+
"readme.md",
|
|
147
|
+
],
|
|
148
|
+
"zsh_files": [],
|
|
135
149
|
"is_python_project": True,
|
|
136
150
|
"package_name": "gha-utils",
|
|
137
|
-
"blacken_docs_params":
|
|
151
|
+
"blacken_docs_params": (
|
|
152
|
+
"--target-version py311 "
|
|
153
|
+
"--target-version py312 "
|
|
154
|
+
"--target-version py313 "
|
|
155
|
+
"--target-version py314"
|
|
156
|
+
),
|
|
138
157
|
"mypy_params": "--python-version 3.11",
|
|
139
158
|
"current_version": regex(r"[0-9\.]+"),
|
|
140
159
|
"released_version": None,
|
|
@@ -148,6 +167,50 @@ expected = {
|
|
|
148
167
|
),
|
|
149
168
|
"new_commits_matrix": None,
|
|
150
169
|
"release_commits_matrix": None,
|
|
170
|
+
"build_targets": [
|
|
171
|
+
{
|
|
172
|
+
"target": "linux-arm64",
|
|
173
|
+
"os": "ubuntu-24.04-arm",
|
|
174
|
+
"platform_id": "linux",
|
|
175
|
+
"arch": "arm64",
|
|
176
|
+
"extension": "bin",
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
"target": "linux-x64",
|
|
180
|
+
"os": "ubuntu-24.04",
|
|
181
|
+
"platform_id": "linux",
|
|
182
|
+
"arch": "x64",
|
|
183
|
+
"extension": "bin",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"target": "macos-arm64",
|
|
187
|
+
"os": "macos-15",
|
|
188
|
+
"platform_id": "macos",
|
|
189
|
+
"arch": "arm64",
|
|
190
|
+
"extension": "bin",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"target": "macos-x64",
|
|
194
|
+
"os": "macos-13",
|
|
195
|
+
"platform_id": "macos",
|
|
196
|
+
"arch": "x64",
|
|
197
|
+
"extension": "bin",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"target": "windows-arm64",
|
|
201
|
+
"os": "windows-11-arm",
|
|
202
|
+
"platform_id": "windows",
|
|
203
|
+
"arch": "arm64",
|
|
204
|
+
"extension": "exe",
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"target": "windows-x64",
|
|
208
|
+
"os": "windows-2025",
|
|
209
|
+
"platform_id": "windows",
|
|
210
|
+
"arch": "x64",
|
|
211
|
+
"extension": "exe",
|
|
212
|
+
},
|
|
213
|
+
],
|
|
151
214
|
"nuitka_matrix": {
|
|
152
215
|
"os": [
|
|
153
216
|
"ubuntu-24.04-arm",
|
|
@@ -301,14 +364,14 @@ def test_metadata_github_format():
|
|
|
301
364
|
# Check the delimiter syntax.
|
|
302
365
|
assert line.count("<<") == 1
|
|
303
366
|
acc_key, acc_delimiter = line.split("<<", 1)
|
|
304
|
-
assert re.fullmatch(r"
|
|
367
|
+
assert re.fullmatch(r"GHA_DELIMITER_[0-9]+", acc_delimiter)
|
|
305
368
|
continue
|
|
306
369
|
|
|
307
370
|
# We are at a simple key-value pair.
|
|
308
371
|
if "=" in line:
|
|
309
372
|
key, value = line.split("=", 1)
|
|
310
|
-
# Convert dict-like JSON string into Python
|
|
311
|
-
if value.startswith("{"):
|
|
373
|
+
# Convert list-like and dict-like JSON string into Python objects.
|
|
374
|
+
if value.startswith(("[", "{")):
|
|
312
375
|
value = json.loads(value)
|
|
313
376
|
metadata[key] = value
|
|
314
377
|
continue
|
|
@@ -326,7 +389,7 @@ def test_metadata_github_format():
|
|
|
326
389
|
new_value = ""
|
|
327
390
|
elif isinstance(value, bool):
|
|
328
391
|
new_value = str(value).lower()
|
|
329
|
-
elif isinstance(value, list):
|
|
392
|
+
elif isinstance(value, list) and all(isinstance(i, str) for i in value):
|
|
330
393
|
new_value = " ".join(f'"{i}"' for i in value)
|
|
331
394
|
github_format_expected[key] = new_value
|
|
332
395
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|