#11 Sync with the python3 package
Merged 5 years ago by churchyard. Opened 5 years ago by churchyard.
rpms/ churchyard/python38 python3_sync  into  master

@@ -1,48 +0,0 @@ 

- diff --git a/Lib/unittest/__init__.py b/Lib/unittest/__init__.py

- index 5ff1bf3..4d63954 100644

- --- a/Lib/unittest/__init__.py

- +++ b/Lib/unittest/__init__.py

- @@ -58,7 +58,7 @@ __unittest = True

-  

-  from .result import TestResult

-  from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip,

- -                   skipIf, skipUnless, expectedFailure)

- +                   skipIf, skipUnless, expectedFailure, _skipInRpmBuild)

-  from .suite import BaseTestSuite, TestSuite

-  from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,

-                       findTestCases)

- diff --git a/Lib/unittest/case.py b/Lib/unittest/case.py

- index a157ae8..64f912c 100644

- --- a/Lib/unittest/case.py

- +++ b/Lib/unittest/case.py

- @@ -3,6 +3,7 @@

-  import sys

-  import functools

-  import difflib

- +import os

-  import logging

-  import pprint

-  import re

- @@ -158,6 +159,22 @@ class _BaseTestCaseContext:

-          msg = self.test_case._formatMessage(self.msg, standardMsg)

-          raise self.test_case.failureException(msg)

-  

- +# Non-standard/downstream-only hooks for handling issues with specific test

- +# cases:

- +

- +def _skipInRpmBuild(reason):

- +    """

- +    Non-standard/downstream-only decorator for marking a specific unit test

- +    to be skipped when run within the %check of an rpmbuild.

- +

- +    Specifically, this takes effect when WITHIN_PYTHON_RPM_BUILD is set within

- +    the environment, and has no effect otherwise.

- +    """

- +    if 'WITHIN_PYTHON_RPM_BUILD' in os.environ:

- +        return skip(reason)

- +    else:

- +        return _id

- +

-  class _AssertRaisesBaseContext(_BaseTestCaseContext):

-  

-      def __init__(self, expected, test_case, expected_regex=None):

@@ -1,11 +0,0 @@ 

- diff -up cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build cpython-59223da36dec/Lib/test/test_posix.py

- --- cpython-59223da36dec/Lib/test/test_posix.py.disable-test_fs_holes-in-rpm-build	2012-08-07 17:15:59.000000000 -0400

- +++ cpython-59223da36dec/Lib/test/test_posix.py	2012-08-07 17:16:53.528330330 -0400

- @@ -973,6 +973,7 @@ class PosixTester(unittest.TestCase):

-          posix.RTLD_GLOBAL

-          posix.RTLD_LOCAL

-  

- +    @unittest._skipInRpmBuild('running kernel may not match kernel in chroot')

-      @unittest.skipUnless(hasattr(os, 'SEEK_HOLE'),

-                           "test needs an OS that reports file holes")

-      def test_fs_holes(self):

@@ -1,11 +0,0 @@ 

- diff -up Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds Python-3.3.0b1/Lib/test/test_socket.py

- --- Python-3.3.0b1/Lib/test/test_socket.py.disable-test_socket-in-rpm-builds	2012-07-24 15:02:30.823355067 -0400

- +++ Python-3.3.0b1/Lib/test/test_socket.py	2012-07-24 15:08:13.021354999 -0400

- @@ -2188,6 +2188,7 @@ class RecvmsgGenericStreamTests(RecvmsgG

-      # Tests which require a stream socket and can use either recvmsg()

-      # or recvmsg_into().

-  

- +    @unittest._skipInRpmBuild('fails intermittently when run within Koji')

-      def testRecvmsgEOF(self):

-          # Receive end-of-stream indicator (b"", peer socket closed).

-          msg, ancdata, flags, addr = self.doRecvmsg(self.serv_sock, 1024)

file modified
+30 -9
@@ -1,8 +1,19 @@ 

+ From 3b0d3a25576e74c2ac1eb25136ae811bdbdd7c6c Mon Sep 17 00:00:00 2001

+ From: Tomas Orsava <torsava@redhat.com>

+ Date: Thu, 14 Feb 2019 16:08:57 +0100

+ Subject: [PATCH] Upstream uses Debian-style architecture naming. Change to

+  match Fedora / RHEL

+ 

+ ---

+  config.sub   |  2 +-

+  configure.ac | 16 ++++++++--------

+  2 files changed, 9 insertions(+), 9 deletions(-)

+ 

  diff --git a/config.sub b/config.sub

- index ba37cf9..52a9ec6 100755

+ index 40ea5df..932128b 100755

  --- a/config.sub

  +++ b/config.sub

- @@ -1042,7 +1042,7 @@ case $basic_machine in

+ @@ -1045,7 +1045,7 @@ case $basic_machine in

   		;;

   	ppc64)	basic_machine=powerpc64-unknown

   		;;
@@ -12,10 +23,10 @@ 

   	ppc64le | powerpc64little)

   		basic_machine=powerpc64le-unknown

  diff --git a/configure.ac b/configure.ac

- index 2535969..9fb3193 100644

+ index a075ce3..b7f2ee3 100644

  --- a/configure.ac

  +++ b/configure.ac

- @@ -765,9 +765,9 @@ cat >> conftest.c <<EOF

+ @@ -788,9 +788,9 @@ cat >> conftest.c <<EOF

           alpha-linux-gnu

   # elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)

   #  if defined(__ARMEL__)
@@ -27,7 +38,7 @@ 

   #  endif

   # elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)

   #  if defined(__ARMEL__)

- @@ -807,7 +807,7 @@ cat >> conftest.c <<EOF

+ @@ -810,7 +810,7 @@ cat >> conftest.c <<EOF

   #  elif _MIPS_SIM == _ABIN32

           mips64el-linux-gnuabin32

   #  elif _MIPS_SIM == _ABI64
@@ -36,7 +47,7 @@ 

   #  else

   #   error unknown platform triplet

   #  endif

- @@ -817,7 +817,7 @@ cat >> conftest.c <<EOF

+ @@ -820,22 +820,22 @@ cat >> conftest.c <<EOF

   #  elif _MIPS_SIM == _ABIN32

           mips64-linux-gnuabin32

   #  elif _MIPS_SIM == _ABI64
@@ -45,8 +56,11 @@ 

   #  else

   #   error unknown platform triplet

   #  endif

- @@ -827,9 +827,9 @@ cat >> conftest.c <<EOF

-          powerpc-linux-gnuspe

+  # elif defined(__or1k__)

+          or1k-linux-gnu

+  # elif defined(__powerpc__) && defined(__SPE__)

+ -        powerpc-linux-gnuspe

+ +        ppc-linux-gnuspe

   # elif defined(__powerpc64__)

   #  if defined(__LITTLE_ENDIAN__)

  -        powerpc64le-linux-gnu
@@ -56,4 +70,11 @@ 

  +        ppc64-linux-gnu

   #  endif

   # elif defined(__powerpc__)

-          powerpc-linux-gnu

+ -        powerpc-linux-gnu

+ +        ppc-linux-gnu

+  # elif defined(__s390x__)

+          s390x-linux-gnu

+  # elif defined(__s390__)

+ -- 

+ 2.20.1

+ 

file modified
+7 -39
@@ -239,34 +239,6 @@ 

  # Downstream only: not appropriate for upstream

  Patch111: 00111-no-static-lib.patch

  

- # 00132 #

- # Add non-standard hooks to unittest for use in the "check" phase below, when

- # running selftests within the build:

- #   @unittest._skipInRpmBuild(reason)

- # for tests that hang or fail intermittently within the build environment, and:

- #   @unittest._expectedFailureInRpmBuild

- # for tests that always fail within the build environment

- #

- # The hooks only take effect if WITHIN_PYTHON_RPM_BUILD is set in the

- # environment, which we set manually in the appropriate portion of the "check"

- # phase below (and which potentially other python-* rpms could set, to reuse

- # these unittest hooks in their own "check" phases)

- Patch132: 00132-add-rpmbuild-hooks-to-unittest.patch

- 

- # 00160 #

- # Python 3.3 added os.SEEK_DATA and os.SEEK_HOLE, which may be present in the

- # header files in the build chroot, but may not be supported in the running

- # kernel, hence we disable this test in an rpm build.

- # Adding these was upstream issue http://bugs.python.org/issue10142

- # Not yet sent upstream

- Patch160: 00160-disable-test_fs_holes-in-rpm-build.patch

- 

- # 00163 #

- # Some tests within test_socket fail intermittently when run inside Koji;

- # disable them using unittest._skipInRpmBuild

- # Not yet sent upstream

- Patch163: 00163-disable-parts-of-test_socket-in-rpm-build.patch

- 

  # 00178 #

  # Don't duplicate various FLAGS in sysconfig values

  # http://bugs.python.org/issue17679
@@ -559,9 +531,6 @@ 

  %patch102 -p1

  %endif

  %patch111 -p1

- %patch132 -p1

- %patch160 -p1

- %patch163 -p1

  %patch178 -p1

  

  %if %{with rpmwheels}
@@ -974,24 +943,23 @@ 

    # Show some info, helpful for debugging test failures

    LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.pythoninfo

  

-   # Run the upstream test suite, setting "WITHIN_PYTHON_RPM_BUILD" so that the

-   # our non-standard decorators take effect on the relevant tests:

-   #   @unittest._skipInRpmBuild(reason)

-   #   @unittest._expectedFailureInRpmBuild

+   # Run the upstream test suite

+   # test_gdb skipped on armv7hl:

+   #   https://bugzilla.redhat.com/show_bug.cgi?id=1196181

+   # test_gdb skipped on s390x:

+   #   https://bugzilla.redhat.com/show_bug.cgi?id=1678277

    # test_asyncio skipped:

    #   https://bugs.python.org/issue35998

-   WITHIN_PYTHON_RPM_BUILD= \

    LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \

      -wW --slowest -j0 \

      -x test_distutils \

      -x test_bdist_rpm \

+     %ifarch %{arm} s390x

      -x test_gdb \

+     %endif

      %ifarch %{mips64}

      -x test_ctypes \

      %endif

-     %ifarch ppc64le

-     -x test_buffer \

-     %endif

      -x test_asyncio \

  

    echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName

file modified
+1
@@ -16,6 +16,7 @@ 

          run: VERSION=3.8 X="-x test_socket -x test_asyncgen -x test_asyncio -x test_compile -x test_concurrent_futures -x test_itertools -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_shutil -x test_time -x test_multiprocessing_spawn -x test_threading -x test_wsgiref" ./parallel.sh

      required_packages:

      - gcc  # for extension building in venv and selftest

+     - gdb  # for test_gdb

      - python38  # the test subject

      - python3-tox  # for venv tests

      - glibc-all-langpacks # for locale tests

no initial comment

5 new commits added

  • Reenable test_posix.test_fs_holes()
  • Reenable RecvmsgGenericStreamTests.testRecvmsgEOF()
  • Reenable test_gdb on most archs except arm and s390x
  • Reenable test_buffer on ppc64le
  • Fix arch names for the ppc architecture
5 years ago

The changes look good. But I'm a bit confused why there's no release bump or changelog entry.

Those don't really change anything for the user. We'll ship it with next bump.

Pull-Request has been merged by churchyard

5 years ago

Even if it's already merged: LGTM :-)