Browse Source

Merge pull request #12245 from jefferyto/python3-setuptools-site-patch

python3-setuptools: Fix error when installing from source
lilik-openwrt-22.03
Hannu Nyman 5 years ago
committed by GitHub
parent
commit
643b91abb3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 1 deletions
  1. +1
    -1
      lang/python/python3-version.mk
  2. +3
    -0
      lang/python/python3/files/python3-package-setuptools.mk
  3. +14
    -0
      lang/python/python3/patches-setuptools/004-site-patch.patch

+ 1
- 1
lang/python/python3-version.mk View File

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


+ 3
- 0
lang/python/python3/files/python3-package-setuptools.mk 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/easy_install.py \
$(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/ -type d -name __pycache__ -delete
endef


+ 14
- 0
lang/python/python3/patches-setuptools/004-site-patch.patch 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 = ""

Loading…
Cancel
Save