Skip to contentSkip to conversation

pylibfdt: Fix version normalization warning

PATCH In review Marek Vasut 3 participants 3 messages Dec 15, 2022 – Dec 23, 2022 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pylibfdt: Fix version normalization warning

Fix the following version normalization warning:
"
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1' "

Using suggestion from Richard Jones:
https://github.com/pypa/setuptools/issues/308#issuecomment-405817468

---
Cc: Tom Rini <[email protected]>
Cc: Simon Glass <[email protected]>

---
 scripts/dtc/pylibfdt/setup.py | 4 ++++
 1 file changed, 4 insertions(+)
scripts/dtc/pylibfdt/setup.py +4 -0
index ec1fc5002b0..9abdb57595a 100755
@@ -22,10 +22,14 @@ allows this script to be run stand-alone, e.g.:
 
 from setuptools import setup, Extension
 from setuptools.command.build_py import build_py as _build_py
+from setuptools.extern.packaging import version
 import os
 import re
 import sys
 
+# Disable version normalization
+version.Version = version.LegacyVersion
+
 srcdir = os.path.dirname(__file__)
 
 with open(os.path.join(srcdir, "../README"), "r") as fh:
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Marek,

Quoted 9 lines · Marek Vasut

Fix the following version normalization warning:
"
/usr/lib/python3/dist-packages/setuptools/dist.py:530: UserWarning: Normalizing '2023.01' to '2023.1' "

Using suggestion from Richard Jones:
https://github.com/pypa/setuptools/issues/308#issuecomment-405817468

Quoted 7 lines

---
Cc: Tom Rini <[email protected]>
Cc: Simon Glass <[email protected]>

---
 scripts/dtc/pylibfdt/setup.py | 4 ++++
 1 file changed, 4 insertions(+)

Another option would be to drop the leading 0 from U-Boot, but that would mess with sorting so that 2022.10 would come before 2022.04

Quoted 23 lines
scripts/dtc/pylibfdt/setup.py +4 -1
index ec1fc5002b0..9abdb57595a 100755
@@ -22,10 +22,14 @@ allows this script to be run stand-alone, e.g.:
 
 from setuptools import setup, Extension
 from setuptools.command.build_py import build_py as _build_py
+from setuptools.extern.packaging import version
 import os
 import re
 import sys
 
+# Disable version normalization
+version.Version = version.LegacyVersion
+
 srcdir = os.path.dirname(__file__)
 
 with open(os.path.join(srcdir, "../README"), "r") as fh:
--

2.35.1