gha-utils 4.21.0__tar.gz → 4.22.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.

Files changed (23) hide show
  1. {gha_utils-4.21.0 → gha_utils-4.22.0}/PKG-INFO +2 -2
  2. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/__init__.py +1 -1
  3. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/metadata.py +20 -2
  4. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/test_plan.py +6 -4
  5. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/PKG-INFO +2 -2
  6. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/requires.txt +1 -1
  7. {gha_utils-4.21.0 → gha_utils-4.22.0}/pyproject.toml +4 -4
  8. {gha_utils-4.21.0 → gha_utils-4.22.0}/tests/test_metadata.py +3 -0
  9. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/__main__.py +0 -0
  10. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/changelog.py +0 -0
  11. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/cli.py +0 -0
  12. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/mailmap.py +0 -0
  13. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/matrix.py +0 -0
  14. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils/py.typed +0 -0
  15. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/SOURCES.txt +0 -0
  16. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/dependency_links.txt +0 -0
  17. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/entry_points.txt +0 -0
  18. {gha_utils-4.21.0 → gha_utils-4.22.0}/gha_utils.egg-info/top_level.txt +0 -0
  19. {gha_utils-4.21.0 → gha_utils-4.22.0}/readme.md +0 -0
  20. {gha_utils-4.21.0 → gha_utils-4.22.0}/setup.cfg +0 -0
  21. {gha_utils-4.21.0 → gha_utils-4.22.0}/tests/test_changelog.py +0 -0
  22. {gha_utils-4.21.0 → gha_utils-4.22.0}/tests/test_mailmap.py +0 -0
  23. {gha_utils-4.21.0 → gha_utils-4.22.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.21.0
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.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
@@ -17,4 +17,4 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- __version__ = "4.21.0"
20
+ __version__ = "4.22.0"
@@ -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"]["before"]
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,
@@ -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 args_cleanup, render_cli_run
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
- regex = field_data
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.21.0
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.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
@@ -1,6 +1,6 @@
1
1
  boltons>=24.0.0
2
2
  bump-my-version<1.1.1,>=0.32.2
3
- click-extra~=6.0.0
3
+ click-extra~=6.0.2
4
4
  extra-platforms~=3.2.0
5
5
  packaging~=25.0
6
6
  py-walk~=0.3.3
@@ -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.21.0"
4
+ version = "4.22.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"
@@ -78,8 +78,8 @@ dependencies = [
78
78
  # v0.32.2 is the first fixing an issue preventing compilation with Nuitka.
79
79
  # v1.1.1 and later have some regressions: see https://github.com/callowayproject/bump-my-version/issues/331
80
80
  "bump-my-version >= 0.32.2, < 1.1.1",
81
- # Click Extra 6.0.0 fix an isue with --version option.
82
- "click-extra ~= 6.0.0",
81
+ # Click Extra 6.0.2 adds a new regex_fullmatch_line_by_line() function we rely on.
82
+ "click-extra ~= 6.0.2",
83
83
  "extra-platforms ~= 3.2.0",
84
84
  "packaging ~= 25.0",
85
85
  # In the future, replace py-walk with wcmatch once the latter supports gitignore files:
@@ -146,7 +146,7 @@ addopts = [
146
146
  xfail_strict = true
147
147
 
148
148
  [tool.bumpversion]
149
- current_version = "4.21.0"
149
+ current_version = "4.22.0"
150
150
  allow_dirty = true
151
151
  ignore_missing_files = true
152
152
 
@@ -163,6 +163,9 @@ expected = {
163
163
  "changelog.md",
164
164
  "readme.md",
165
165
  ],
166
+ "image_files": [
167
+ "docs/assets/repo-workflow-permissions.png",
168
+ ],
166
169
  "zsh_files": [],
167
170
  "is_python_project": True,
168
171
  "package_name": "gha-utils",
File without changes
File without changes
File without changes