gha-utils 4.21.0__py3-none-any.whl → 4.22.0__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.
Potentially problematic release.
This version of gha-utils might be problematic. Click here for more details.
- gha_utils/__init__.py +1 -1
- gha_utils/metadata.py +20 -2
- gha_utils/test_plan.py +6 -4
- {gha_utils-4.21.0.dist-info → gha_utils-4.22.0.dist-info}/METADATA +2 -2
- gha_utils-4.22.0.dist-info/RECORD +14 -0
- gha_utils-4.21.0.dist-info/RECORD +0 -14
- {gha_utils-4.21.0.dist-info → gha_utils-4.22.0.dist-info}/WHEEL +0 -0
- {gha_utils-4.21.0.dist-info → gha_utils-4.22.0.dist-info}/entry_points.txt +0 -0
- {gha_utils-4.21.0.dist-info → gha_utils-4.22.0.dist-info}/top_level.txt +0 -0
gha_utils/__init__.py
CHANGED
gha_utils/metadata.py
CHANGED
|
@@ -31,6 +31,7 @@ yaml_files="config.yaml" ".github/workflows/lint.yaml" ".github/workflows/test.y
|
|
|
31
31
|
workflow_files=".github/workflows/lint.yaml" ".github/workflows/test.yaml"
|
|
32
32
|
doc_files="changelog.md" "readme.md" "docs/license.md"
|
|
33
33
|
markdown_files="changelog.md" "readme.md" "docs/license.md"
|
|
34
|
+
image_files=
|
|
34
35
|
zsh_files=
|
|
35
36
|
is_python_project=true
|
|
36
37
|
package_name=click-extra
|
|
@@ -736,7 +737,7 @@ class Metadata:
|
|
|
736
737
|
return False
|
|
737
738
|
|
|
738
739
|
@cached_property
|
|
739
|
-
def commit_range(self) -> tuple[str, str] | None:
|
|
740
|
+
def commit_range(self) -> tuple[str | None, str] | None:
|
|
740
741
|
"""Range of commits bundled within the triggering event.
|
|
741
742
|
|
|
742
743
|
A workflow run is triggered by a singular event, which might encapsulate one or
|
|
@@ -783,7 +784,7 @@ class Metadata:
|
|
|
783
784
|
end = self.github_context["event"]["pull_request"]["head"]["sha"]
|
|
784
785
|
# Push event.
|
|
785
786
|
else:
|
|
786
|
-
start = self.github_context["event"]
|
|
787
|
+
start = self.github_context["event"].get("before")
|
|
787
788
|
end = os.environ["GITHUB_SHA"]
|
|
788
789
|
assert end
|
|
789
790
|
logging.debug(f"Commit range: {start} -> {end}")
|
|
@@ -811,6 +812,8 @@ class Metadata:
|
|
|
811
812
|
# inclusive), we still need to make sure it exists: PyDriller stills needs to
|
|
812
813
|
# find it to be able to traverse the commit history.
|
|
813
814
|
for commit_id in (start, end):
|
|
815
|
+
if not commit_id:
|
|
816
|
+
continue
|
|
814
817
|
try:
|
|
815
818
|
_ = self.git.get_commit(commit_id)
|
|
816
819
|
except ValueError:
|
|
@@ -824,6 +827,11 @@ class Metadata:
|
|
|
824
827
|
)
|
|
825
828
|
return None
|
|
826
829
|
|
|
830
|
+
if not start:
|
|
831
|
+
logging.warning("No start commit found. Only one commit in range.")
|
|
832
|
+
assert end
|
|
833
|
+
return (self.git.get_commit(end),)
|
|
834
|
+
|
|
827
835
|
commit_list = []
|
|
828
836
|
for index, commit in enumerate(
|
|
829
837
|
Repository(".", from_commit=start, to_commit=end).traverse_commits()
|
|
@@ -1003,6 +1011,15 @@ class Metadata:
|
|
|
1003
1011
|
"""Returns a list of Markdown files."""
|
|
1004
1012
|
return self.glob_files("**/*.{markdown,mdown,mkdn,mdwn,mkd,md,mdtxt,mdtext}")
|
|
1005
1013
|
|
|
1014
|
+
@cached_property
|
|
1015
|
+
def image_files(self) -> list[Path]:
|
|
1016
|
+
"""Returns a list of image files.
|
|
1017
|
+
|
|
1018
|
+
Inspired by the list of image extensions supported by calibre's image-actions:
|
|
1019
|
+
https://github.com/calibreapp/image-actions/blob/f325757/src/constants.ts#L32
|
|
1020
|
+
"""
|
|
1021
|
+
return self.glob_files("**/*.{jpeg,jpg,png,webp,avif}")
|
|
1022
|
+
|
|
1006
1023
|
@cached_property
|
|
1007
1024
|
def zsh_files(self) -> list[Path]:
|
|
1008
1025
|
"""Returns a list of Zsh files."""
|
|
@@ -1575,6 +1592,7 @@ class Metadata:
|
|
|
1575
1592
|
"workflow_files": self.workflow_files,
|
|
1576
1593
|
"doc_files": self.doc_files,
|
|
1577
1594
|
"markdown_files": self.markdown_files,
|
|
1595
|
+
"image_files": self.image_files,
|
|
1578
1596
|
"zsh_files": self.zsh_files,
|
|
1579
1597
|
"is_python_project": self.is_python_project,
|
|
1580
1598
|
"package_name": self.package_name,
|
gha_utils/test_plan.py
CHANGED
|
@@ -28,7 +28,11 @@ from typing import Generator, Sequence
|
|
|
28
28
|
import yaml
|
|
29
29
|
from boltons.iterutils import flatten
|
|
30
30
|
from boltons.strutils import strip_ansi
|
|
31
|
-
from click_extra.testing import
|
|
31
|
+
from click_extra.testing import (
|
|
32
|
+
args_cleanup,
|
|
33
|
+
regex_fullmatch_line_by_line,
|
|
34
|
+
render_cli_run,
|
|
35
|
+
)
|
|
32
36
|
from extra_platforms import Group, _TNestedReferences, current_os
|
|
33
37
|
|
|
34
38
|
|
|
@@ -265,9 +269,7 @@ class CLITestCase:
|
|
|
265
269
|
raise AssertionError(f"{name} does not match regex {regex}")
|
|
266
270
|
|
|
267
271
|
elif field_id.endswith("_regex_fullmatch"):
|
|
268
|
-
|
|
269
|
-
if not regex.fullmatch(output):
|
|
270
|
-
raise AssertionError(f"{name} does not fully match regex {regex}")
|
|
272
|
+
regex_fullmatch_line_by_line(field_data, output)
|
|
271
273
|
|
|
272
274
|
|
|
273
275
|
DEFAULT_TEST_PLAN: list[CLITestCase] = [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gha-utils
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.22.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
|
|
@@ -50,7 +50,7 @@ Requires-Python: >=3.11
|
|
|
50
50
|
Description-Content-Type: text/markdown
|
|
51
51
|
Requires-Dist: boltons>=24.0.0
|
|
52
52
|
Requires-Dist: bump-my-version<1.1.1,>=0.32.2
|
|
53
|
-
Requires-Dist: click-extra~=6.0.
|
|
53
|
+
Requires-Dist: click-extra~=6.0.2
|
|
54
54
|
Requires-Dist: extra-platforms~=3.2.0
|
|
55
55
|
Requires-Dist: packaging~=25.0
|
|
56
56
|
Requires-Dist: py-walk~=0.3.3
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
gha_utils/__init__.py,sha256=gNHVP8cQ0XbGUYqL65Qc0zhxC3_Wstfs0IOorioqYeQ,866
|
|
2
|
+
gha_utils/__main__.py,sha256=Dck9BjpLXmIRS83k0mghAMcYVYiMiFLltQdfRuMSP_Q,1703
|
|
3
|
+
gha_utils/changelog.py,sha256=JR7iQrWjLoIOpVNe6iXQSyEii82_hM_zrYpR7QO_Uxo,5777
|
|
4
|
+
gha_utils/cli.py,sha256=hwvjKEUvctmtJL2aliV0dytF67uHjGVuUKv17j_lMlg,15235
|
|
5
|
+
gha_utils/mailmap.py,sha256=oQt3m0hj-mwg7WxsuJQXWeQTFjlkqTgRNjYsUv7dlYQ,7013
|
|
6
|
+
gha_utils/matrix.py,sha256=eBAU3bKrCif7FQ74EWhK_AwDcNUkGp8Om1NtlFdYJpI,12431
|
|
7
|
+
gha_utils/metadata.py,sha256=NHyBZ5rAI1DNvpfNC5PMlagTYL-rCSz5KUghldGCkMA,59491
|
|
8
|
+
gha_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
gha_utils/test_plan.py,sha256=NDmh1uuKPyqswIRykKpE7sZ1W0hcVBlYSwsQ3F21HUQ,13336
|
|
10
|
+
gha_utils-4.22.0.dist-info/METADATA,sha256=tNtxQmSSLnFz-0fkHzy30zKe2fDQ_ylpE4_5UkdRocY,21420
|
|
11
|
+
gha_utils-4.22.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
gha_utils-4.22.0.dist-info/entry_points.txt,sha256=8bJOwQYf9ZqsLhBR6gUCzvwLNI9f8tiiBrJ3AR0EK4o,54
|
|
13
|
+
gha_utils-4.22.0.dist-info/top_level.txt,sha256=C94Blb61YkkyPBwCdM3J_JPDjWH0lnKa5nGZeZ5M6yE,10
|
|
14
|
+
gha_utils-4.22.0.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
gha_utils/__init__.py,sha256=HCe5G0ysXtBmQ8s34Mi5DeYCvYLFSPYzWcV4pPfYdGw,866
|
|
2
|
-
gha_utils/__main__.py,sha256=Dck9BjpLXmIRS83k0mghAMcYVYiMiFLltQdfRuMSP_Q,1703
|
|
3
|
-
gha_utils/changelog.py,sha256=JR7iQrWjLoIOpVNe6iXQSyEii82_hM_zrYpR7QO_Uxo,5777
|
|
4
|
-
gha_utils/cli.py,sha256=hwvjKEUvctmtJL2aliV0dytF67uHjGVuUKv17j_lMlg,15235
|
|
5
|
-
gha_utils/mailmap.py,sha256=oQt3m0hj-mwg7WxsuJQXWeQTFjlkqTgRNjYsUv7dlYQ,7013
|
|
6
|
-
gha_utils/matrix.py,sha256=eBAU3bKrCif7FQ74EWhK_AwDcNUkGp8Om1NtlFdYJpI,12431
|
|
7
|
-
gha_utils/metadata.py,sha256=hySTDkjPS2NMKvFlmEmpy4F7rwrjmST_ZiygmF9OOZk,58839
|
|
8
|
-
gha_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
gha_utils/test_plan.py,sha256=AE8Mf1vSQG5EZTytoTts-gzMwUg2Zy21gUwkMlzXT94,13394
|
|
10
|
-
gha_utils-4.21.0.dist-info/METADATA,sha256=tdjkQaFwLnJUNm-3K8lOi4crw_n_HQWn-CNtW6BaD08,21420
|
|
11
|
-
gha_utils-4.21.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
gha_utils-4.21.0.dist-info/entry_points.txt,sha256=8bJOwQYf9ZqsLhBR6gUCzvwLNI9f8tiiBrJ3AR0EK4o,54
|
|
13
|
-
gha_utils-4.21.0.dist-info/top_level.txt,sha256=C94Blb61YkkyPBwCdM3J_JPDjWH0lnKa5nGZeZ5M6yE,10
|
|
14
|
-
gha_utils-4.21.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|