diff --git a/No-longer-use-undocumented-module-sre_constants.patch b/No-longer-use-undocumented-module-sre_constants.patch new file mode 100644 index 0000000..5550a4a --- /dev/null +++ b/No-longer-use-undocumented-module-sre_constants.patch @@ -0,0 +1,73 @@ +From 187738483489794693ee464050ccc6d070ac2dfb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Tue, 19 Apr 2022 14:23:21 +0200 +Subject: [PATCH] No longer use undocumented module 'sre_constants' + +--- + pkg_resources/_vendor/pyparsing.py | 5 ++--- + setuptools/_vendor/pyparsing.py | 5 ++--- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/pkg_resources/_vendor/pyparsing.py b/pkg_resources/_vendor/pyparsing.py +index cf75e1e..5ecc692 100644 +--- a/pkg_resources/_vendor/pyparsing.py ++++ b/pkg_resources/_vendor/pyparsing.py +@@ -84,7 +84,6 @@ import copy + import sys + import warnings + import re +-import sre_constants + import collections + import pprint + import traceback +@@ -2791,7 +2790,7 @@ class Regex(Token): + try: + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % pattern, + SyntaxWarning, stacklevel=2) + raise +@@ -2915,7 +2914,7 @@ class QuotedString(Token): + try: + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % self.pattern, + SyntaxWarning, stacklevel=2) + raise +diff --git a/setuptools/_vendor/pyparsing.py b/setuptools/_vendor/pyparsing.py +index cf75e1e..5ecc692 100644 +--- a/setuptools/_vendor/pyparsing.py ++++ b/setuptools/_vendor/pyparsing.py +@@ -84,7 +84,6 @@ import copy + import sys + import warnings + import re +-import sre_constants + import collections + import pprint + import traceback +@@ -2791,7 +2790,7 @@ class Regex(Token): + try: + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % pattern, + SyntaxWarning, stacklevel=2) + raise +@@ -2915,7 +2914,7 @@ class QuotedString(Token): + try: + self.re = re.compile(self.pattern, self.flags) + self.reString = self.pattern +- except sre_constants.error: ++ except re.error: + warnings.warn("invalid pattern (%s) passed to Regex" % self.pattern, + SyntaxWarning, stacklevel=2) + raise +-- +2.33.1 + diff --git a/python-setuptools.spec b/python-setuptools.spec index fed6913..3332920 100644 --- a/python-setuptools.spec +++ b/python-setuptools.spec @@ -25,7 +25,7 @@ Name: python-setuptools # When updating, update the bundled libraries versions bellow! Version: 60.9.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Easily build and distribute Python packages # setuptools is MIT # appdirs is MIT @@ -55,6 +55,11 @@ Patch: Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch # PR open upstream: https://github.com/pypa/setuptools/pull/3156 Patch: Point-to-a-custom-pre-built-distribution-of-setuptools.patch +# setuptools doesn't build with Python 3.11.0a7 because of bundled pyparsing that uses deprecated +# sre_constants module. +# Upstream report: https://github.com/pypa/setuptools/issues/3274 +Patch: No-longer-use-undocumented-module-sre_constants.patch + BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel @@ -234,6 +239,10 @@ PYTHONPATH=$(pwd) %pytest \ %changelog +* Tue Apr 19 2022 Tomáš Hrnčiar - 60.9.3-2 +- No longer use the deprecated sre_constants module in bundled pyparsing +- Fixes: rhbz#2075487 + * Wed Feb 16 2022 Karolina Surma - 60.9.3-1 - Update to 60.9.3 - Fixes rhbz#2033860