Update to 3.11.0a2

Patch 251 was updated to include specific install scheme for virtualenv
This commit is contained in:
Tomáš Hrnčiar 2021-11-08 08:25:56 +01:00
parent 3dd3c0a42b
commit 651691580e
4 changed files with 30 additions and 22 deletions

View File

@ -25,14 +25,15 @@ Downstream only for now, waiting for https://bugs.python.org/issue43976
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
Co-authored-by: Michal Cyprian <m.cyprian@gmail.com>
Co-authored-by: Lumír Balhar <frenzy.madness@gmail.com>
---
Lib/site.py | 9 ++++++++-
Lib/sysconfig.py | 19 +++++++++++++++++++
Lib/sysconfig.py | 25 +++++++++++++++++++++++++
Lib/test/test_sysconfig.py | 4 +++-
3 files changed, 30 insertions(+), 2 deletions(-)
3 files changed, 36 insertions(+), 2 deletions(-)
diff --git a/Lib/site.py b/Lib/site.py
index 939893eb5e..d1316c3355 100644
index e129f3b485..ab771c70dd 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -380,8 +380,15 @@ def getsitepackages(prefixes=None):
@ -53,16 +54,22 @@ index 939893eb5e..d1316c3355 100644
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 95b48f6429..226b55a556 100644
index daf9f00006..40e4edf0ae 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -58,6 +58,25 @@
@@ -58,6 +58,31 @@
},
}
+# backup the original posix_prefix as rpm_prefix
+# RPM packages use it and we need to be able to read it even when changed
+_INSTALL_SCHEMES['rpm_prefix'] = _INSTALL_SCHEMES['posix_prefix']
+# Virtualenv >= 20.10.0 favors the "venv" scheme over the defaults when creating virtual environments.
+# See: https://github.com/pypa/virtualenv/commit/8da79db86d8a5c74d03667a40e64ff832076445e
+# See: https://bugs.python.org/issue45413
+# "venv" should be the same as the unpatched posix_prefix for us,
+# so new virtual environments aren't created with paths like venv/local/bin/python.
+_INSTALL_SCHEMES['venv'] = _INSTALL_SCHEMES['posix_prefix']
+
+if (not (hasattr(sys, 'real_prefix') or
+ sys.prefix != sys.base_prefix) and
@ -83,7 +90,7 @@ index 95b48f6429..226b55a556 100644
# NOTE: site.py has copy of this function.
# Sync it when modify this function.
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 9408657c91..db4cbc55ec 100644
index 9408657c91..fd49b2bcce 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -263,7 +263,7 @@ def test_get_config_h_filename(self):
@ -91,7 +98,7 @@ index 9408657c91..db4cbc55ec 100644
def test_get_scheme_names(self):
- wanted = ['nt', 'posix_home', 'posix_prefix']
+ wanted = ['nt', 'posix_home', 'posix_prefix', 'rpm_prefix']
+ wanted = ['nt', 'posix_home', 'posix_prefix', 'rpm_prefix', 'venv']
if HAS_USER_BASE:
wanted.extend(['nt_user', 'osx_framework_user', 'posix_user'])
self.assertEqual(get_scheme_names(), tuple(sorted(wanted)))

View File

@ -19,7 +19,7 @@ Ideally, we should talk to upstream and explain why we don't want this
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/Lib/py_compile.py b/Lib/py_compile.py
index 0f9b59025c..59dc3fe50b 100644
index 388614e51b..db52725016 100644
--- a/Lib/py_compile.py
+++ b/Lib/py_compile.py
@@ -70,7 +70,8 @@ class PycInvalidationMode(enum.Enum):

View File

@ -14,10 +14,10 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well
%global general_version %{pybasever}.0
%global prerel a1
%global prerel a2
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 2%{?dist}
Release: 1%{?dist}
License: Python
@ -68,8 +68,8 @@ License: Python
# If the rpmwheels condition is disabled, we use the bundled wheel packages
# from Python with the versions below.
# This needs to be manually updated when we update Python.
%global pip_version 21.2.3
%global setuptools_version 57.4.0
%global pip_version 21.2.4
%global setuptools_version 58.1.0
# Expensive optimizations (mainly, profile-guided optimizations)
%bcond_without optimizations
@ -267,7 +267,7 @@ Source11: idle3.appdata.xml
# Was Patch0 in ivazquez' python3000 specfile
Patch1: 00001-rpath.patch
# 00251 # 0952e38e5bf725ebbab48b13a35566e30635ddf8
# 00251 # 531494a5ded29dad59f617304dab4eb8b7f80b0b
# Change user install location
#
# Change the values of sysconfig's "posix_prefix" install scheme to /usr/local
@ -1066,15 +1066,13 @@ CheckPython() {
# test_distutils
# distutils.tests.test_bdist_rpm tests fail when bootstraping the Python
# package: rpmbuild requires /usr/bin/pythonX.Y to be installed
# test_sundry and test_name_error_suggestions_do_not_trigger_for_too_many_locals fail with Python 3.11.0a1.
# Fixes should be included in 2nd alpha.
# https://bugs.python.org/issue45400
# https://bugs.python.org/issue45402
# test_freeze_simple_script is skipped, because it fails when bundled wheels
# are removed in Fedora.
# upstream report: https://bugs.python.org/issue45783
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest -j0 --timeout=1800 \
-i test_sundry \
-i test_name_error_suggestions_do_not_trigger_for_too_many_locals \
-i test_freeze_simple_script \
%if %{with bootstrap}
-x test_distutils \
%endif
@ -1438,7 +1436,6 @@ CheckPython optimized
%{pylibdir}/ctypes/test
%{pylibdir}/distutils/tests
%{pylibdir}/sqlite3/test
%{pylibdir}/test
%{dynload_dir}/_ctypes_test.%{SOABI_optimized}.so
%{dynload_dir}/_testbuffer.%{SOABI_optimized}.so
@ -1601,6 +1598,10 @@ CheckPython optimized
# ======================================================
%changelog
* Mon Nov 15 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.11.0~a2-1
- Update to 3.11.0a2
- Patch 251 was updated to include specific install scheme for virtualenv
* Fri Nov 12 2021 Björn Esser <besser82@fedoraproject.org> - 3.11.0~a1-2
- Rebuild(libnsl2)

View File

@ -1,2 +1,2 @@
SHA512 (Python-3.11.0a1.tar.xz) = 3705fa3d05fccd491fba981c9495d5b36793f284a39b267a5ff7b25c7f08de84bbd5afe200296cedd1cc55f495fd3efc55d7b34910e1be1a785ce5772b857d7a
SHA512 (Python-3.11.0a1.tar.xz.asc) = b9d1542f215b5633835d21de0311d324c62e53b7afc525c00d26c863740fd01cc8c18a6ecb0a8ce8d38bf543cebdb64f0930f9201a8968dbbedf58fe9ad4c05c
SHA512 (Python-3.11.0a2.tar.xz) = 9a7c4d2be0cdf5801aaf6ec6337390a2f0e711badf0e0e35bcf0e5c98f652c68cf523afb991e87f4a1d1604eed3d19c56654d55922986ab27234e82675b20391
SHA512 (Python-3.11.0a2.tar.xz.asc) = 617181a854c884c6d3a79368000ca82430bc391573ae3a1b25f69939bce3d2d365e8ca7166d941856a78f3598ab4e7720a144ecb6c3a9de1aff5928799c2988d