Merge pull request #12247 from jefferyto/python-setuptools-site-patch-openwrt-19.07

[openwrt-19.07] python-setuptools,python3-setuptools: Fix error when installing from source
This commit is contained in:
Hannu Nyman 2020-05-21 18:10:31 +03:00 committed by GitHub
commit 23251b93a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 2 deletions

View file

@ -8,7 +8,7 @@
PYTHON_VERSION:=2.7 PYTHON_VERSION:=2.7
PYTHON_VERSION_MICRO:=18 PYTHON_VERSION_MICRO:=18
PYTHON_SETUPTOOLS_PKG_RELEASE:=1 PYTHON_SETUPTOOLS_PKG_RELEASE:=2
PYTHON_PIP_PKG_RELEASE:=2 PYTHON_PIP_PKG_RELEASE:=2
PYTHON_SETUPTOOLS_VERSION:=41.2.0 PYTHON_SETUPTOOLS_VERSION:=41.2.0

View file

@ -23,6 +23,9 @@ define PyPackage/python-setuptools/install
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools-$(PYTHON_SETUPTOOLS_VERSION).dist-info \ $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools-$(PYTHON_SETUPTOOLS_VERSION).dist-info \
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \ $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON_VERSION)/site-packages $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
$(CP) \
$(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools/site-patch.py \
$(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/setuptools/site-patch.py.txt
endef endef
$(eval $(call PyBasePackage,python-setuptools, \ $(eval $(call PyBasePackage,python-setuptools, \

View file

@ -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 IOError:
+ source = resource_string("setuptools", "site-patch.py.txt")
source = source.decode('utf-8')
current = ""

View file

@ -12,7 +12,7 @@ PYTHON3_VERSION_MICRO:=7
PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR) PYTHON3_VERSION:=$(PYTHON3_VERSION_MAJOR).$(PYTHON3_VERSION_MINOR)
PYTHON3_SETUPTOOLS_PKG_RELEASE:=1 PYTHON3_SETUPTOOLS_PKG_RELEASE:=2
PYTHON3_PIP_PKG_RELEASE:=2 PYTHON3_PIP_PKG_RELEASE:=2
PYTHON3_SETUPTOOLS_VERSION:=41.2.0 PYTHON3_SETUPTOOLS_VERSION:=41.2.0

View file

@ -24,6 +24,9 @@ define Py3Package/python3-setuptools/install
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \ $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools-$(PYTHON3_SETUPTOOLS_VERSION).dist-info \
$(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \ $(PKG_BUILD_DIR)/install-setuptools/usr/lib/python$(PYTHON3_VERSION)/site-packages/easy_install.py \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
$(CP) \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools/site-patch.py \
$(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/setuptools/site-patch.py.txt
find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -path '*/__pycache__/*' -delete
find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete find $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/ -type d -name __pycache__ -delete
endef endef

View file

@ -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 = ""