gha-utils 4.18.1__py3-none-any.whl → 4.19.1__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/cli.py +1 -1
- gha_utils/matrix.py +3 -3
- gha_utils/metadata.py +11 -77
- {gha_utils-4.18.1.dist-info → gha_utils-4.19.1.dist-info}/METADATA +22 -26
- gha_utils-4.19.1.dist-info/RECORD +14 -0
- gha_utils-4.18.1.dist-info/RECORD +0 -14
- {gha_utils-4.18.1.dist-info → gha_utils-4.19.1.dist-info}/WHEEL +0 -0
- {gha_utils-4.18.1.dist-info → gha_utils-4.19.1.dist-info}/entry_points.txt +0 -0
- {gha_utils-4.18.1.dist-info → gha_utils-4.19.1.dist-info}/top_level.txt +0 -0
gha_utils/__init__.py
CHANGED
gha_utils/cli.py
CHANGED
|
@@ -116,7 +116,7 @@ def gha_utils():
|
|
|
116
116
|
)
|
|
117
117
|
@option(
|
|
118
118
|
"--format",
|
|
119
|
-
type=Choice(Dialects, case_sensitive=False),
|
|
119
|
+
type=Choice(Dialects, case_sensitive=False),
|
|
120
120
|
default=Dialects.github,
|
|
121
121
|
help="Rendering format of the metadata.",
|
|
122
122
|
)
|
gha_utils/matrix.py
CHANGED
|
@@ -47,18 +47,18 @@ class Matrix:
|
|
|
47
47
|
matrix.
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
|
-
def __init__(self, *args, **kwargs):
|
|
50
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
51
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.
|
gha_utils/metadata.py
CHANGED
|
@@ -156,7 +156,6 @@ import json
|
|
|
156
156
|
import logging
|
|
157
157
|
import os
|
|
158
158
|
import re
|
|
159
|
-
import sys
|
|
160
159
|
import tomllib
|
|
161
160
|
from collections.abc import Iterable
|
|
162
161
|
from enum import StrEnum
|
|
@@ -350,62 +349,6 @@ MYPY_VERSION_MIN: Final = (3, 8)
|
|
|
350
349
|
"""
|
|
351
350
|
|
|
352
351
|
|
|
353
|
-
# XXX Patch gitignore-parser to support Windows paths. Refs:
|
|
354
|
-
# https://github.com/mherrmann/gitignore_parser/issues/60
|
|
355
|
-
# https://github.com/mherrmann/gitignore_parser/pull/61
|
|
356
|
-
# XXX In the future, replace this with wcmatch once it supports gitignore files:
|
|
357
|
-
# https://github.com/facelessuser/wcmatch/issues/226
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
_OriginalIgnoreRule = gitignore_parser.IgnoreRule
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
class PatchedIgnoreRule(_OriginalIgnoreRule): # type: ignore[misc,valid-type]
|
|
364
|
-
"""Patch version of ``IgnoreRule`` to support Windows paths.
|
|
365
|
-
|
|
366
|
-
Taken from: https://github.com/mherrmann/gitignore_parser/pull/61/files
|
|
367
|
-
"""
|
|
368
|
-
|
|
369
|
-
@staticmethod
|
|
370
|
-
def _count_trailing_symbol(symbol: str, text: str) -> int:
|
|
371
|
-
"""Count the number of trailing characters in a string."""
|
|
372
|
-
count = 0
|
|
373
|
-
for char in reversed(str(text)):
|
|
374
|
-
if char == symbol:
|
|
375
|
-
count += 1
|
|
376
|
-
else:
|
|
377
|
-
break
|
|
378
|
-
return count
|
|
379
|
-
|
|
380
|
-
def match(self, abs_path: str | Path) -> bool:
|
|
381
|
-
matched = False
|
|
382
|
-
if self.base_path:
|
|
383
|
-
rel_path = (
|
|
384
|
-
gitignore_parser._normalize_path(abs_path)
|
|
385
|
-
.relative_to(self.base_path)
|
|
386
|
-
.as_posix()
|
|
387
|
-
)
|
|
388
|
-
else:
|
|
389
|
-
rel_path = gitignore_parser._normalize_path(abs_path).as_posix()
|
|
390
|
-
# Path() strips the trailing following symbols on windows, so we need to
|
|
391
|
-
# preserve it: ' ', '.'
|
|
392
|
-
if sys.platform.startswith("win"):
|
|
393
|
-
rel_path += " " * self._count_trailing_symbol(" ", abs_path)
|
|
394
|
-
rel_path += "." * self._count_trailing_symbol(".", abs_path)
|
|
395
|
-
# Path() strips the trailing slash, so we need to preserve it
|
|
396
|
-
# in case of directory-only negation
|
|
397
|
-
if self.negation and type(abs_path) is str and abs_path[-1] == "/":
|
|
398
|
-
rel_path += "/"
|
|
399
|
-
if rel_path.startswith("./"):
|
|
400
|
-
rel_path = rel_path[2:]
|
|
401
|
-
if re.search(self.regex, rel_path):
|
|
402
|
-
matched = True
|
|
403
|
-
return matched
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
gitignore_parser.IgnoreRule = PatchedIgnoreRule
|
|
407
|
-
|
|
408
|
-
|
|
409
352
|
class JSONMetadata(json.JSONEncoder):
|
|
410
353
|
"""Custom JSON encoder for metadata serialization."""
|
|
411
354
|
|
|
@@ -429,9 +372,6 @@ class Metadata:
|
|
|
429
372
|
self.unstable_targets = set(unstable_targets)
|
|
430
373
|
assert self.unstable_targets.issubset(NUITKA_BUILD_TARGETS)
|
|
431
374
|
|
|
432
|
-
# None indicates the is_python_project variable has not been evaluated yet.
|
|
433
|
-
self._is_python_project: bool | None = None
|
|
434
|
-
|
|
435
375
|
pyproject_path = Path() / "pyproject.toml"
|
|
436
376
|
sphinx_conf_path = Path() / "docs" / "conf.py"
|
|
437
377
|
|
|
@@ -842,41 +782,35 @@ class Metadata:
|
|
|
842
782
|
"""Returns a list of doc files."""
|
|
843
783
|
return self.glob_files("**/*.{md,markdown,rst,tex}", "!.venv/**")
|
|
844
784
|
|
|
845
|
-
@
|
|
785
|
+
@cached_property
|
|
846
786
|
def is_python_project(self):
|
|
847
787
|
"""Returns ``True`` if repository is a Python project.
|
|
848
788
|
|
|
849
|
-
Presence of a ``pyproject.toml`` file
|
|
850
|
-
|
|
789
|
+
Presence of a ``pyproject.toml`` file that respects the standards is enough
|
|
790
|
+
to consider the project as a Python one.
|
|
851
791
|
"""
|
|
852
|
-
return self.
|
|
853
|
-
|
|
854
|
-
@is_python_project.getter
|
|
855
|
-
def is_python_project(self):
|
|
856
|
-
"""Try to read and validate the ``pyproject.toml`` file on access to the
|
|
857
|
-
``is_python_project`` property.
|
|
858
|
-
"""
|
|
859
|
-
if self._is_python_project is None:
|
|
860
|
-
self.pyproject
|
|
861
|
-
return self._is_python_project
|
|
792
|
+
return False if self.pyproject is None else True
|
|
862
793
|
|
|
863
794
|
@cached_property
|
|
864
795
|
def pyproject(self) -> StandardMetadata | None:
|
|
865
796
|
"""Returns metadata stored in the ``pyproject.toml`` file.
|
|
866
797
|
|
|
867
|
-
|
|
868
|
-
|
|
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.
|
|
869
805
|
"""
|
|
870
806
|
if self.pyproject_path.exists() and self.pyproject_path.is_file():
|
|
871
807
|
toml = tomllib.loads(self.pyproject_path.read_text(encoding="UTF-8"))
|
|
872
808
|
try:
|
|
873
809
|
metadata = StandardMetadata.from_pyproject(toml)
|
|
874
|
-
self._is_python_project = True
|
|
875
810
|
return metadata
|
|
876
811
|
except ConfigurationError:
|
|
877
812
|
pass
|
|
878
813
|
|
|
879
|
-
self._is_python_project = False
|
|
880
814
|
return None
|
|
881
815
|
|
|
882
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.1
|
|
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~=
|
|
49
|
+
Requires-Dist: click-extra~=6.0.0
|
|
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
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
gha_utils/__init__.py,sha256=lMEtwh0IU3Npa59dfCNSMgI1ilQQl-4K09Qjz3bjXIg,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=jmrSI05qfrkxcB3fQuiB6xf4eumXqg-MBiCITdeW104,15273
|
|
5
|
+
gha_utils/mailmap.py,sha256=g3LQiPNjHsAgCbEYOJcQwdlXqxzmFh697vv2sxHZq-s,7014
|
|
6
|
+
gha_utils/matrix.py,sha256=eBAU3bKrCif7FQ74EWhK_AwDcNUkGp8Om1NtlFdYJpI,12431
|
|
7
|
+
gha_utils/metadata.py,sha256=lAnBC2p17cwpgzpTFw5qYjqvI29wsWtvMlBx4B3rFc4,53791
|
|
8
|
+
gha_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
gha_utils/test_plan.py,sha256=AE8Mf1vSQG5EZTytoTts-gzMwUg2Zy21gUwkMlzXT94,13394
|
|
10
|
+
gha_utils-4.19.1.dist-info/METADATA,sha256=CTP2UDJIakJ9NC7QWc2JcLtoczOjznA1wX169iG9VH8,21212
|
|
11
|
+
gha_utils-4.19.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
+
gha_utils-4.19.1.dist-info/entry_points.txt,sha256=8bJOwQYf9ZqsLhBR6gUCzvwLNI9f8tiiBrJ3AR0EK4o,54
|
|
13
|
+
gha_utils-4.19.1.dist-info/top_level.txt,sha256=C94Blb61YkkyPBwCdM3J_JPDjWH0lnKa5nGZeZ5M6yE,10
|
|
14
|
+
gha_utils-4.19.1.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
gha_utils/__init__.py,sha256=o9J48CI8G5T4jmGN-02kTDdQbhFJhuKtzAu2qUTN3GA,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=WME8vPpWU8ZCe-Y53702Wc6Do5rVliYrOaruDcGOUpY,15299
|
|
5
|
-
gha_utils/mailmap.py,sha256=g3LQiPNjHsAgCbEYOJcQwdlXqxzmFh697vv2sxHZq-s,7014
|
|
6
|
-
gha_utils/matrix.py,sha256=sZq5JLBZ0pRokSXoY5r6zHxWwprilJKlbbzXLjMXfWU,12380
|
|
7
|
-
gha_utils/metadata.py,sha256=HwSjuTl1smjPVLJDtwdBzkqp4iReBIGsZXTNw6VlGt4,56133
|
|
8
|
-
gha_utils/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
-
gha_utils/test_plan.py,sha256=AE8Mf1vSQG5EZTytoTts-gzMwUg2Zy21gUwkMlzXT94,13394
|
|
10
|
-
gha_utils-4.18.1.dist-info/METADATA,sha256=OAuMKGhIkibCE3_VM_Ly53orWBoBtZWmRgfDaWaqCZM,21301
|
|
11
|
-
gha_utils-4.18.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
12
|
-
gha_utils-4.18.1.dist-info/entry_points.txt,sha256=8bJOwQYf9ZqsLhBR6gUCzvwLNI9f8tiiBrJ3AR0EK4o,54
|
|
13
|
-
gha_utils-4.18.1.dist-info/top_level.txt,sha256=C94Blb61YkkyPBwCdM3J_JPDjWH0lnKa5nGZeZ5M6yE,10
|
|
14
|
-
gha_utils-4.18.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|