From 2d800732862d491c7f7c355c86d86467c249b1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 23 Aug 2022 12:44:36 +0200 Subject: [PATCH 1/4] Update the license tag to SPDX See https://gitlab.com/fedora/legal/fedora-license-data/-/merge_requests/61 The LICENSE file differs from the text at https://spdx.org/licenses/Python-2.0.1.html only by: - not saying "Python 2.0.1" but "Python" which is considered OK - copyright years which is considered OK - formatting - listing the history and license for code examples from the documentation (the documentation is not shipped via this package) --- python3.11.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python3.11.spec b/python3.11.spec index 2923fd5..cbde66d 100644 --- a/python3.11.spec +++ b/python3.11.spec @@ -18,7 +18,7 @@ URL: https://www.python.org/ %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} -License: Python +License: Python-2.0.1 # ================================== From 58109b55ab538920043beccd697870fc8002ac01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 25 Oct 2022 00:46:26 +0200 Subject: [PATCH 2/4] Update to 3.11.0 --- python3.11.spec | 9 ++++++--- sources | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/python3.11.spec b/python3.11.spec index cbde66d..1d5c46c 100644 --- a/python3.11.spec +++ b/python3.11.spec @@ -14,7 +14,7 @@ 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 rc2 +#global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} Release: 1%{?dist} @@ -67,8 +67,8 @@ License: Python-2.0.1 # 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 22.2.2 -%global setuptools_version 63.2.0 +%global pip_version 22.3 +%global setuptools_version 65.5.0 # Expensive optimizations (mainly, profile-guided optimizations) %bcond_without optimizations @@ -1595,6 +1595,9 @@ CheckPython optimized # ====================================================== %changelog +* Mon Oct 24 2022 Miro Hrončok - 3.11.0-1 +- Update to 3.11.0 + * Tue Sep 13 2022 Miro Hrončok - 3.11.0~rc2-1 - Update to 3.11.0rc2 diff --git a/sources b/sources index 345b6b6..5763e8f 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.11.0rc2.tar.xz) = 8b37bc9df3c966bd35cffdb7d6406a3c1a5ccfbea10bd8dad498880e3b1492f8cdbbe227ab3a30557843eb05d8fb93077c791e25d71b33ed420992d54b6c9473 -SHA512 (Python-3.11.0rc2.tar.xz.asc) = 13e6bfa719db29aa169763399203168923cbfbb01d209e18269399ca84723582f480134edd3bf9f24785cd5ab0486411132d6bbb354fa45ebbba68bf4c70021a +SHA512 (Python-3.11.0.tar.xz) = 314eef88ae0d68760f34d7a32f238fd2ecb27c50963baa7357c42ad8159026ec50229a0b31d83c39710a472904a06422afc082f9658a90a1dc83ccb74c08039d +SHA512 (Python-3.11.0.tar.xz.asc) = d20fb152c5b16cfef1f59af588f7576eb45c903d9e15fd4ad0e15fd32bef7ffd951b99a062d2944234ecffcf29eb9266544e92d2f6584710cbb20ba38f8ac224 From 19bf071b14429785697266e02160592a27682f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= Date: Wed, 7 Dec 2022 11:57:51 +0100 Subject: [PATCH 3/4] Update to 3.11.1 --- 00251-change-user-install-location.patch | 2 +- python3.11.spec | 7 +++++-- sources | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/00251-change-user-install-location.patch b/00251-change-user-install-location.patch index 6c3caac..53096ec 100644 --- a/00251-change-user-install-location.patch +++ b/00251-change-user-install-location.patch @@ -160,7 +160,7 @@ index ebe3711827..55af57b335 100644 # On Windows we want to substitute 'lib' for schemes rather # than the native value (without modifying vars, in case it diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py -index 578ac1db50..dc58e7db18 100644 +index d96371d242..72b028435f 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -111,8 +111,19 @@ def test_get_path(self): diff --git a/python3.11.spec b/python3.11.spec index 1d5c46c..8f48027 100644 --- a/python3.11.spec +++ b/python3.11.spec @@ -13,7 +13,7 @@ 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 general_version %{pybasever}.1 #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} @@ -67,7 +67,7 @@ License: Python-2.0.1 # 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 22.3 +%global pip_version 22.3.1 %global setuptools_version 65.5.0 # Expensive optimizations (mainly, profile-guided optimizations) @@ -1595,6 +1595,9 @@ CheckPython optimized # ====================================================== %changelog +* Wed Dec 07 2022 Tomáš Hrnčiar - 3.11.1-1 +- Update to 3.11.1 + * Mon Oct 24 2022 Miro Hrončok - 3.11.0-1 - Update to 3.11.0 diff --git a/sources b/sources index 5763e8f..327dc94 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (Python-3.11.0.tar.xz) = 314eef88ae0d68760f34d7a32f238fd2ecb27c50963baa7357c42ad8159026ec50229a0b31d83c39710a472904a06422afc082f9658a90a1dc83ccb74c08039d -SHA512 (Python-3.11.0.tar.xz.asc) = d20fb152c5b16cfef1f59af588f7576eb45c903d9e15fd4ad0e15fd32bef7ffd951b99a062d2944234ecffcf29eb9266544e92d2f6584710cbb20ba38f8ac224 +SHA512 (Python-3.11.1.tar.xz) = 5edd70c881e083c96199c60471f18f9ebc4c97a2d45dc66f89e16d7c3638d8a5d2cbf2e84b1be3d7f1178ce9f7fa4197884385c1ee3618ff66a538f872f318ed +SHA512 (Python-3.11.1.tar.xz.asc) = 81ed05c2adf38552bdc5ac761704f2720a646d56681a919a6bfa51f1a4b42cd14edb9c84d58664dbc8e7b561cd78d82ae6b10dda423e1fae543bc7fa4bf3f78e From 11c77ae3885da670bff924479a50228fe0951b64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 19 Dec 2022 14:51:17 +0000 Subject: [PATCH 4/4] No longer patch the default bytecode cache invalidation policy That is, drop patch 328. Fixes https://bugzilla.redhat.com/2133850 See also https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/154 This is part of https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes --- 00328-pyc-timestamp-invalidation-mode.patch | 54 --------------------- check-pyc-timestamps.py | 8 ++- python3.11.spec | 31 ++++++------ 3 files changed, 18 insertions(+), 75 deletions(-) delete mode 100644 00328-pyc-timestamp-invalidation-mode.patch diff --git a/00328-pyc-timestamp-invalidation-mode.patch b/00328-pyc-timestamp-invalidation-mode.patch deleted file mode 100644 index d04a267..0000000 --- a/00328-pyc-timestamp-invalidation-mode.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 11 Jul 2019 13:44:13 +0200 -Subject: [PATCH] 00328: Restore pyc to TIMESTAMP invalidation mode as default - in rpmbuild - -Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest -%changelog date. This makes Python default to the CHECKED_HASH pyc -invalidation mode, bringing more reproducible builds traded for an import -performance decrease. To avoid that, we don't default to CHECKED_HASH -when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages). - -See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 -Downstream only: only used when building RPM packages -Ideally, we should talk to upstream and explain why we don't want this ---- - Lib/py_compile.py | 3 ++- - Lib/test/test_py_compile.py | 2 ++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Lib/py_compile.py b/Lib/py_compile.py -index 388614e51b..db52725016 100644 ---- a/Lib/py_compile.py -+++ b/Lib/py_compile.py -@@ -70,7 +70,8 @@ class PycInvalidationMode(enum.Enum): - - - def _get_default_invalidation_mode(): -- if os.environ.get('SOURCE_DATE_EPOCH'): -+ if (os.environ.get('SOURCE_DATE_EPOCH') and not -+ os.environ.get('RPM_BUILD_ROOT')): - return PycInvalidationMode.CHECKED_HASH - else: - return PycInvalidationMode.TIMESTAMP -diff --git a/Lib/test/test_py_compile.py b/Lib/test/test_py_compile.py -index a4a52b180d..e53f5d92aa 100644 ---- a/Lib/test/test_py_compile.py -+++ b/Lib/test/test_py_compile.py -@@ -19,6 +19,7 @@ def without_source_date_epoch(fxn): - def wrapper(*args, **kwargs): - with os_helper.EnvironmentVarGuard() as env: - env.unset('SOURCE_DATE_EPOCH') -+ env.unset('RPM_BUILD_ROOT') - return fxn(*args, **kwargs) - return wrapper - -@@ -29,6 +30,7 @@ def with_source_date_epoch(fxn): - def wrapper(*args, **kwargs): - with os_helper.EnvironmentVarGuard() as env: - env['SOURCE_DATE_EPOCH'] = '123456789' -+ env.unset('RPM_BUILD_ROOT') - return fxn(*args, **kwargs) - return wrapper - diff --git a/check-pyc-timestamps.py b/check-pyc-timestamps.py index 91af4fd..e421fca 100644 --- a/check-pyc-timestamps.py +++ b/check-pyc-timestamps.py @@ -19,11 +19,9 @@ not_compiled = [ '*/test/bad_coding.py', '*/test/bad_coding2.py', '*/test/badsyntax_*.py', - '*/lib2to3/tests/data/bom.py', - '*/lib2to3/tests/data/crlf.py', - '*/lib2to3/tests/data/different_encoding.py', - '*/lib2to3/tests/data/false_encoding.py', - '*/lib2to3/tests/data/py2_test_grammar.py', + '*/lib2to3/tests/data/*.py', + '*/lib2to3/tests/data/*/*.py', + '*/lib2to3/tests/data/*/*/*.py', '*.debug-gdb.py', ] diff --git a/python3.11.spec b/python3.11.spec index 8f48027..e870792 100644 --- a/python3.11.spec +++ b/python3.11.spec @@ -17,7 +17,7 @@ URL: https://www.python.org/ #global prerel ... %global upstream_version %{general_version}%{?prerel} Version: %{general_version}%{?prerel:~%{prerel}} -Release: 1%{?dist} +Release: 2%{?dist} License: Python-2.0.1 @@ -298,20 +298,6 @@ Patch1: 00001-rpath.patch # pypa/distutils integration: https://github.com/pypa/distutils/pull/70 Patch251: 00251-change-user-install-location.patch -# 00328 # 318e500c98f5e59eb1f23e0fcd32db69b9bd17e1 -# Restore pyc to TIMESTAMP invalidation mode as default in rpmbuild -# -# Since Fedora 31, the $SOURCE_DATE_EPOCH is set in rpmbuild to the latest -# %%changelog date. This makes Python default to the CHECKED_HASH pyc -# invalidation mode, bringing more reproducible builds traded for an import -# performance decrease. To avoid that, we don't default to CHECKED_HASH -# when $RPM_BUILD_ROOT is set (i.e. when we are building RPM packages). -# -# See https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/57#comment-27426 -# Downstream only: only used when building RPM packages -# Ideally, we should talk to upstream and explain why we don't want this -Patch328: 00328-pyc-timestamp-invalidation-mode.patch - # 00371 # c1754d9c2750f89cb702e1b63a99201f5f7cff00 # Revert "bpo-1596321: Fix threading._shutdown() for the main thread (GH-28549) (GH-28589)" # @@ -945,15 +931,25 @@ find . -name "*~" -exec rm -f {} \; # Python CMD line options: # -s - don't add user site directory to sys.path # -B - don't write .pyc files on import +# Clamp the source mtime first, see https://fedoraproject.org/wiki/Changes/ReproducibleBuildsClampMtimes +# The clamp_source_mtime module is only guaranteed to exist on Fedoras that enabled this option: +%if 0%{?clamp_mtime_to_source_date_epoch} +LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ +PYTHONPATH="%{_rpmconfigdir}/redhat" \ +%{buildroot}%{_bindir}/python%{pybasever} -s -B -m clamp_source_mtime %{buildroot}%{pylibdir} +%endif # compileall CMD line options: # -f - force rebuild even if timestamps are up to date # -o - optimization levels to run compilation with # -s - part of path to left-strip from path to source file (buildroot) # -p - path to add as prefix to path to source file (/ to make it absolute) # --hardlink-dupes - hardlink different optimization level pycs together if identical (saves space) +# --invalidation-mode - we prefer the timestamp invalidation mode for performance reasons +# -x - skip test modules with SyntaxErrors (taken from the Makefile) LD_LIBRARY_PATH="%{buildroot}%{dynload_dir}/:%{buildroot}%{_libdir}" \ %{buildroot}%{_bindir}/python%{pybasever} -s -B -m compileall \ --f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes || : +-f %{_smp_mflags} -o 0 -o 1 -o 2 -s %{buildroot} -p / %{buildroot} --hardlink-dupes --invalidation-mode=timestamp \ +-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' # Turn this BRP off, it is done by compileall2 --hardlink-dupes above %global __brp_python_hardlink %{nil} @@ -1595,6 +1591,9 @@ CheckPython optimized # ====================================================== %changelog +* Mon Dec 19 2022 Miro Hrončok - 3.11.1-2 +- No longer patch the default bytecode cache invalidation policy + * Wed Dec 07 2022 Tomáš Hrnčiar - 3.11.1-1 - Update to 3.11.1