gha-utils 4.18.0__tar.gz → 4.19.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.18.0 → gha_utils-4.19.0}/PKG-INFO +22 -26
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/__init__.py +1 -1
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/matrix.py +6 -6
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/metadata.py +21 -30
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/PKG-INFO +22 -26
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/requires.txt +5 -4
- {gha_utils-4.18.0 → gha_utils-4.19.0}/pyproject.toml +10 -9
- {gha_utils-4.18.0 → gha_utils-4.19.0}/readme.md +16 -21
- {gha_utils-4.18.0 → gha_utils-4.19.0}/tests/test_metadata.py +12 -8
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/__main__.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/changelog.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/cli.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/mailmap.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/py.typed +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils/test_plan.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/SOURCES.txt +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/dependency_links.txt +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/entry_points.txt +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/gha_utils.egg-info/top_level.txt +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/setup.cfg +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/tests/test_changelog.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.0}/tests/test_mailmap.py +0 -0
- {gha_utils-4.18.0 → gha_utils-4.19.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.19.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
|
|
@@ -46,9 +46,9 @@ Requires-Python: >=3.11
|
|
|
46
46
|
Description-Content-Type: text/markdown
|
|
47
47
|
Requires-Dist: boltons>=24.0.0
|
|
48
48
|
Requires-Dist: bump-my-version<1.1.1,>=0.32.2
|
|
49
|
-
Requires-Dist: click-extra~=5.
|
|
49
|
+
Requires-Dist: click-extra~=5.1.1
|
|
50
50
|
Requires-Dist: extra-platforms~=3.2.0
|
|
51
|
-
Requires-Dist: gitignore-parser~=0.1.
|
|
51
|
+
Requires-Dist: gitignore-parser~=0.1.13
|
|
52
52
|
Requires-Dist: packaging~=25.0
|
|
53
53
|
Requires-Dist: PyDriller~=2.6
|
|
54
54
|
Requires-Dist: pyproject-metadata~=0.9.0
|
|
@@ -58,10 +58,11 @@ Provides-Extra: test
|
|
|
58
58
|
Requires-Dist: coverage[toml]~=7.10.0; extra == "test"
|
|
59
59
|
Requires-Dist: pytest~=8.4.0; extra == "test"
|
|
60
60
|
Requires-Dist: pytest-cases~=3.9.1; extra == "test"
|
|
61
|
-
Requires-Dist: pytest-cov~=
|
|
61
|
+
Requires-Dist: pytest-cov~=7.0.0; extra == "test"
|
|
62
62
|
Requires-Dist: pytest-github-actions-annotate-failures~=0.3.0; extra == "test"
|
|
63
|
-
Requires-Dist: pytest-randomly~=
|
|
63
|
+
Requires-Dist: pytest-randomly~=4.0.0; extra == "test"
|
|
64
64
|
Provides-Extra: typing
|
|
65
|
+
Requires-Dist: types-boltons~=25.0.0.20250822; extra == "typing"
|
|
65
66
|
Requires-Dist: types-PyYAML~=6.0.12.9; extra == "typing"
|
|
66
67
|
|
|
67
68
|
# `gha-utils` CLI + reusable workflows
|
|
@@ -162,16 +163,11 @@ $ file ./gha-utils-*
|
|
|
162
163
|
|
|
163
164
|
### Development version
|
|
164
165
|
|
|
165
|
-
To play with the latest development version of `gha-utils`, you can
|
|
166
|
+
To play with the latest development version of `gha-utils`, you can run it directly from the repository:
|
|
166
167
|
|
|
167
168
|
```shell-session
|
|
168
|
-
$
|
|
169
|
-
|
|
170
|
-
$ python -m pip install uv
|
|
171
|
-
$ uv venv
|
|
172
|
-
$ source .venv/bin/activate
|
|
173
|
-
$ uv sync
|
|
174
|
-
$ uv run -- gha-utils
|
|
169
|
+
$ uvx --from git+https://github.com/kdeldycke/workflows -- gha-utils --version
|
|
170
|
+
gha-utils, version 4.18.2
|
|
175
171
|
```
|
|
176
172
|
|
|
177
173
|
## Reusable workflows collection
|
|
@@ -333,19 +329,19 @@ A [detailed changelog](changelog.md) is available.
|
|
|
333
329
|
|
|
334
330
|
Check these projects to get real-life examples of usage and inspiration:
|
|
335
331
|
|
|
336
|
-
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood
|
|
337
|
-
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management
|
|
338
|
-
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam
|
|
339
|
-
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing
|
|
340
|
-
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager
|
|
341
|
-
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate
|
|
342
|
-
-  [dotfiles](https://github.com/kdeldycke/dotfiles
|
|
343
|
-
-  [Click Extra](https://github.com/kdeldycke/click-extra
|
|
344
|
-
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser
|
|
347
|
-
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler
|
|
348
|
-
-  [Excel Write](https://github.com/themagicalmammal/excel-write
|
|
332
|
+
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood) - Falsehoods Programmers Believe in.
|
|
333
|
+
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management) - How to transition from software development to engineering management.
|
|
334
|
+
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam) - Identity and Access Management knowledge for cloud platforms.
|
|
335
|
+
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing) - Billing & Payments knowledge for cloud platforms.
|
|
336
|
+
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager) - A unifying CLI for multiple package managers.
|
|
337
|
+
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate) - A CLI to deduplicate similar emails.
|
|
338
|
+
-  [dotfiles](https://github.com/kdeldycke/dotfiles) - macOS dotfiles for Python developers.
|
|
339
|
+
-  [Click Extra](https://github.com/kdeldycke/click-extra) - Extra colorization and configuration loading for Click.
|
|
340
|
+
-  [workflows](https://github.com/kdeldycke/workflows) - Itself. Eat your own dog-food.
|
|
341
|
+
-  [Wiki bot](https://github.com/themagicalmammal/wikibot) - A bot which provides features from Wikipedia like summary, title searches, location API etc.
|
|
342
|
+
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser) - Simple to use interfaces for basic technical analysis of stocks.
|
|
343
|
+
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler) - Time Table Scheduler using Genetic Algorithms.
|
|
344
|
+
-  [Excel Write](https://github.com/themagicalmammal/excel-write) - Optimised way to write in excel files.
|
|
349
345
|
|
|
350
346
|
Feel free to send a PR to add your project in this list if you are relying on these scripts.
|
|
351
347
|
|
|
@@ -47,18 +47,18 @@ class Matrix:
|
|
|
47
47
|
matrix.
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
|
-
def __init__(self, *args, **kwargs):
|
|
51
|
-
self.variations: dict = {}
|
|
50
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
51
|
+
self.variations: dict[str, tuple[str, ...]] = {}
|
|
52
52
|
|
|
53
53
|
# Tuples are used to keep track of the insertion order and force immutability.
|
|
54
54
|
self.include: tuple[dict[str, str], ...] = tuple()
|
|
55
55
|
self.exclude: tuple[dict[str, str], ...] = tuple()
|
|
56
56
|
|
|
57
|
-
self._job_counter =
|
|
57
|
+
self._job_counter: int = 0
|
|
58
58
|
|
|
59
59
|
def matrix(
|
|
60
60
|
self, ignore_includes: bool = False, ignore_excludes: bool = False
|
|
61
|
-
) -> FrozenDict[str, str]:
|
|
61
|
+
) -> FrozenDict[str, tuple[str, ...] | tuple[dict[str, str], ...]]:
|
|
62
62
|
"""Returns a copy of the matrix.
|
|
63
63
|
|
|
64
64
|
The special ``include`` and ``excludes`` directives will be added by default.
|
|
@@ -66,9 +66,9 @@ class Matrix:
|
|
|
66
66
|
"""
|
|
67
67
|
dict_copy = self.variations.copy()
|
|
68
68
|
if not ignore_includes and self.include:
|
|
69
|
-
dict_copy["include"] = self.include
|
|
69
|
+
dict_copy["include"] = self.include # type: ignore[assignment]
|
|
70
70
|
if not ignore_excludes and self.exclude:
|
|
71
|
-
dict_copy["exclude"] = self.exclude
|
|
71
|
+
dict_copy["exclude"] = self.exclude # type: ignore[assignment]
|
|
72
72
|
return FrozenDict(dict_copy)
|
|
73
73
|
|
|
74
74
|
def __repr__(self) -> str:
|
|
@@ -166,11 +166,11 @@ from random import randint
|
|
|
166
166
|
from re import escape
|
|
167
167
|
from typing import Any, Final, cast
|
|
168
168
|
|
|
169
|
+
import gitignore_parser
|
|
169
170
|
from bumpversion.config import get_configuration # type: ignore[import-untyped]
|
|
170
171
|
from bumpversion.config.files import find_config_file # type: ignore[import-untyped]
|
|
171
172
|
from bumpversion.show import resolve_name # type: ignore[import-untyped]
|
|
172
173
|
from extra_platforms import is_github_ci
|
|
173
|
-
from gitignore_parser import parse_gitignore
|
|
174
174
|
from packaging.specifiers import SpecifierSet
|
|
175
175
|
from packaging.version import Version
|
|
176
176
|
from pydriller import Commit, Git, Repository # type: ignore[import-untyped]
|
|
@@ -352,7 +352,7 @@ MYPY_VERSION_MIN: Final = (3, 8)
|
|
|
352
352
|
class JSONMetadata(json.JSONEncoder):
|
|
353
353
|
"""Custom JSON encoder for metadata serialization."""
|
|
354
354
|
|
|
355
|
-
def default(self, o: Any) ->
|
|
355
|
+
def default(self, o: Any) -> Any:
|
|
356
356
|
if isinstance(o, Matrix):
|
|
357
357
|
return o.matrix()
|
|
358
358
|
|
|
@@ -372,9 +372,6 @@ class Metadata:
|
|
|
372
372
|
self.unstable_targets = set(unstable_targets)
|
|
373
373
|
assert self.unstable_targets.issubset(NUITKA_BUILD_TARGETS)
|
|
374
374
|
|
|
375
|
-
# None indicates the is_python_project variable has not been evaluated yet.
|
|
376
|
-
self._is_python_project: bool | None = None
|
|
377
|
-
|
|
378
375
|
pyproject_path = Path() / "pyproject.toml"
|
|
379
376
|
sphinx_conf_path = Path() / "docs" / "conf.py"
|
|
380
377
|
|
|
@@ -592,11 +589,15 @@ class Metadata:
|
|
|
592
589
|
events.
|
|
593
590
|
|
|
594
591
|
.. seealso::
|
|
595
|
-
|
|
596
592
|
- https://stackoverflow.com/a/67204539
|
|
597
593
|
- https://stackoverflow.com/a/62953566
|
|
598
594
|
- https://stackoverflow.com/a/61861763
|
|
599
595
|
|
|
596
|
+
.. seealso::
|
|
597
|
+
Pull request events on GitHub are a bit complex, see: `The Many SHAs of a
|
|
598
|
+
GitHub Pull Request
|
|
599
|
+
<https://www.kenmuse.com/blog/the-many-shas-of-a-github-pull-request/>`_.
|
|
600
|
+
|
|
600
601
|
.. todo::
|
|
601
602
|
Refactor so we can get rid of ``self.github_context``. Maybe there's enough
|
|
602
603
|
metadata lying around in the environment variables that we can inspect the
|
|
@@ -657,11 +658,7 @@ class Metadata:
|
|
|
657
658
|
@cached_property
|
|
658
659
|
def new_commits_hash(self) -> tuple[str, ...] | None:
|
|
659
660
|
"""List all hashes of new commits."""
|
|
660
|
-
return
|
|
661
|
-
cast(tuple[str, ...], self.new_commits_matrix["commit"])
|
|
662
|
-
if self.new_commits_matrix
|
|
663
|
-
else None
|
|
664
|
-
)
|
|
661
|
+
return self.new_commits_matrix["commit"] if self.new_commits_matrix else None
|
|
665
662
|
|
|
666
663
|
@cached_property
|
|
667
664
|
def release_commits(self) -> tuple[Commit, ...] | None:
|
|
@@ -695,7 +692,7 @@ class Metadata:
|
|
|
695
692
|
def release_commits_hash(self) -> tuple[str, ...] | None:
|
|
696
693
|
"""List all hashes of release commits."""
|
|
697
694
|
return (
|
|
698
|
-
|
|
695
|
+
self.release_commits_matrix["commit"]
|
|
699
696
|
if self.release_commits_matrix
|
|
700
697
|
else None
|
|
701
698
|
)
|
|
@@ -737,7 +734,7 @@ class Metadata:
|
|
|
737
734
|
gitignore = None
|
|
738
735
|
if self.gitignore_exists:
|
|
739
736
|
logging.debug(f"Load {GITIGNORE_PATH} to filter out ignored files.")
|
|
740
|
-
gitignore = parse_gitignore(GITIGNORE_PATH)
|
|
737
|
+
gitignore = gitignore_parser.parse_gitignore(GITIGNORE_PATH)
|
|
741
738
|
|
|
742
739
|
for file_path in iglob(
|
|
743
740
|
patterns,
|
|
@@ -785,41 +782,35 @@ class Metadata:
|
|
|
785
782
|
"""Returns a list of doc files."""
|
|
786
783
|
return self.glob_files("**/*.{md,markdown,rst,tex}", "!.venv/**")
|
|
787
784
|
|
|
788
|
-
@
|
|
785
|
+
@cached_property
|
|
789
786
|
def is_python_project(self):
|
|
790
787
|
"""Returns ``True`` if repository is a Python project.
|
|
791
788
|
|
|
792
|
-
Presence of a ``pyproject.toml`` file
|
|
793
|
-
|
|
794
|
-
"""
|
|
795
|
-
return self._is_python_project
|
|
796
|
-
|
|
797
|
-
@is_python_project.getter
|
|
798
|
-
def is_python_project(self):
|
|
799
|
-
"""Try to read and validate the ``pyproject.toml`` file on access to the
|
|
800
|
-
``is_python_project`` property.
|
|
789
|
+
Presence of a ``pyproject.toml`` file that respects the standards is enough
|
|
790
|
+
to consider the project as a Python one.
|
|
801
791
|
"""
|
|
802
|
-
if self.
|
|
803
|
-
self.pyproject
|
|
804
|
-
return self._is_python_project
|
|
792
|
+
return False if self.pyproject is None else True
|
|
805
793
|
|
|
806
794
|
@cached_property
|
|
807
795
|
def pyproject(self) -> StandardMetadata | None:
|
|
808
796
|
"""Returns metadata stored in the ``pyproject.toml`` file.
|
|
809
797
|
|
|
810
|
-
|
|
811
|
-
|
|
798
|
+
Returns ``None`` if the ``pyproject.toml`` does not exists or does not respects
|
|
799
|
+
the PEP standards.
|
|
800
|
+
|
|
801
|
+
.. warning::
|
|
802
|
+
Some third-party apps have their configuration saved into
|
|
803
|
+
``pyproject.toml`` file, but that does not means the project is a Python
|
|
804
|
+
one. For that, the ``pyproject.toml`` needs to respect the PEPs.
|
|
812
805
|
"""
|
|
813
806
|
if self.pyproject_path.exists() and self.pyproject_path.is_file():
|
|
814
807
|
toml = tomllib.loads(self.pyproject_path.read_text(encoding="UTF-8"))
|
|
815
808
|
try:
|
|
816
809
|
metadata = StandardMetadata.from_pyproject(toml)
|
|
817
|
-
self._is_python_project = True
|
|
818
810
|
return metadata
|
|
819
811
|
except ConfigurationError:
|
|
820
812
|
pass
|
|
821
813
|
|
|
822
|
-
self._is_python_project = False
|
|
823
814
|
return None
|
|
824
815
|
|
|
825
816
|
@cached_property
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: gha-utils
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.19.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
|
|
@@ -46,9 +46,9 @@ Requires-Python: >=3.11
|
|
|
46
46
|
Description-Content-Type: text/markdown
|
|
47
47
|
Requires-Dist: boltons>=24.0.0
|
|
48
48
|
Requires-Dist: bump-my-version<1.1.1,>=0.32.2
|
|
49
|
-
Requires-Dist: click-extra~=5.
|
|
49
|
+
Requires-Dist: click-extra~=5.1.1
|
|
50
50
|
Requires-Dist: extra-platforms~=3.2.0
|
|
51
|
-
Requires-Dist: gitignore-parser~=0.1.
|
|
51
|
+
Requires-Dist: gitignore-parser~=0.1.13
|
|
52
52
|
Requires-Dist: packaging~=25.0
|
|
53
53
|
Requires-Dist: PyDriller~=2.6
|
|
54
54
|
Requires-Dist: pyproject-metadata~=0.9.0
|
|
@@ -58,10 +58,11 @@ Provides-Extra: test
|
|
|
58
58
|
Requires-Dist: coverage[toml]~=7.10.0; extra == "test"
|
|
59
59
|
Requires-Dist: pytest~=8.4.0; extra == "test"
|
|
60
60
|
Requires-Dist: pytest-cases~=3.9.1; extra == "test"
|
|
61
|
-
Requires-Dist: pytest-cov~=
|
|
61
|
+
Requires-Dist: pytest-cov~=7.0.0; extra == "test"
|
|
62
62
|
Requires-Dist: pytest-github-actions-annotate-failures~=0.3.0; extra == "test"
|
|
63
|
-
Requires-Dist: pytest-randomly~=
|
|
63
|
+
Requires-Dist: pytest-randomly~=4.0.0; extra == "test"
|
|
64
64
|
Provides-Extra: typing
|
|
65
|
+
Requires-Dist: types-boltons~=25.0.0.20250822; extra == "typing"
|
|
65
66
|
Requires-Dist: types-PyYAML~=6.0.12.9; extra == "typing"
|
|
66
67
|
|
|
67
68
|
# `gha-utils` CLI + reusable workflows
|
|
@@ -162,16 +163,11 @@ $ file ./gha-utils-*
|
|
|
162
163
|
|
|
163
164
|
### Development version
|
|
164
165
|
|
|
165
|
-
To play with the latest development version of `gha-utils`, you can
|
|
166
|
+
To play with the latest development version of `gha-utils`, you can run it directly from the repository:
|
|
166
167
|
|
|
167
168
|
```shell-session
|
|
168
|
-
$
|
|
169
|
-
|
|
170
|
-
$ python -m pip install uv
|
|
171
|
-
$ uv venv
|
|
172
|
-
$ source .venv/bin/activate
|
|
173
|
-
$ uv sync
|
|
174
|
-
$ uv run -- gha-utils
|
|
169
|
+
$ uvx --from git+https://github.com/kdeldycke/workflows -- gha-utils --version
|
|
170
|
+
gha-utils, version 4.18.2
|
|
175
171
|
```
|
|
176
172
|
|
|
177
173
|
## Reusable workflows collection
|
|
@@ -333,19 +329,19 @@ A [detailed changelog](changelog.md) is available.
|
|
|
333
329
|
|
|
334
330
|
Check these projects to get real-life examples of usage and inspiration:
|
|
335
331
|
|
|
336
|
-
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood
|
|
337
|
-
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management
|
|
338
|
-
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam
|
|
339
|
-
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing
|
|
340
|
-
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager
|
|
341
|
-
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate
|
|
342
|
-
-  [dotfiles](https://github.com/kdeldycke/dotfiles
|
|
343
|
-
-  [Click Extra](https://github.com/kdeldycke/click-extra
|
|
344
|
-
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser
|
|
347
|
-
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler
|
|
348
|
-
-  [Excel Write](https://github.com/themagicalmammal/excel-write
|
|
332
|
+
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood) - Falsehoods Programmers Believe in.
|
|
333
|
+
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management) - How to transition from software development to engineering management.
|
|
334
|
+
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam) - Identity and Access Management knowledge for cloud platforms.
|
|
335
|
+
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing) - Billing & Payments knowledge for cloud platforms.
|
|
336
|
+
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager) - A unifying CLI for multiple package managers.
|
|
337
|
+
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate) - A CLI to deduplicate similar emails.
|
|
338
|
+
-  [dotfiles](https://github.com/kdeldycke/dotfiles) - macOS dotfiles for Python developers.
|
|
339
|
+
-  [Click Extra](https://github.com/kdeldycke/click-extra) - Extra colorization and configuration loading for Click.
|
|
340
|
+
-  [workflows](https://github.com/kdeldycke/workflows) - Itself. Eat your own dog-food.
|
|
341
|
+
-  [Wiki bot](https://github.com/themagicalmammal/wikibot) - A bot which provides features from Wikipedia like summary, title searches, location API etc.
|
|
342
|
+
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser) - Simple to use interfaces for basic technical analysis of stocks.
|
|
343
|
+
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler) - Time Table Scheduler using Genetic Algorithms.
|
|
344
|
+
-  [Excel Write](https://github.com/themagicalmammal/excel-write) - Optimised way to write in excel files.
|
|
349
345
|
|
|
350
346
|
Feel free to send a PR to add your project in this list if you are relying on these scripts.
|
|
351
347
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
boltons>=24.0.0
|
|
2
2
|
bump-my-version<1.1.1,>=0.32.2
|
|
3
|
-
click-extra~=5.
|
|
3
|
+
click-extra~=5.1.1
|
|
4
4
|
extra-platforms~=3.2.0
|
|
5
|
-
gitignore-parser~=0.1.
|
|
5
|
+
gitignore-parser~=0.1.13
|
|
6
6
|
packaging~=25.0
|
|
7
7
|
PyDriller~=2.6
|
|
8
8
|
pyproject-metadata~=0.9.0
|
|
@@ -13,9 +13,10 @@ wcmatch>=8.5
|
|
|
13
13
|
coverage[toml]~=7.10.0
|
|
14
14
|
pytest~=8.4.0
|
|
15
15
|
pytest-cases~=3.9.1
|
|
16
|
-
pytest-cov~=
|
|
16
|
+
pytest-cov~=7.0.0
|
|
17
17
|
pytest-github-actions-annotate-failures~=0.3.0
|
|
18
|
-
pytest-randomly~=
|
|
18
|
+
pytest-randomly~=4.0.0
|
|
19
19
|
|
|
20
20
|
[typing]
|
|
21
|
+
types-boltons~=25.0.0.20250822
|
|
21
22
|
types-PyYAML~=6.0.12.9
|
|
@@ -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.19.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"
|
|
@@ -74,9 +74,11 @@ dependencies = [
|
|
|
74
74
|
# v0.32.2 is the first fixing an issue preventing compilation with Nuitka.
|
|
75
75
|
# v1.1.1 and later have some regressions: see https://github.com/callowayproject/bump-my-version/issues/331
|
|
76
76
|
"bump-my-version >= 0.32.2, < 1.1.1",
|
|
77
|
-
"click-extra ~= 5.
|
|
77
|
+
"click-extra ~= 5.1.1",
|
|
78
78
|
"extra-platforms ~= 3.2.0",
|
|
79
|
-
|
|
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",
|
|
80
82
|
"packaging ~= 25.0",
|
|
81
83
|
"PyDriller ~= 2.6",
|
|
82
84
|
"pyproject-metadata ~= 0.9.0",
|
|
@@ -89,13 +91,12 @@ dependencies = [
|
|
|
89
91
|
test = [
|
|
90
92
|
"coverage [toml] ~= 7.10.0",
|
|
91
93
|
"pytest ~= 8.4.0",
|
|
92
|
-
# More pytest plugins at: https://docs.pytest.org/en/latest/reference/plugin_list.html
|
|
93
94
|
"pytest-cases ~= 3.9.1",
|
|
94
|
-
"pytest-cov ~=
|
|
95
|
+
"pytest-cov ~= 7.0.0",
|
|
95
96
|
"pytest-github-actions-annotate-failures ~= 0.3.0",
|
|
96
|
-
"pytest-randomly ~=
|
|
97
|
+
"pytest-randomly ~= 4.0.0",
|
|
97
98
|
]
|
|
98
|
-
typing = ["types-PyYAML ~= 6.0.12.9"]
|
|
99
|
+
typing = ["types-boltons ~= 25.0.0.20250822", "types-PyYAML ~= 6.0.12.9"]
|
|
99
100
|
|
|
100
101
|
[project.urls]
|
|
101
102
|
"Homepage" = 'https://github.com/kdeldycke/workflows'
|
|
@@ -120,7 +121,7 @@ pretty = true
|
|
|
120
121
|
|
|
121
122
|
[[tool.mypy.overrides]]
|
|
122
123
|
ignore_missing_imports = true
|
|
123
|
-
module = ["
|
|
124
|
+
module = ["gitignore_parser.*"]
|
|
124
125
|
|
|
125
126
|
[tool.pytest.ini_options]
|
|
126
127
|
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
|
|
@@ -138,7 +139,7 @@ addopts = [
|
|
|
138
139
|
xfail_strict = true
|
|
139
140
|
|
|
140
141
|
[tool.bumpversion]
|
|
141
|
-
current_version = "4.
|
|
142
|
+
current_version = "4.19.0"
|
|
142
143
|
allow_dirty = true
|
|
143
144
|
ignore_missing_files = true
|
|
144
145
|
|
|
@@ -96,16 +96,11 @@ $ file ./gha-utils-*
|
|
|
96
96
|
|
|
97
97
|
### Development version
|
|
98
98
|
|
|
99
|
-
To play with the latest development version of `gha-utils`, you can
|
|
99
|
+
To play with the latest development version of `gha-utils`, you can run it directly from the repository:
|
|
100
100
|
|
|
101
101
|
```shell-session
|
|
102
|
-
$
|
|
103
|
-
|
|
104
|
-
$ python -m pip install uv
|
|
105
|
-
$ uv venv
|
|
106
|
-
$ source .venv/bin/activate
|
|
107
|
-
$ uv sync
|
|
108
|
-
$ uv run -- gha-utils
|
|
102
|
+
$ uvx --from git+https://github.com/kdeldycke/workflows -- gha-utils --version
|
|
103
|
+
gha-utils, version 4.18.2
|
|
109
104
|
```
|
|
110
105
|
|
|
111
106
|
## Reusable workflows collection
|
|
@@ -267,19 +262,19 @@ A [detailed changelog](changelog.md) is available.
|
|
|
267
262
|
|
|
268
263
|
Check these projects to get real-life examples of usage and inspiration:
|
|
269
264
|
|
|
270
|
-
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood
|
|
271
|
-
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management
|
|
272
|
-
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam
|
|
273
|
-
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing
|
|
274
|
-
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager
|
|
275
|
-
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate
|
|
276
|
-
-  [dotfiles](https://github.com/kdeldycke/dotfiles
|
|
277
|
-
-  [Click Extra](https://github.com/kdeldycke/click-extra
|
|
278
|
-
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser
|
|
281
|
-
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler
|
|
282
|
-
-  [Excel Write](https://github.com/themagicalmammal/excel-write
|
|
265
|
+
-  [Awesome Falsehood](https://github.com/kdeldycke/awesome-falsehood) - Falsehoods Programmers Believe in.
|
|
266
|
+
-  [Awesome Engineering Team Management](https://github.com/kdeldycke/awesome-engineering-team-management) - How to transition from software development to engineering management.
|
|
267
|
+
-  [Awesome IAM](https://github.com/kdeldycke/awesome-iam) - Identity and Access Management knowledge for cloud platforms.
|
|
268
|
+
-  [Awesome Billing](https://github.com/kdeldycke/awesome-billing) - Billing & Payments knowledge for cloud platforms.
|
|
269
|
+
-  [Meta Package Manager](https://github.com/kdeldycke/meta-package-manager) - A unifying CLI for multiple package managers.
|
|
270
|
+
-  [Mail Deduplicate](https://github.com/kdeldycke/mail-deduplicate) - A CLI to deduplicate similar emails.
|
|
271
|
+
-  [dotfiles](https://github.com/kdeldycke/dotfiles) - macOS dotfiles for Python developers.
|
|
272
|
+
-  [Click Extra](https://github.com/kdeldycke/click-extra) - Extra colorization and configuration loading for Click.
|
|
273
|
+
-  [workflows](https://github.com/kdeldycke/workflows) - Itself. Eat your own dog-food.
|
|
274
|
+
-  [Wiki bot](https://github.com/themagicalmammal/wikibot) - A bot which provides features from Wikipedia like summary, title searches, location API etc.
|
|
275
|
+
-  [Stock Analysis](https://github.com/themagicalmammal/stock-analyser) - Simple to use interfaces for basic technical analysis of stocks.
|
|
276
|
+
-  [GeneticTabler](https://github.com/themagicalmammal/genetictabler) - Time Table Scheduler using Genetic Algorithms.
|
|
277
|
+
-  [Excel Write](https://github.com/themagicalmammal/excel-write) - Optimised way to write in excel files.
|
|
283
278
|
|
|
284
279
|
Feel free to send a PR to add your project in this list if you are relying on these scripts.
|
|
285
280
|
|
|
@@ -58,27 +58,31 @@ def regex(pattern: str) -> re.Pattern:
|
|
|
58
58
|
return re.compile(pattern, re.DOTALL)
|
|
59
59
|
|
|
60
60
|
|
|
61
|
-
def iter_checks(metadata: Any, expected: Any) -> None:
|
|
61
|
+
def iter_checks(metadata: Any, expected: Any, context: Any) -> None:
|
|
62
62
|
"""Recursively iterate over expected content and check it matches in metadata."""
|
|
63
63
|
|
|
64
64
|
if isinstance(expected, re.Pattern):
|
|
65
65
|
assert isinstance(metadata, str)
|
|
66
|
-
assert re.fullmatch(expected, metadata) is not None
|
|
66
|
+
assert re.fullmatch(expected, metadata) is not None, (
|
|
67
|
+
f"{metadata!r} does not match {expected.pattern!r} in {context!r}"
|
|
68
|
+
)
|
|
67
69
|
|
|
68
70
|
elif isinstance(expected, dict):
|
|
69
71
|
assert isinstance(metadata, dict)
|
|
70
72
|
assert set(metadata) == set(expected)
|
|
71
73
|
for key, value in expected.items():
|
|
72
|
-
iter_checks(metadata[key], value)
|
|
74
|
+
iter_checks(metadata[key], value, metadata)
|
|
73
75
|
|
|
74
76
|
elif isinstance(expected, list):
|
|
75
77
|
assert isinstance(metadata, list)
|
|
76
78
|
assert len(metadata) == len(expected)
|
|
77
79
|
for item in expected:
|
|
78
|
-
iter_checks(metadata[expected.index(item)], item)
|
|
80
|
+
iter_checks(metadata[expected.index(item)], item, metadata)
|
|
79
81
|
|
|
80
82
|
else:
|
|
81
|
-
assert metadata == expected
|
|
83
|
+
assert metadata == expected, (
|
|
84
|
+
f"{metadata!r} does not match {expected!r} in {context!r}"
|
|
85
|
+
)
|
|
82
86
|
assert type(metadata) is type(expected)
|
|
83
87
|
|
|
84
88
|
|
|
@@ -203,7 +207,7 @@ expected = {
|
|
|
203
207
|
"cli_id": "gha-utils",
|
|
204
208
|
"module_id": "gha_utils.__main__",
|
|
205
209
|
"callable_id": "main",
|
|
206
|
-
"module_path": regex(r"gha_utils(
|
|
210
|
+
"module_path": regex(r"gha_utils(/|\\)__main__\.py"),
|
|
207
211
|
},
|
|
208
212
|
{
|
|
209
213
|
"commit": regex(r"[a-z0-9]+"),
|
|
@@ -256,7 +260,7 @@ def test_metadata_json_format():
|
|
|
256
260
|
metadata = Metadata().dump(Dialects.json)
|
|
257
261
|
assert isinstance(metadata, str)
|
|
258
262
|
|
|
259
|
-
iter_checks(json.loads(metadata), expected)
|
|
263
|
+
iter_checks(json.loads(metadata), expected, metadata)
|
|
260
264
|
|
|
261
265
|
|
|
262
266
|
def test_metadata_github_format():
|
|
@@ -326,4 +330,4 @@ def test_metadata_github_format():
|
|
|
326
330
|
new_value = " ".join(f'"{i}"' for i in value)
|
|
327
331
|
github_format_expected[key] = new_value
|
|
328
332
|
|
|
329
|
-
iter_checks(metadata, github_format_expected)
|
|
333
|
+
iter_checks(metadata, github_format_expected, raw_metadata)
|
|
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
|