Skip to contentSkip to conversation

pylibfdt: Fix disable version normalization

PATCH In review Philippe Schenker 4 participants 6 messages Jan 4, 2023 – Jan 6, 2023 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pylibfdt: Fix disable version normalization

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern' "

According to a eschwartz setuptools.extern is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")

---

 scripts/dtc/pylibfdt/setup.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/dtc/pylibfdt/setup.py +2 -6
index 9abdb57595ad..c07f65e6bcaf 100755
@@ -20,16 +20,12 @@ allows this script to be run stand-alone, e.g.:
     ./pylibfdt/setup.py install [--prefix=...]
 """
 
-from setuptools import setup, Extension
+from setuptools import setup, Extension, sic
 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:
@@ -141,7 +137,7 @@ class build_py(_build_py):
 
 setup(
     name='libfdt',
-    version=version,
+    version=sic(version),
     cmdclass = {'build_py' : build_py},
     author='Simon Glass',
     author_email='[email protected]',
Signature · 1 line
2.39.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern' "

According to a eschwartz setuptools.extern is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Quoted 7 lines

Use the correct solution introduced by python setuptools developers to disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")

Nice, thank you.

+CC Tom, this should go into this 2023.01 release.

#2 lore raw
Quoted 22 lines · Marek Vasut
Quoted 13 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern' "

According to a eschwartz setuptools.extern is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Quoted 7 lines

Use the correct solution introduced by python setuptools developers to disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")
Quoted 5 lines

Nice, thank you.

+CC Tom, this should go into this 2023.01 release.

Yes, thanks. I saw a similar change via a GitHub PR that was on my list to properly resubmit.

Signature · 1 line
Tom
Reviewed-by on v1 1/1
#3 lore raw
In reply to Philippe Schenker

Hi Philippe,

Quoted 8 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern'

What are you doing to create that error?

Regards,
Simon

Quoted 53 lines

"

According to a eschwartz setuptools.extern is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")

---

 scripts/dtc/pylibfdt/setup.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/dtc/pylibfdt/setup.py +2 -7
index 9abdb57595ad..c07f65e6bcaf 100755
@@ -20,16 +20,12 @@ allows this script to be run stand-alone, e.g.:
     ./pylibfdt/setup.py install [--prefix=...]
 """
 
-from setuptools import setup, Extension
+from setuptools import setup, Extension, sic
 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:
@@ -141,7 +137,7 @@ class build_py(_build_py):
 
 setup(
     name='libfdt',
-    version=version,
+    version=sic(version),
     cmdclass = {'build_py' : build_py},
     author='Simon Glass',
     author_email='[email protected]',
--

2.39.0

#4 lore raw
Quoted 12 lines · Simon Glass

Hi Philippe,

Quoted 7 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern'

Quoted 3 lines

What are you doing to create that error?

Sorry for the late answer. I hit this error as soon as I tried to build U-Boot using "make *defconfig; make"

Regards,Philippe

Quoted 61 lines

Regards,
Simon

Quoted 56 lines

"

According to a eschwartz setuptools.extern is not a public API and
shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to
disable normalization. [2]

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")

---

 scripts/dtc/pylibfdt/setup.py | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
scripts/dtc/pylibfdt/setup.py +2 -7
index 9abdb57595ad..c07f65e6bcaf 100755
@@ -20,16 +20,12 @@ allows this script to be run stand-alone, e.g.:
     ./pylibfdt/setup.py install [--prefix=...]
 """
 
-from setuptools import setup, Extension
+from setuptools import setup, Extension, sic
 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:
@@ -141,7 +137,7 @@ class build_py(_build_py):
 
 setup(
     name='libfdt',
-    version=version,
+    version=sic(version),
     cmdclass = {'build_py' : build_py},
     author='Simon Glass',
     author_email='[email protected]',
--

2.39.0

#5 lore raw
In reply to Philippe Schenker
Quoted 16 lines · Philippe Schenker

From: Philippe Schenker <[email protected]>

On Arch Linux based systems python setuptools does not contain "setuptools.extern" hence it is failing with the following error-message:
"
ModuleNotFoundError: No module named 'setuptools.extern' "

According to a eschwartz setuptools.extern is not a public API and shall not be assumed to be present in the setuptools package. He mentions that the setuptools project anyway wants to drop this. [1]

Use the correct solution introduced by python setuptools developers to disable normalization. [2]

Quoted 6 lines

[1] https://bbs.archlinux.org/viewtopic.php?id=259608
[2] https://github.com/pypa/setuptools/pull/2026

Fixes 440098c42e73 ("pylibfdt: Fix version normalization warning")

Applied to u-boot/master, thanks!

Signature · 1 line
Tom