[meta-python] python3-pynetlinux: patch to use setuptools

Message ID 20220228163305.1263840-1-tim.orling@konsulko.com
State New
Headers show
Series [meta-python] python3-pynetlinux: patch to use setuptools | expand

Commit Message

Tim Orling Feb. 28, 2022, 4:33 p.m. UTC
setup.py bdist_wheel does not work with distutils (which is deprecated
anyway). Add a patch to switch to setuptools to allow the wheel to be
built.

Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
 .../0001-setup.py-switch-to-setuptools.patch  | 32 +++++++++++++++++++
 .../python/python3-pynetlinux_1.1.bb          |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/python/python3-pynetlinux/0001-setup.py-switch-to-setuptools.patch

Patch

diff --git a/meta-python/recipes-devtools/python/python3-pynetlinux/0001-setup.py-switch-to-setuptools.patch b/meta-python/recipes-devtools/python/python3-pynetlinux/0001-setup.py-switch-to-setuptools.patch
new file mode 100644
index 0000000000..35bc4a6bd1
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-pynetlinux/0001-setup.py-switch-to-setuptools.patch
@@ -0,0 +1,32 @@ 
+From a36abadfb2d135260bef7703a1d0b56e6aa7eeff Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Mon, 28 Feb 2022 08:21:33 -0800
+Subject: [PATCH] setup.py: switch to setuptools
+
+In Python 3.10, 'distutils' has been deprecated and is slated for
+removal in Python 3.12.
+
+Switch from 'distutils.core' to 'setuptools'. This also allows for the
+'wheel' binary archive format to be built with 'setup.py bdist_wheel'.
+
+Upstream-Status: Submitted
+[https://github.com/rlisagor/pynetlinux/pull/12]
+
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ setup.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
+index 670e064..45f1053 100755
+--- a/setup.py
++++ b/setup.py
+@@ -1,4 +1,4 @@
+-from distutils.core import setup
++from setuptools import setup
+ 
+ setup(
+     name = "pynetlinux",
+-- 
+2.30.2
+
diff --git a/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb b/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
index c80a166177..a5ac74fd68 100644
--- a/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
+++ b/meta-python/recipes-devtools/python/python3-pynetlinux_1.1.bb
@@ -5,7 +5,8 @@  HOMEPAGE = "http://github.com/rlisagor/pynetlinux"
 LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=74e1861736ee959824fe7542323c12e9"
 
-SRC_URI[md5sum] = "3336e5d4a478acca4e35bf3125b4f883"
 SRC_URI[sha256sum] = "4ad08298c9f5ba15a11cddc639ba8778cabdfc402b51066d9e0a325e5a5b391c"
 
+SRC_URI += "file://0001-setup.py-switch-to-setuptools.patch"
+
 inherit pypi setuptools3