From 9809d09b3377e35b8cd09d66bdd9f9ca89a1b99ddcca194c74c703dcc4bbf046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Fri, 17 Jul 2020 06:40:44 +0000 Subject: [PATCH] Accepting request 821366 from home:gmbr3:Active - Spec file fixes - Re-added subprocess-raise-timeout.patch: now compatible - Removed bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch: contained in upstream OBS-URL: https://build.opensuse.org/request/show/821366 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python39?expand=0&rev=10 --- ...sed_invalidation_w_SOURCE_DATE_EPOCH.patch | 130 ------------------ python39.changes | 7 + python39.spec | 24 ++-- subprocess-raise-timeout.patch | 12 ++ 4 files changed, 33 insertions(+), 140 deletions(-) delete mode 100644 bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch create mode 100644 subprocess-raise-timeout.patch diff --git a/bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch b/bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch deleted file mode 100644 index ac42871..0000000 --- a/bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch +++ /dev/null @@ -1,130 +0,0 @@ -From 2c096b513273a758b446405d9e5efe4860af1036 Mon Sep 17 00:00:00 2001 -From: Elvis Pranskevichus -Date: Thu, 27 Sep 2018 13:05:14 -0400 -Subject: [PATCH] bpo-34022: Stop forcing of hash-based invalidation with - SOURCE_DATE_EPOCH - -Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in -3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides -*invalidation_mode*, even if it was passed as an explicit argument to -``py_compile.compile()`` or ``compileall``. An environment variable -should *never* override an explicit argument to a library function. -That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` -environment variable is set. - -This changes ``py_compile.compile()`` to only look at -``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. -I also made various relevant tests run with explicit control over the -value of ``SOURCE_DATE_EPOCH``. - -While looking at this, I noticed that ``zipimport`` does not work -with hash-based .pycs _at all_, though I left the fixes for -subsequent commits. ---- - Doc/library/compileall.rst | 11 ++-- - Doc/library/py_compile.rst | 13 ++-- - Lib/compileall.py | 20 ++++-- - Lib/py_compile.py | 13 +++- - Lib/test/test_compileall.py | 50 ++++++++++++-- - .../test_importlib/source/test_file_loader.py | 15 +++++ - Lib/test/test_py_compile.py | 66 +++++++++++++++++-- - .../2018-09-27-13-14-15.bpo-34022.E2cl0r.rst | 3 + - 8 files changed, 161 insertions(+), 30 deletions(-) - create mode 100644 Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst - ---- a/Doc/library/py_compile.rst -+++ b/Doc/library/py_compile.rst -@@ -92,6 +92,11 @@ byte-code cache files in the directory c - .. versionchanged:: 3.8 - The *quiet* parameter was added. - -+ .. versionchanged:: 3.7.2 -+ The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer -+ overrides the value of the *invalidation_mode* argument, and determines -+ its default value instead. -+ - - .. class:: PycInvalidationMode - ---- a/Lib/test/test_compileall.py -+++ b/Lib/test/test_compileall.py -@@ -396,6 +396,21 @@ class CompileallTestsWithoutSourceEpoch( - pass - - -+ -+class CompileallTestsWithSourceEpoch(CompileallTestsBase, -+ unittest.TestCase, -+ metaclass=SourceDateEpochTestMeta, -+ source_date_epoch=True): -+ pass -+ -+ -+class CompileallTestsWithoutSourceEpoch(CompileallTestsBase, -+ unittest.TestCase, -+ metaclass=SourceDateEpochTestMeta, -+ source_date_epoch=False): -+ pass -+ -+ - class EncodingTest(unittest.TestCase): - """Issue 6716: compileall should escape source code when printing errors - to stdout.""" ---- a/Lib/test/test_importlib/source/test_file_loader.py -+++ b/Lib/test/test_importlib/source/test_file_loader.py -@@ -22,6 +22,9 @@ from test.support import make_legacy_pyc - from test.test_py_compile import without_source_date_epoch - from test.test_py_compile import SourceDateEpochTestMeta - -+from test.test_py_compile import without_source_date_epoch -+from test.test_py_compile import SourceDateEpochTestMeta -+ - - class SimpleTest(abc.LoaderTests): - -@@ -363,6 +366,17 @@ class SimpleTest(abc.LoaderTests): - - - class SourceDateEpochTestMeta(SourceDateEpochTestMeta, -+ type(Source_SimpleTest)): -+ pass -+ -+ -+class SourceDateEpoch_SimpleTest(Source_SimpleTest, -+ metaclass=SourceDateEpochTestMeta, -+ source_date_epoch=True): -+ pass -+ -+ -+class SourceDateEpochTestMeta(SourceDateEpochTestMeta, - type(Source_SimpleTest)): - pass - ---- a/Lib/test/test_py_compile.py -+++ b/Lib/test/test_py_compile.py -@@ -216,5 +216,19 @@ class PyCompileTestsWithoutSourceEpoch(P - pass - - -+class PyCompileTestsWithSourceEpoch(PyCompileTestsBase, -+ unittest.TestCase, -+ metaclass=SourceDateEpochTestMeta, -+ source_date_epoch=True): -+ pass -+ -+ -+class PyCompileTestsWithoutSourceEpoch(PyCompileTestsBase, -+ unittest.TestCase, -+ metaclass=SourceDateEpochTestMeta, -+ source_date_epoch=False): -+ pass -+ -+ - if __name__ == "__main__": - unittest.main() ---- /dev/null -+++ b/Misc/NEWS.d/next/Library/2018-09-27-13-14-15.bpo-34022.E2cl0r.rst -@@ -0,0 +1,3 @@ -+The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer overrides the -+value of the *invalidation_mode* argument to :func:`py_compile.compile`, and -+determines its default value instead. diff --git a/python39.changes b/python39.changes index 0b2daea..d48fee6 100644 --- a/python39.changes +++ b/python39.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jul 16 21:45:50 UTC 2020 - Callum Farmer + +- Spec file fixes +- Re-added subprocess-raise-timeout.patch: now compatible +- Removed bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch: contained in upstream + ------------------------------------------------------------------- Wed Jul 15 09:10:42 UTC 2020 - Tomáš Chvátal diff --git a/python39.spec b/python39.spec index 393d11f..f1150da 100644 --- a/python39.spec +++ b/python39.spec @@ -1,5 +1,5 @@ # -# spec file for package python38 +# spec file for package python39 # # Copyright (c) 2020 SUSE LLC # @@ -49,7 +49,7 @@ %else %define tarversion %{version} %endif -%define python_pkg_name python38 +%define python_pkg_name python39 # Will provide the pyton3-* provides # Will do the /usr/bin/python3 and all the core links %define primary_interpreter 0 @@ -124,11 +124,10 @@ Patch07: python-3.3.0b1-localpath.patch Patch08: python-3.3.0b1-fix_date_time_compiler.patch # POSIX_FADV_WILLNEED throws EINVAL. Use a different constant in test Patch09: python-3.3.0b1-test-posix_fadvise.patch +# Raise timeout value for test_subprocess +Patch15: subprocess-raise-timeout.patch # skip some tests only for PowerPC Patch23: skip_random_failing_tests.patch -# Fix SOURCE_DATE_EPOCH problems (bpo#34022, bpo#29708) -# gh#python/cpython#10775 gh#python/cpython#10327 -Patch24: bpo34022-stop_hash-based_invalidation_w_SOURCE_DATE_EPOCH.patch Patch25: python3-imp-returntype.patch # PATCH-FIX-UPSTREAM CVE-2019-5010-null-defer-x509-cert-DOS.patch bnc#1122191 mcepl@suse.com # https://github.com/python/cpython/pull/11569 @@ -385,10 +384,10 @@ other applications. %patch07 -p1 %patch08 -p1 %patch09 -p1 +%patch15 -p1 %ifarch ppc ppc64 ppc64le %patch23 -p1 %endif -%patch24 -p1 %patch25 -p1 %patch27 -p1 %patch29 -p1 @@ -439,6 +438,7 @@ sed -e 's/-fprofile-correction//' -i Makefile.pre.in %endif %configure \ + --with-platlibdir=%{_lib} \ --docdir=%{_docdir}/python \ --enable-ipv6 \ --enable-shared \ @@ -555,7 +555,7 @@ for module in \ ensurepip html http \ importlib json logging multiprocessing pydoc_data unittest \ urllib venv wsgiref lib2to3 test turtledemo \ - xml xmlrpc + xml xmlrpc zoneinfo do rm -r %{buildroot}%{sitedir}/$module done @@ -569,7 +569,7 @@ for library in \ _statistics _struct syslog termios _testbuffer _testimportmultiple \ _testmultiphase unicodedata zlib _ctypes_test _testinternalcapi _testcapi xxlimited \ _xxtestfuzz _xxsubinterpreters _elementtree pyexpat _md5 _sha1 \ - _sha256 _sha512 _blake2 _sha3 _uuid + _sha256 _sha512 _blake2 _sha3 _uuid _zoneinfo do eval rm "%{buildroot}%{sitedir}/lib-dynload/$library.*" done @@ -632,7 +632,7 @@ ln -sf python%{python_version} %{buildroot}%{_bindir}/python3 %if !%{primary_interpreter} # base rm %{buildroot}%{_bindir}/python3 -rm %{buildroot}%{_bindir}/pydocs3 +rm %{buildroot}%{_bindir}/pydoc3 rm %{buildroot}%{_mandir}/man1/python3.1 # devel rm %{buildroot}%{_bindir}/python3-config @@ -648,7 +648,7 @@ rm %{buildroot}%{_bindir}/idle3* # delete the generic 2to3 binary if we are not primary %if !%{primary_interpreter} -rm %{buildroot}%{_bindir}2to3 +rm %{buildroot}%{_bindir}/2to3 %endif # replace duplicate .pyo/.pyc with hardlinks @@ -895,6 +895,7 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %{dynlib _xxsubinterpreters} %{dynlib _xxtestfuzz} %{dynlib zlib} +%{dynlib _zoneinfo} # hashlib fallback modules %{dynlib _blake2} %{dynlib _md5} @@ -934,13 +935,16 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %{sitedir}/wsgiref %{sitedir}/xml %{sitedir}/xmlrpc +%{sitedir}/zoneinfo %{sitedir}/__pycache__ # import-failed hooks %{sitedir}/_import_failed %{sitedir}/site-packages/zzzz-import-failed-hooks.pth # symlinks +%if %{primary_interpreter} %{_bindir}/python3 %{_bindir}/pydoc3 +%endif # executables %attr(755, root, root) %{_bindir}/pydoc%{python_version} # %attr(755, root, root) %{_bindir}/python%{python_abi} diff --git a/subprocess-raise-timeout.patch b/subprocess-raise-timeout.patch new file mode 100644 index 0000000..a0de87d --- /dev/null +++ b/subprocess-raise-timeout.patch @@ -0,0 +1,12 @@ +--- a/Lib/test/test_subprocess.py ++++ b/Lib/test/test_subprocess.py +@@ -230,7 +230,8 @@ + "time.sleep(3600)"], + # Some heavily loaded buildbots (sparc Debian 3.x) require + # this much time to start and print. +- timeout=3) ++ # OBS might require even more ++ timeout=10) + self.fail("Expected TimeoutExpired.") + self.assertEqual(c.exception.output, b'BDFL') +