From 70a7f736c5d6fb9ebec1acc8b3e8ca77704361bf Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Thu, 21 May 2020 20:02:13 +0800 Subject: python3-setuptools: Fix error when installing from source When a Python package is installed from source (i.e. using setup.py) into a custom location (with --home), setuptools may want to create a site.py file in the custom location. This file is created based on the source code of site-patch.py, a file bundled with setuptools. Because the normal OpenWrt setuptools package does not contain Python source code, this file is missing and the installation will end with an error. This copies site-patch.py to site-patch.py.txt so that it will be included in python3-setuptools, and patches setuptools to look for this file. See https://github.com/openwrt/packages/issues/12223 Signed-off-by: Jeffery To --- .../python/python3/patches-setuptools/004-site-patch.patch | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 lang/python/python3/patches-setuptools/004-site-patch.patch (limited to 'lang/python/python3/patches-setuptools') diff --git a/lang/python/python3/patches-setuptools/004-site-patch.patch b/lang/python/python3/patches-setuptools/004-site-patch.patch new file mode 100644 index 000000000..39b8c9026 --- /dev/null +++ b/lang/python/python3/patches-setuptools/004-site-patch.patch @@ -0,0 +1,14 @@ +--- a/setuptools/command/easy_install.py ++++ b/setuptools/command/easy_install.py +@@ -1315,7 +1315,10 @@ class easy_install(Command): + return # already did it, or don't need to + + sitepy = os.path.join(self.install_dir, "site.py") +- source = resource_string("setuptools", "site-patch.py") ++ try: ++ source = resource_string("setuptools", "site-patch.py") ++ except FileNotFoundError: ++ source = resource_string("setuptools", "site-patch.py.txt") + source = source.decode('utf-8') + current = "" + -- cgit