Skip to content

Commit 4661797

Browse files
committed
Fix tests command wotk for workflows messing floats and strings as version numbers
1 parent 56b1eed commit 4661797

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# makeapp changelog
22

33

4+
### Unreleased
5+
* ** Fix 'tests' command wotk for workflows messing floats and strings as version numbers.
6+
47
### v2.2.0 [2026-03-29]
58
* ++ Add experimental 'tests' command (tox replacement).
69

src/makeapp/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ def tests(debug, only):
248248

249249
for status, color, err in ((key_ok, 'green', False), (key_fail, 'red', True)):
250250
if items := stats[status]:
251-
items = "\n ".join(items)
252-
click.secho(f'Tests {status}:\n {items}', err=err, fg=color)
251+
items = ' '.join(items)
252+
click.secho(f'Tests {status} ({len(items)}):\n {items}', err=err, fg=color)
253253

254254
click.secho('Done', fg='green')
255255

src/makeapp/helpers/tests.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ def get_matrix_github(cls, fpath: Path):
4949
values = matrix.values()
5050
combinations = []
5151

52+
def norm(val) -> float | str:
53+
try:
54+
return float(val)
55+
except (ValueError, TypeError):
56+
return f'{val}'
57+
5258
for combined in product(*values):
5359
combination = dict(zip(keys, combined, strict=False))
5460
is_excluded = False
5561
for exclusion in exclusions:
56-
if all(f'{combination.get(key)}' == f'{val}' for key, val in exclusion.items()):
62+
if all(f'{norm(combination.get(key))}' == f'{norm(val)}' for key, val in exclusion.items()):
5763
is_excluded = True
5864
break
5965

0 commit comments

Comments
 (0)