From 8854d673b0ed8c060b87e85ab320aba2c63bdc30 Mon Sep 17 00:00:00 2001 From: yangbo Date: Thu, 19 Jan 2023 16:23:35 +0800 Subject: [PATCH] Fix installation with setuptools >= 60 Signed-off-by: yangbo --- ...-Fix-installation-with-setuptools-60.patch | 37 +++++++++++++++++++ python-genshi.spec | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 backport-0001-Fix-installation-with-setuptools-60.patch diff --git a/backport-0001-Fix-installation-with-setuptools-60.patch b/backport-0001-Fix-installation-with-setuptools-60.patch new file mode 100644 index 0000000..b97989f --- /dev/null +++ b/backport-0001-Fix-installation-with-setuptools-60.patch @@ -0,0 +1,37 @@ +From 0850374ad9b83e1057ba67c7f9bf73dd13038df3 Mon Sep 17 00:00:00 2001 +From: Graham Inggs +Date: Thu, 27 Oct 2022 12:58:29 +0200 +Subject: [PATCH] Fix installation with setuptools >= 60 + +Installation of genshi with recent versions of setuptools fails with: +`distutils.errors.DistutilsSetupError: each element of 'ext_modules' option must be an Extension instance or 2-tuple` +Setuptools monkeypatches distutils, so change the ordering of imports so that setuptools is imported before distutils. +--- + setup.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/setup.py b/setup.py +index c14cfa8..b5eb7a3 100755 +--- a/setup.py ++++ b/setup.py +@@ -12,8 +12,6 @@ + # individuals. For the exact contribution history, see the revision + # history and logs, available at http://genshi.edgewall.org/log/. + +-from distutils.command.build_ext import build_ext +-from distutils.errors import CCompilerError, DistutilsPlatformError + import os + try: + from setuptools import setup, Extension +@@ -21,6 +19,8 @@ try: + except ImportError: + from distutils.core import setup, Extension + bdist_egg = None ++from distutils.command.build_ext import build_ext ++from distutils.errors import CCompilerError, DistutilsPlatformError + import sys + + sys.path.append(os.path.join('doc', 'common')) +-- +2.39.0.windows.2 + diff --git a/python-genshi.spec b/python-genshi.spec index 91d7b28..79a0757 100644 --- a/python-genshi.spec +++ b/python-genshi.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: python-genshi Version: 0.7.7 -Release: 1 +Release: 2 Summary: Toolkit for stream-based generation of output for the web License: BSD-3-Clause URL: http://genshi.edgewall.org/ @@ -9,6 +9,8 @@ Source0: https://files.pythonhosted.org/packages/d5/13/bdb68fb9652bb145c341756fb Requires: python3-babel >= 0.8 +Patch0001: backport-0001-Fix-installation-with-setuptools-60.patch + %description Genshi is a Python library that provides an integrated set of components for parsing, generating, and processing HTML, XML @@ -77,6 +79,9 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog +* Wed Jan 18 2023 yangbo - 0.7.7-2 +- Fix installation with setuptools >= 60 + * Wed Nov 23 2022 liqiuyu - 0.7.7-1 - Update package to version 0.7.7 -- Gitee