File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 44#############################################################
55"""
66
7- from functools import lru_cache
87from pathlib import Path
98
109from 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 :
You can’t perform that action at this time.
0 commit comments