!12 Fix installation with setuptools >= 60

From: @yangbo2022 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-01-19 11:46:13 +00:00 committed by Gitee
commit ae73038733
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,37 @@
From 0850374ad9b83e1057ba67c7f9bf73dd13038df3 Mon Sep 17 00:00:00 2001
From: Graham Inggs <ginggs@debian.org>
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

View File

@ -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 <yangbo1@xfusion.com> - 0.7.7-2
- Fix installation with setuptools >= 60
* Wed Nov 23 2022 liqiuyu <liqiuyu@kylinos.cn> - 0.7.7-1
- Update package to version 0.7.7