Compare commits

...
Sign in to create a new pull request.

16 commits

Author SHA1 Message Date
Tomáš Hrnčiar
9cdc209f32 Update to 3.10.4 2022-03-25 08:26:25 +01:00
Tomáš Hrnčiar
32a875cf5a Update to 3.10.3 2022-03-18 09:21:49 +01:00
Tomáš Hrnčiar
157026d496 Update to 3.10.2 2022-01-17 15:59:07 +01:00
Miro Hrončok
b0e3df15cf Instruct pypa/distutils to add /local/ addition to prefix 2022-01-17 15:57:07 +01:00
Miro Hrončok
f4614ae0c5 Fedora < 36 only: Instruct pip to use distutils
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2014513
2022-01-17 15:57:02 +01:00
Tomáš Hrnčiar
f28d257931 Update to 3.10.1 2021-12-08 07:47:12 +01:00
Miro Hrončok
e01c3b2052 Fedora CI: Also test virtualenv 2021-12-07 16:11:47 +01:00
Miro Hrončok
7d9c34a78f Cosmetic CI config change: Use the new tox package name 2021-12-07 16:10:10 +01:00
Tomáš Hrnčiar
8c319ef159 Enable test_frozentable
test_frozentable was disabled due to error in Python 3.10.0a6. This is
now fixed so test can be enabled again.
2021-10-07 13:58:13 +02:00
Miro Hrončok
164685ac33 Update to 3.10.0 final
Patch 367 was included in this release.
2021-10-04 21:29:52 +02:00
Tomas Hrnciar
bff61f418f Update to 3.10.0rc2 2021-09-09 11:42:44 +02:00
Tomas Hrnciar
e8bd81e89f Update to 3.10.0rc1 2021-08-04 12:41:54 +02:00
Fedora Release Engineering
c88b86e951 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2021-07-23 10:31:38 +00:00
Petr Viktorin
48a8eccbb0 Require pyproject-rpm-macros from python3-devel
Part of the new Python packaging guidelines change:
- https://fedoraproject.org/wiki/Changes/PythonPackagingGuidelines202x
- https://bugzilla.redhat.com/show_bug.cgi?id=1977883
2021-07-16 09:49:45 +00:00
Petr Viktorin
0f2ca3b254 Provide python3-turtle from python3-tkinter
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1952565
2021-07-16 09:49:45 +00:00
Miro Hrončok
e200f570e4 Update to 3.10.0b4
- patch 363 was a backport
- bundled pip was updated to 21.1.3
2021-07-12 00:30:13 +02:00
8 changed files with 229 additions and 72 deletions

View file

@ -9,7 +9,7 @@ Subject: [PATCH] 00001: Fixup distutils/unixccompiler.py to remove standard
1 file changed, 9 insertions(+)
diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
index f0792de74a..4d837936c6 100644
index d00c48981e..0283a28c19 100644
--- a/Lib/distutils/unixccompiler.py
+++ b/Lib/distutils/unixccompiler.py
@@ -82,6 +82,15 @@ class UnixCCompiler(CCompiler):

View file

@ -2,41 +2,53 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Michal Cyprian <m.cyprian@gmail.com>
Date: Mon, 26 Jun 2017 16:32:56 +0200
Subject: [PATCH] 00251: Change user install location
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Set values of prefix and exec_prefix in distutils install command
to /usr/local if executable is /usr/bin/python* and RPM build
is not detected to make pip and distutils install into separate location.
Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
Downstream only: Awaiting resources to work on upstream PEP
Downstream only: Reworked in Fedora 36+ to follow https://bugs.python.org/issue43976
pypa/distutils integration: https://github.com/pypa/distutils/pull/70
Also set sysconfig._PIP_USE_SYSCONFIG = False, to force pip-upgraded-pip
to respect this patched distutils install command.
See https://bugzilla.redhat.com/show_bug.cgi?id=2014513
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
---
Lib/distutils/command/install.py | 15 +++++++++++++--
Lib/distutils/command/install.py | 8 ++++++--
Lib/site.py | 9 ++++++++-
2 files changed, 21 insertions(+), 3 deletions(-)
Lib/sysconfig.py | 16 ++++++++++++++++
3 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index 26696cfb9d..1826cbcb38 100644
index 01d5331a63..79f70f0de4 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -441,8 +441,19 @@ def finalize_unix(self):
@@ -159,6 +159,8 @@ class install(Command):
negative_opt = {'no-compile' : 'compile'}
+ # Allow Fedora to add components to the prefix
+ _prefix_addition = getattr(sysconfig, '_prefix_addition', '')
def initialize_options(self):
"""Initializes options."""
@@ -441,8 +443,10 @@ def finalize_unix(self):
raise DistutilsOptionError(
"must not supply exec-prefix without prefix")
- self.prefix = os.path.normpath(sys.prefix)
- self.exec_prefix = os.path.normpath(sys.exec_prefix)
+ # self.prefix is set to sys.prefix + /local/
+ # if neither RPM build nor virtual environment is
+ # detected to make pip and distutils install packages
+ # into the separate location.
+ if (not (hasattr(sys, 'real_prefix') or
+ sys.prefix != sys.base_prefix) and
+ 'RPM_BUILD_ROOT' not in os.environ):
+ addition = "/local"
+ else:
+ addition = ""
+
+ self.prefix = os.path.normpath(sys.prefix) + addition
+ self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition
+ self.prefix = (
+ os.path.normpath(sys.prefix) + self._prefix_addition)
+ self.exec_prefix = (
+ os.path.normpath(sys.exec_prefix) + self._prefix_addition)
else:
if self.exec_prefix is None:
@ -61,3 +73,30 @@ index 939893eb5e..d1316c3355 100644
for sitedir in getsitepackages(prefixes):
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index daf9f00006..b88f9a9de0 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -58,6 +58,22 @@
},
}
+# Force pip to use distutils paths instead of sysconfig
+# https://github.com/pypa/pip/issues/10647
+_PIP_USE_SYSCONFIG = False
+
+# This is used by distutils.command.install in the stdlib
+# as well as pypa/distutils (e.g. bundled in setuptools).
+# The self.prefix value is set to sys.prefix + /local/
+# if neither RPM build nor virtual environment is
+# detected to make distutils install packages
+# into the separate location.
+# https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
+if (not (hasattr(sys, 'real_prefix') or
+ sys.prefix != sys.base_prefix) and
+ 'RPM_BUILD_ROOT' not in os.environ):
+ _prefix_addition = "/local"
+
# NOTE: site.py has copy of this function.
# Sync it when modify this function.

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

@ -1,36 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Fri, 18 Jun 2021 15:16:04 +0200
Subject: [PATCH] 00363: Reset DeprecationWarning filters in
test_importlib.test_entry_points_by_index
This avoids StopIteration error when running tests.
https://bugs.python.org/issue44451
---
Lib/test/test_importlib/test_metadata_api.py | 1 +
.../NEWS.d/next/Tests/2021-06-18-15-19-35.bpo-44451.aj5pqE.rst | 3 +++
2 files changed, 4 insertions(+)
create mode 100644 Misc/NEWS.d/next/Tests/2021-06-18-15-19-35.bpo-44451.aj5pqE.rst
diff --git a/Lib/test/test_importlib/test_metadata_api.py b/Lib/test/test_importlib/test_metadata_api.py
index 3506493463..2bfc44b18e 100644
--- a/Lib/test/test_importlib/test_metadata_api.py
+++ b/Lib/test/test_importlib/test_metadata_api.py
@@ -139,6 +139,7 @@ def test_entry_points_by_index(self):
"""
eps = distribution('distinfo-pkg').entry_points
with warnings.catch_warnings(record=True) as caught:
+ warnings.filterwarnings("default", category=DeprecationWarning)
eps[0]
# check warning
diff --git a/Misc/NEWS.d/next/Tests/2021-06-18-15-19-35.bpo-44451.aj5pqE.rst b/Misc/NEWS.d/next/Tests/2021-06-18-15-19-35.bpo-44451.aj5pqE.rst
new file mode 100644
index 0000000000..0f635cfe18
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2021-06-18-15-19-35.bpo-44451.aj5pqE.rst
@@ -0,0 +1,3 @@
+Reset ``DeprecationWarning`` filters in
+``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index``
+to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored.

View file

@ -0,0 +1,103 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= <thrnciar@redhat.com>
Date: Tue, 7 Dec 2021 14:41:59 +0100
Subject: [PATCH] 00371: Revert "bpo-1596321: Fix threading._shutdown() for the
main thread (GH-28549) (GH-28589)"
This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It
introduced regression causing FreeIPA's tests to fail.
For more info see:
https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31
https://github.com/GrahamDumpleton/mod_wsgi/issues/730
---
Lib/test/test_threading.py | 33 ---------------------------------
Lib/threading.py | 25 ++++++++-----------------
2 files changed, 8 insertions(+), 50 deletions(-)
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index c54806e594..c51de6f4b8 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -928,39 +928,6 @@ def test_debug_deprecation(self):
b'is deprecated and will be removed in Python 3.12')
self.assertIn(msg, err)
- def test_import_from_another_thread(self):
- # bpo-1596321: If the threading module is first import from a thread
- # different than the main thread, threading._shutdown() must handle
- # this case without logging an error at Python exit.
- code = textwrap.dedent('''
- import _thread
- import sys
-
- event = _thread.allocate_lock()
- event.acquire()
-
- def import_threading():
- import threading
- event.release()
-
- if 'threading' in sys.modules:
- raise Exception('threading is already imported')
-
- _thread.start_new_thread(import_threading, ())
-
- # wait until the threading module is imported
- event.acquire()
- event.release()
-
- if 'threading' not in sys.modules:
- raise Exception('threading is not imported')
-
- # don't wait until the thread completes
- ''')
- rc, out, err = assert_python_ok("-c", code)
- self.assertEqual(out, b'')
- self.assertEqual(err, b'')
-
class ThreadJoinOnShutdown(BaseTestCase):
diff --git a/Lib/threading.py b/Lib/threading.py
index 2d89742913..928b3f715d 100644
--- a/Lib/threading.py
+++ b/Lib/threading.py
@@ -1523,29 +1523,20 @@ def _shutdown():
global _SHUTTING_DOWN
_SHUTTING_DOWN = True
+ # Main thread
+ tlock = _main_thread._tstate_lock
+ # The main thread isn't finished yet, so its thread state lock can't have
+ # been released.
+ assert tlock is not None
+ assert tlock.locked()
+ tlock.release()
+ _main_thread._stop()
# Call registered threading atexit functions before threads are joined.
# Order is reversed, similar to atexit.
for atexit_call in reversed(_threading_atexits):
atexit_call()
- # Main thread
- if _main_thread.ident == get_ident():
- tlock = _main_thread._tstate_lock
- # The main thread isn't finished yet, so its thread state lock can't
- # have been released.
- assert tlock is not None
- assert tlock.locked()
- tlock.release()
- _main_thread._stop()
- else:
- # bpo-1596321: _shutdown() must be called in the main thread.
- # If the threading module was not imported by the main thread,
- # _main_thread is the thread which imported the threading module.
- # In this case, ignore _main_thread, similar behavior than for threads
- # spawned by C libraries or using _thread.start_new_thread().
- pass
-
# Join all non-deamon threads
while True:
with _shutdown_locks_lock:

View file

@ -13,8 +13,8 @@ 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 b3
%global general_version %{pybasever}.4
#global prerel ...
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
@ -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.1.1
%global setuptools_version 56.0.0
%global pip_version 22.0.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 # 5c445123f04d96be42a35eef5119378ba1713a96
# 00251 # 08a62456431df182dfad18ad75838f769aca2d08
# Change user install location
#
# Set values of prefix and exec_prefix in distutils install command
@ -275,7 +275,13 @@ Patch1: 00001-rpath.patch
# is not detected to make pip and distutils install into separate location.
#
# Fedora Change: https://fedoraproject.org/wiki/Changes/Making_sudo_pip_safe
# Downstream only: Awaiting resources to work on upstream PEP
# Downstream only: Reworked in Fedora 36+ to follow https://bugs.python.org/issue43976
#
# pypa/distutils integration: https://github.com/pypa/distutils/pull/70
#
# Also set sysconfig._PIP_USE_SYSCONFIG = False, to force pip-upgraded-pip
# to respect this patched distutils install command.
# See https://bugzilla.redhat.com/show_bug.cgi?id=2014513
Patch251: 00251-change-user-install-location.patch
# 00328 # 318e500c98f5e59eb1f23e0fcd32db69b9bd17e1
@ -292,13 +298,16 @@ Patch251: 00251-change-user-install-location.patch
# Ideally, we should talk to upstream and explain why we don't want this
Patch328: 00328-pyc-timestamp-invalidation-mode.patch
# 00363 # bcb4a805ad54d3a810fb54582e67c5f5fe6d9773
# Reset DeprecationWarning filters in test_importlib.test_entry_points_by_index
# 00371 # c1754d9c2750f89cb702e1b63a99201f5f7cff00
# Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)"
#
# This avoids StopIteration error when running tests.
# This reverts commit 38c67738c64304928c68d5c2bd78bbb01d979b94. It
# introduced regression causing FreeIPA's tests to fail.
#
# https://bugs.python.org/issue44451
Patch363: 00363-reset-deprecationwarning-filters-in-test_importlib-test_entry_points_by_index.patch
# For more info see:
# https://bodhi.fedoraproject.org/updates/FEDORA-2021-e152ce5f31
# https://github.com/GrahamDumpleton/mod_wsgi/issues/730
Patch371: 00371-revert-bpo-1596321-fix-threading-_shutdown-for-the-main-thread-gh-28549-gh-28589.patch
# (New patches go here ^^^)
#
@ -461,6 +470,7 @@ Requires: %{pkgname}-libs%{?_isa} = %{version}-%{release}
# But we want them when packages BuildRequire python3-devel
Requires: (python-rpm-macros if rpm-build)
Requires: (python3-rpm-macros if rpm-build)
Requires: (pyproject-rpm-macros if rpm-build)
# Python developers are very likely to need pip
Recommends: %{pkgname}-pip
@ -512,6 +522,10 @@ configuration, browsers, and other dialogs.
Summary: A GUI toolkit for Python
Requires: %{pkgname} = %{version}-%{release}
# The importable module "turtle" is here, so provide python3-turtle.
# (We don't provide python3-turtledemo, that's not too useful when imported.)
%py_provides %{pkgname}-turtle
%description -n %{pkgname}-tkinter
The Tkinter (Tk interface) library is a graphical user interface toolkit for
the Python programming language.
@ -1061,10 +1075,8 @@ 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_frozentable fails with Python 3.10.0a6 (https://bugs.python.org/issue43372)
LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
-wW --slowest -j0 --timeout=1800 \
-i test_frozentable \
%if %{with bootstrap}
-x test_distutils \
%endif
@ -1586,6 +1598,42 @@ CheckPython optimized
# ======================================================
%changelog
* Fri Mar 25 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.10.4-1
- Update to 3.10.4
* Fri Mar 18 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.10.3-1
- Update to 3.10.3
* Mon Jan 17 2022 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.10.2-1
- Update to 3.10.2
* Thu Dec 09 2021 Miro Hrončok <mhroncok@redhat.com> - 3.10.1-2
- Instruct pip to use distutils
- Instruct pypa/distutils to add /local/ addition to prefix
- Fixes rhbz#2014513
* Tue Dec 07 2021 Tomáš Hrnčiar <thrnciar@redhat.com> - 3.10.1-1
- Update to 3.10.1
* Mon Oct 04 2021 Miro Hrončok <mhroncok@redhat.com> - 3.10.0-1
- Update to 3.10.0 final
* Wed Sep 08 2021 Tomas Hrnciar <thrnciar@redhat.com> - 3.10.0~rc2-1
- Update to 3.10.0rc2
* Tue Aug 03 2021 Tomas Hrnciar <thrnciar@redhat.com> - 3.10.0~rc1-1
- Update to 3.10.0rc1
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.10.0~b4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jul 16 2021 Petr Viktorin <pviktori@redhat.com> - 3.10.0~b4-2
- Provide python3-turtle from python3-tkinter
- Require pyproject-rpm-macros from python3-devel
* Sun Jul 11 2021 Miro Hrončok <mhroncok@redhat.com> - 3.10.0~b4-1
- Update to 3.10.0b4
* Thu Jun 17 2021 Miro Hrončok <mhroncok@redhat.com> - 3.10.0~b3-1
- Update to 3.10.0b3

View file

@ -1,2 +1,2 @@
SHA512 (Python-3.10.0b3.tar.xz) = ef0dc5eddb5f9702ab88faa2827455347caa81ab6c03192d6e37c968a40c53ab485d5c923905c511d19bc35e10129aa302f6733e0a7d296da8f725367dd1b258
SHA512 (Python-3.10.0b3.tar.xz.asc) = 6b8d2caf753f0d92019e18d1441e323a44aff06ee8bdc272572a67359dc4bece833db56b9318c91962d39ee4d09bf701b548d71ae02c4b64f3c21f1c23ed1d36
SHA512 (Python-3.10.4.tar.xz) = 6c9aeecddc55c7896b2e8527fca131c7b2b6127d56ce1a001ccedfebf590334e0c0bb7c517ed3cf1da3c1910e002552b56aa7e03eeb672f42ff0bd8150799113
SHA512 (Python-3.10.4.tar.xz.asc) = 699e37bf09067083af159e3734b38c952bdc75432c8abfb7a7b8cce7ca975038da37490abeb5c13befd2dacb84a5341ad30de5d0a63d35af5c512215744f4d6d

View file

@ -19,6 +19,9 @@
- smoke:
dir: python/smoke
run: VERSION=3.10 ./venv.sh
- smoke_virtualenv:
dir: python/smoke
run: VERSION=3.10 METHOD=virtualenv ./venv.sh
- selftest:
dir: python/selftest
run: VERSION=3.10 X="" ./parallel.sh
@ -29,6 +32,6 @@
- gcc # for extension building in venv and selftest
- gdb # for test_gdb
- python3.10
- python3-tox # for venv tests
- tox # for venv tests
- glibc-all-langpacks # for locale tests
- marshalparser # for testing compatibility (magic numbers) with marshalparser