From 141095ec05b5c994a88db604bc60ed08613cdd8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 26 Nov 2019 10:05:33 +0100 Subject: [PATCH] Make python-setuptools-wheel work with Python 3.9 --- python-setuptools.spec | 9 ++++++++- python39.patch | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 python39.patch diff --git a/python-setuptools.spec b/python-setuptools.spec index c8b11f5..cb8e9d6 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -19,7 +19,7 @@ Name: python-setuptools # When updating, update the bundled libraries versions bellow! Version: 40.8.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Easily build and distribute Python packages # setuptools is MIT # packaging is BSD or ASL 2.0 @@ -35,6 +35,10 @@ Source0: %{pypi_source %{srcname} %{version} zip} # https://bugzilla.redhat.com/show_bug.cgi?id=1576924 Patch0: create-site-packages.patch +# Make setuptools compatible with Python 3.9, backported from setuptools 41.1+ +# https://github.com/pypa/setuptools/pull/1788 +Patch1: python39.patch + BuildArch: noarch BuildRequires: gcc @@ -255,6 +259,9 @@ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=$(pwd) py.test-%{python3_version} --ignore= %changelog +* Tue Nov 26 2019 Miro Hrončok - 40.8.0-2 +- Make python-setuptools-wheel work with Python 3.9 + * Tue Feb 05 2019 Miro Hrončok - Update to 40.8.0 (#1672756) - https://github.com/pypa/setuptools/blob/v40.8.0/CHANGES.rst diff --git a/python39.patch b/python39.patch new file mode 100644 index 0000000..024594a --- /dev/null +++ b/python39.patch @@ -0,0 +1,26 @@ +From 53b8db359378f436bfd88f90a90aaf01b650d3a6 Mon Sep 17 00:00:00 2001 +From: Inada Naoki +Date: Tue, 18 Jun 2019 16:15:25 +0900 +Subject: [PATCH] Stop using deprecated HTMLParser.unescape + +HTMLParser.unescape is accessed even when unused - this will cause an +exception when `HTMLParser.unescape` is removed in Python 3.9. +--- + setuptools/py33compat.py | 6 +++++- + 2 files changed, 6 insertions(+), 1 deletion(-) + create mode 100644 changelog.d/1788.change.rst + +diff --git a/setuptools/py33compat.py b/setuptools/py33compat.py +index 87cf53983..cb6944363 100644 +--- a/setuptools/py33compat.py ++++ b/setuptools/py33compat.py +@@ -52,4 +52,8 @@ def __iter__(self): + Bytecode = getattr(dis, 'Bytecode', Bytecode_compat) + + +-unescape = getattr(html, 'unescape', html_parser.HTMLParser().unescape) ++unescape = getattr(html, 'unescape', None) ++if unescape is None: ++ # HTMLParser.unescape is deprecated since Python 3.4, and will be removed ++ # from 3.9. ++ unescape = html_parser.HTMLParser().unescape