Skip to content

Commit e66daf8

Browse files
committed
mpflash:chore
1 parent 608dfbf commit e66daf8

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/mpflash/mpflash/versions.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#############################################################
55
"""
66

7-
from functools import lru_cache
87
from pathlib import Path
98

109
from cache_to_disk import NoCacheCondition, cache_to_disk
@@ -31,7 +30,7 @@ def clean_version(
3130
commit: bool = False,
3231
drop_v: bool = False,
3332
flat: bool = False,
34-
):
33+
): # sourcery skip: assign-if-exp
3534
"Clean up and transform the many flavours of versions"
3635
# 'v1.13.0-103-gb137d064e' --> 'v1.13-103'
3736
if version in {"", "-"}:
@@ -52,14 +51,12 @@ def clean_version(
5251
if len(nibbles) == 1:
5352
version = nibbles[0]
5453
elif build and not is_preview:
54+
# HACK: this is not always right, but good enough most of the time
5555
version = "-".join(nibbles) if commit else "-".join(nibbles[:-1])
56+
elif is_preview:
57+
version = "-".join((nibbles[0], V_PREVIEW))
5658
else:
57-
# version = "-".join((nibbles[0], LATEST))
58-
# HACK: this is not always right, but good enough most of the time
59-
if is_preview:
60-
version = "-".join((nibbles[0], V_PREVIEW))
61-
else:
62-
version = V_PREVIEW
59+
version = V_PREVIEW
6360
if flat:
6461
version = version.strip().replace(".", "_").replace("-", "_")
6562
else:

0 commit comments

Comments
 (0)