python-openevse-http 1.0.1__py3-none-any.whl → 1.1.0__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.
- openevsehttp/utils.py +30 -2
- {python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/METADATA +1 -1
- {python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/RECORD +6 -6
- {python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/WHEEL +0 -0
- {python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/licenses/LICENSE +0 -0
- {python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/top_level.txt +0 -0
openevsehttp/utils.py
CHANGED
|
@@ -18,8 +18,36 @@ def normalize_version(version: str) -> str:
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
def get_awesome_version(version: str) -> AwesomeVersion:
|
|
21
|
-
"""Parse and normalize the version string, returning an AwesomeVersion.
|
|
22
|
-
|
|
21
|
+
"""Parse and normalize the version string, returning an AwesomeVersion.
|
|
22
|
+
|
|
23
|
+
Development and custom firmware versions (e.g. branch builds ending in a commit hash,
|
|
24
|
+
or standalone 'main'/'master' builds) are normalized to 'dev' to bypass feature flags
|
|
25
|
+
and version-checks.
|
|
26
|
+
|
|
27
|
+
Non-dev version strings are normalized by extracting the first stable 'X.Y.Z' match,
|
|
28
|
+
meaning pre-release, build, or other trailing tags (such as '_rc1' or '_alpha') are
|
|
29
|
+
removed and not preserved in the returned version.
|
|
30
|
+
"""
|
|
31
|
+
# Match non-numeric git branch names (e.g. 'main', 'master', 'develop', or 'feature-x_abc123456')
|
|
32
|
+
# We use custom word boundary checks to avoid false positives like 'domain' matching 'main'
|
|
33
|
+
# or 'webmaster' matching 'master'.
|
|
34
|
+
is_dev = False
|
|
35
|
+
if re.search(r"[^/]+/[^_]+_[a-fA-F0-9]{6,40}_modified$", version, re.IGNORECASE):
|
|
36
|
+
is_dev = True
|
|
37
|
+
elif re.search(
|
|
38
|
+
r"(?:^|[^a-zA-Z0-9])(master|main)(?:[^a-zA-Z0-9]|$)", version, re.IGNORECASE
|
|
39
|
+
):
|
|
40
|
+
is_dev = True
|
|
41
|
+
elif re.search(r"_[a-fA-F0-9]{7,40}$", version):
|
|
42
|
+
is_dev = True
|
|
43
|
+
elif re.search(
|
|
44
|
+
r"(?:^|[^a-zA-Z0-9])(dev|feature|fix|main|master)(?:[^a-zA-Z0-9].*?)?_[a-fA-F0-9]{6}$",
|
|
45
|
+
version,
|
|
46
|
+
re.IGNORECASE,
|
|
47
|
+
):
|
|
48
|
+
is_dev = True
|
|
49
|
+
|
|
50
|
+
if is_dev:
|
|
23
51
|
version = "dev"
|
|
24
52
|
value = normalize_version(version)
|
|
25
53
|
if "dev" not in version:
|
|
@@ -8,10 +8,10 @@ openevsehttp/managers.py,sha256=EtQMQziwhoZeqKe2zWY-0yS7zedhuYjYtL5j9xBBCZ0,5380
|
|
|
8
8
|
openevsehttp/properties.py,sha256=xbQfx256FZwNPPn9ryWWOMKliyCChq4ZaTH9NDQVR_8,17968
|
|
9
9
|
openevsehttp/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
openevsehttp/sensors.py,sha256=yO4Q1sgJkvmfOi5dpoTwEoldsrpqgGz0k9fC7mFWass,4680
|
|
11
|
-
openevsehttp/utils.py,sha256=
|
|
11
|
+
openevsehttp/utils.py,sha256=PI_6yHd9rvz_-iKDPz-hT5xMwffH3BABxvygvwV60ZU,2048
|
|
12
12
|
openevsehttp/websocket.py,sha256=dOSemvm7CM5pFb9RaoJSTIM6Tf5xtWMLEBEccKlBUKI,10517
|
|
13
|
-
python_openevse_http-1.0.
|
|
14
|
-
python_openevse_http-1.0.
|
|
15
|
-
python_openevse_http-1.0.
|
|
16
|
-
python_openevse_http-1.0.
|
|
17
|
-
python_openevse_http-1.0.
|
|
13
|
+
python_openevse_http-1.1.0.dist-info/licenses/LICENSE,sha256=hSB6TOQ7rmwSGb6XzqRjDGMvmUj5_GlacqQin3tegtA,11341
|
|
14
|
+
python_openevse_http-1.1.0.dist-info/METADATA,sha256=oiKnvhSrwq6Ej08VPWOC1gkGqL48M_asyZzQ6psZjKM,4417
|
|
15
|
+
python_openevse_http-1.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
16
|
+
python_openevse_http-1.1.0.dist-info/top_level.txt,sha256=u8RUkoEIE33Cjn6gmqiEoVpZ0VZ59WJ3FXBwwOg0CPE,13
|
|
17
|
+
python_openevse_http-1.1.0.dist-info/RECORD,,
|
|
File without changes
|
{python_openevse_http-1.0.1.dist-info → python_openevse_http-1.1.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|