Update to 62.6.0

Change wheel size test to 900 KiB as more bundled libraries were added

Fixes: rhbz#2064842
This commit is contained in:
Charalampos Stratakis 2022-05-20 02:41:11 +02:00
parent 8448afc1bf
commit ebda604314
6 changed files with 25 additions and 191 deletions

View File

@ -1,43 +0,0 @@
From 395edd9c8f055005922b8e66a21ba9f0d2a7c2fd Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Thu, 24 Feb 2022 09:38:54 +0100
Subject: [PATCH] Isolate spawned processes by unsetting PYTHONPATH
---
setuptools/tests/environment.py | 5 +++++
setuptools/tests/fixtures.py | 3 ++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/setuptools/tests/environment.py b/setuptools/tests/environment.py
index a0c0ec6..b0eac3a 100644
--- a/setuptools/tests/environment.py
+++ b/setuptools/tests/environment.py
@@ -18,6 +18,11 @@ class VirtualEnv(jaraco.envs.VirtualEnv):
def run(self, cmd, *args, **kwargs):
cmd = [self.exe(cmd[0])] + cmd[1:]
kwargs = {"cwd": self.root, **kwargs} # Allow overriding
+ if "env" not in kwargs:
+ env = dict(os.environ)
+ if "PYTHONPATH" in env:
+ del env["PYTHONPATH"]
+ kwargs["env"] = env
return subprocess.check_output(cmd, *args, **kwargs)
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index 7599e65..d61ffa4 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -98,7 +98,8 @@ def venv(tmp_path, setuptools_wheel):
env = environment.VirtualEnv()
env.root = path.Path(tmp_path / 'venv')
env.req = str(setuptools_wheel)
- return env.create()
+ with contexts.environment(PYTHONPATH=None):
+ return env.create()
@pytest.fixture
--
2.35.1

View File

@ -1,73 +0,0 @@
From 187738483489794693ee464050ccc6d070ac2dfb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
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

View File

@ -1,45 +0,0 @@
From d00beeefc6172036ecc17ad7945e80852d5210a5 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Wed, 2 Mar 2022 11:42:41 +0100
Subject: [PATCH] Point to a custom pre-built distribution of setuptools
---
setuptools/tests/fixtures.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py
index d61ffa4..cc2d4d8 100644
--- a/setuptools/tests/fixtures.py
+++ b/setuptools/tests/fixtures.py
@@ -1,7 +1,10 @@
import contextlib
+import os
import sys
import subprocess
+from pathlib import Path
+
import pytest
import path
@@ -64,6 +67,8 @@ def sample_project(tmp_path):
@pytest.fixture(scope="session")
def setuptools_sdist(tmp_path_factory, request):
+ if os.getenv("PRE_BUILT_SETUPTOOLS_SDIST"):
+ return Path(os.getenv("PRE_BUILT_SETUPTOOLS_SDIST")).resolve()
with contexts.session_locked_tmp_dir(
request, tmp_path_factory, "sdist_build") as tmp:
dist = next(tmp.glob("*.tar.gz"), None)
@@ -79,6 +84,8 @@ def setuptools_sdist(tmp_path_factory, request):
@pytest.fixture(scope="session")
def setuptools_wheel(tmp_path_factory, request):
+ if os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL"):
+ return Path(os.getenv("PRE_BUILT_SETUPTOOLS_WHEEL")).resolve()
with contexts.session_locked_tmp_dir(
request, tmp_path_factory, "wheel_build") as tmp:
dist = next(tmp.glob("*.whl"), None)
--
2.35.1

View File

@ -1,14 +1,14 @@
From bc29357f2effabd91c47562d332f0ae731ffcee0 Mon Sep 17 00:00:00 2001
From 7b0ba61bfbe7765d034f82158eba57c74b770405 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Mon, 21 Feb 2022 09:22:42 +0100
Subject: [PATCH] Update
---
setup.cfg | 14 --------------
1 file changed, 14 deletions(-)
setup.cfg | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/setup.cfg b/setup.cfg
index 4a4a9a2..ce587f6 100644
index 8c71052..e6df94f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -38,19 +38,8 @@ exclude =
@ -31,16 +31,15 @@ index 4a4a9a2..ce587f6 100644
virtualenv>=13.0.0
wheel
pip>=19.1 # For proper file:// URLs support.
@@ -58,9 +47,6 @@ testing =
@@ -58,8 +47,6 @@ testing =
pytest-xdist
sphinx>=4.3.2
jaraco.path>=3.2.0
- build[virtualenv]
build[virtualenv]
- filelock>=3.4.0
- pip_run>=8.8
ini2toml[lite]>=0.9
tomli-w>=1.0.0
testing-integration =
pytest
pytest-xdist
--
2.35.1
2.35.3

View File

@ -24,8 +24,8 @@
Name: python-setuptools
# When updating, update the bundled libraries versions bellow!
Version: 60.9.3
Release: 5%{?dist}
Version: 62.6.0
Release: 1%{?dist}
Summary: Easily build and distribute Python packages
# setuptools is MIT
# appdirs is MIT
@ -38,6 +38,8 @@ Summary: Easily build and distribute Python packages
# jaraco.text is MIT
# typing-extensions is Python
# zipp is MIT
# nspektr is MIT
# tomli is MIT
# the setuptools logo is MIT
License: MIT and ASL 2.0 and (BSD or ASL 2.0) and Python
URL: https://pypi.python.org/pypi/%{srcname}
@ -45,20 +47,6 @@ Source0: %{pypi_source %{srcname} %{version}}
# Some test deps are optional and either not desired or not available in Fedora, thus this patch removes them.
Patch: Remove-optional-or-unpackaged-test-deps.patch
# Increase test isolation by unsetting PYTHONPATH in spawned processes -
# with this patch tests run correctly in our special build environment
# This patch was merged upstream:
# https://github.com/pypa/setuptools/pull/3133
Patch: Isolate-spawned-processes-by-unsetting-PYTHONPATH.patch
# Run the tests using the wheel we've just built, there's no need to build
# a new one just for the tests (and it requires internet connection)
# 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
@ -100,9 +88,11 @@ Provides: bundled(python%{python3_pkgversion}dist(jaraco-text)) = 3.7
Provides: bundled(python%{python3_pkgversion}dist(more-itertools)) = 8.8
Provides: bundled(python%{python3_pkgversion}dist(ordered-set)) = 3.1.1
Provides: bundled(python%{python3_pkgversion}dist(packaging)) = 21.3
Provides: bundled(python%{python3_pkgversion}dist(pyparsing)) = 2.2.1
Provides: bundled(python%{python3_pkgversion}dist(pyparsing)) = 3.0.8
Provides: bundled(python%{python3_pkgversion}dist(typing-extensions)) = 4.0.1
Provides: bundled(python%{python3_pkgversion}dist(zipp)) = 3.7
Provides: bundled(python%{python3_pkgversion}dist(nspektr)) = 0.3
Provides: bundled(python%{python3_pkgversion}dist(tomli)) = 2.0.1
}
%package -n python%{python3_pkgversion}-setuptools
@ -191,9 +181,9 @@ install -p %{_pyproject_wheeldir}/%{python_wheel_name} -t %{buildroot}%{python_w
cat pkg_resources/_vendor/vendored.txt setuptools/_vendor/vendored.txt > allvendor.txt
%{_rpmconfigdir}/pythonbundles.py allvendor.txt --namespace 'python%{python3_pkgversion}dist' --compare-with '%{bundled}'
# Regression test, the wheel should not be larger than 800 KiB
# Regression test, the wheel should not be larger than 900 KiB
# https://bugzilla.redhat.com/show_bug.cgi?id=1914481#c3
test $(du %{_pyproject_wheeldir}/%{python_wheel_name} | cut -f1) -lt 800
test $(du %{_pyproject_wheeldir}/%{python_wheel_name} | cut -f1) -lt 900
# Regression test, the tests are not supposed to be installed
test ! -d %{buildroot}%{python3_sitelib}/pkg_resources/tests
@ -205,6 +195,7 @@ rm pyproject.toml
# Upstream tests
# --ignore=setuptools/tests/test_integration.py
# --ignore=setuptools/tests/integration/
# --ignore=setuptools/tests/config/test_apply_pyprojecttoml.py
# -k "not test_pip_upgrade_from_source"
# the tests require internet connection
# --ignore=setuptools/tests/test_develop.py
@ -214,6 +205,7 @@ PYTHONPATH=$(pwd) %pytest \
--ignore=setuptools/tests/test_integration.py \
--ignore=setuptools/tests/integration/ \
--ignore=setuptools/tests/test_develop.py \
--ignore=setuptools/tests/config/test_apply_pyprojecttoml.py \
-k "not test_pip_upgrade_from_source"
%endif # with tests
@ -239,6 +231,10 @@ PYTHONPATH=$(pwd) %pytest \
%changelog
* Tue Jun 14 2022 Charalampos Stratakis <cstratak@redhat.com> - 62.6.0-1
- Update to 62.6.0
- Fixes: rhbz#2064842
* Tue Jun 14 2022 Python Maint <python-maint@redhat.com> - 60.9.3-5
- Rebuilt for Python 3.11

View File

@ -1 +1 @@
SHA512 (setuptools-60.9.3.tar.gz) = 37ace6412532a7cb86f3c63fa94c8d60b1616f3cbae12499d01b6d21cb6f48ffc50d28d1f68e046c775c313a23873a02b999fdc9b95ec762b89d9c5746a63a1d
SHA512 (setuptools-62.6.0.tar.gz) = d67c438d507fc7959162b5e8c2a15e9c36d37e5cd7052e16eeb58d8a9bcf19b725a0e7b840e101500799d725bbc4c1872d0f79eead66a538e891cc7cfbe3d979