commit:     7aee81e746ad3da202558201ec980d06c8b51d24
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Aug  2 15:33:56 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Aug  2 18:59:03 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7aee81e7

dev-lang/python: Reformat 3.11.0_beta5-r1

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/python/python-3.11.0_beta5-r1.ebuild | 172 +++++++++++++-------------
 1 file changed, 85 insertions(+), 87 deletions(-)

diff --git a/dev-lang/python/python-3.11.0_beta5-r1.ebuild 
b/dev-lang/python/python-3.11.0_beta5-r1.ebuild
index cf8d179070ca..1ff2f49f9aa4 100644
--- a/dev-lang/python/python-3.11.0_beta5-r1.ebuild
+++ b/dev-lang/python/python-3.11.0_beta5-r1.ebuild
@@ -4,8 +4,8 @@
 EAPI="7"
 WANT_LIBTOOL="none"
 
-inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
-       python-utils-r1 toolchain-funcs verify-sig
+inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
+inherit python-utils-r1 toolchain-funcs verify-sig
 
 MY_PV=${PV/_beta/b}
 MY_P="Python-${MY_PV%_p*}"
@@ -31,7 +31,7 @@ SLOT="${PYVER}"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
 IUSE="
        bluetooth build +ensurepip examples gdbm hardened libedit lto
-       +ncurses pgo +readline +sqlite +ssl test tk wininst
+       +ncurses pgo +readline +sqlite +ssl test tk
 "
 RESTRICT="!test? ( test )"
 
@@ -113,10 +113,9 @@ src_unpack() {
 }
 
 src_prepare() {
-       # Ensure that internal copies of expat, libffi and zlib are not used.
-       rm -fr Modules/expat || die
-       rm -fr Modules/_ctypes/libffi* || die
-       rm -fr Modules/zlib || die
+       # Ensure that internal copies of expat and libffi are not used.
+       rm -r Modules/expat || die
+       rm -r Modules/_ctypes/libffi* || die
 
        local PATCHES=(
                "${WORKDIR}/${PATCHSET}"
@@ -127,9 +126,9 @@ src_prepare() {
        # https://bugs.gentoo.org/850151
        sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
 
-       # force correct number of jobs
+       # force the correct number of jobs
        # https://bugs.gentoo.org/737660
-       local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
+       local jobs=$(makeopts_jobs)
        sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
        sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
 
@@ -139,10 +138,11 @@ src_prepare() {
 src_configure() {
        local disable
        # disable automagic bluetooth headers detection
-       use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
+       if ! use bluetooth; then
+               local -x ac_cv_header_bluetooth_bluetooth_h=no
+       fi
 
        append-flags -fwrapv
-
        filter-flags -malign-double
 
        # https://bugs.gentoo.org/700012
@@ -155,26 +155,41 @@ src_configure() {
        tc-export CXX PKG_CONFIG
 
        # Fix implicit declarations on cross and prefix builds. Bug #674070.
-       use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+       if use ncurses; then
+               append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
+       fi
 
-       local dbmliborder
+       local dbmliborder=
        if use gdbm; then
                dbmliborder+="${dbmliborder:+:}gdbm"
        fi
 
        if use pgo; then
-               local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
-               export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x 
test_gdb -u-network"
-
-               # All of these seem to occasionally hang for PGO inconsistently
-               # They'll even hang here but be fine in src_test sometimes.
-               # bug #828535 (and related: bug #788022)
-               PROFILE_TASK+=" -x test_socket -x test_asyncio -x 
test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
+               local profile_task_flags=(
+                       -m test
+                       "-j$(makeopts_jobs)"
+                       --pgo-extended
+                       -x test_gdb
+                       -u-network
+
+                       # All of these seem to occasionally hang for PGO 
inconsistently
+                       # They'll even hang here but be fine in src_test 
sometimes.
+                       # bug #828535 (and related: bug #788022)
+                       -x test_asyncio
+                       -x test_httpservers
+                       -x test_logging
+                       -x test_multiprocessing_fork
+                       -x test_socket
+                       -x test_xmlrpc
+               )
 
                if has_version "app-arch/rpm" ; then
                        # Avoid sandbox failure (attempts to write to 
/var/lib/rpm)
-                       PROFILE_TASK+=" -x test_distutils"
+                       profile_task_flags+=(
+                               -x test_distutils
+                       )
                fi
+               local -x PROFILE_TASK="${profile_task_flags[*]}"
        fi
 
        local myeconfargs=(
@@ -237,19 +252,19 @@ src_configure() {
 
                # Avoid as many dependencies as possible for the cross build.
                cat >> Makefile <<-EOF || die
-               MODULE_NIS_STATE=disabled
-               MODULE__DBM_STATE=disabled
-               MODULE__GDBM_STATE=disabled
-               MODULE__DBM_STATE=disabled
-               MODULE__SQLITE3_STATE=disabled
-               MODULE__HASHLIB_STATE=disabled
-               MODULE__SSL_STATE=disabled
-               MODULE__CURSES_STATE=disabled
-               MODULE__CURSES_PANEL_STATE=disabled
-               MODULE_READLINE_STATE=disabled
-               MODULE__TKINTER_STATE=disabled
-               MODULE_PYEXPAT_STATE=disabled
-               MODULE_ZLIB_STATE=disabled
+                       MODULE_NIS_STATE=disabled
+                       MODULE__DBM_STATE=disabled
+                       MODULE__GDBM_STATE=disabled
+                       MODULE__DBM_STATE=disabled
+                       MODULE__SQLITE3_STATE=disabled
+                       MODULE__HASHLIB_STATE=disabled
+                       MODULE__SSL_STATE=disabled
+                       MODULE__CURSES_STATE=disabled
+                       MODULE__CURSES_PANEL_STATE=disabled
+                       MODULE_READLINE_STATE=disabled
+                       MODULE__TKINTER_STATE=disabled
+                       MODULE_PYEXPAT_STATE=disabled
+                       MODULE_ZLIB_STATE=disabled
                EOF
 
                # Unfortunately, we do have to build this immediately, and
@@ -269,9 +284,7 @@ src_configure() {
        fi
 
        # force-disable modules we don't want built
-       local disable_modules=(
-               NIS
-       )
+       local disable_modules=( NIS )
        use gdbm || disable_modules+=( _GDBM _DBM )
        use sqlite || disable_modules+=( _SQLITE3 )
        use ssl || disable_modules+=( _HASHLIB _SSL )
@@ -332,52 +345,35 @@ src_test() {
                return
        fi
 
-       # Skip failing tests.
-       local skipped_tests="gdb"
+       # this just happens to skip test_support.test_freeze that is broken
+       # without bundled expat
+       # TODO: get a proper skip for it upstream
+       local -x LOGNAME=buildbot
+
+       local test_opts=(
+               -u-network
+               -j "$(makeopts_jobs)"
+
+               # fails
+               -x test_gdb
+       )
 
        if use sparc ; then
                # bug #788022
-               skipped_tests+=" multiprocessing_fork"
-               skipped_tests+=" multiprocessing_forkserver"
+               test_opts+=(
+                       -x test_multiprocessing_fork
+                       -x test_multiprocessing_forkserver
+               )
        fi
 
-       for test in ${skipped_tests}; do
-               mv "${S}"/Lib/test/test_${test}.py "${T}"
-       done
-
-       # Expects to find skipped tests and fails
-       mv "${S}"/Lib/test/test_tools/test_freeze.py "${T}" || die
-
        # bug 660358
        local -x COLUMNS=80
        local -x PYTHONDONTWRITEBYTECODE=
        # workaround https://bugs.gentoo.org/775416
        addwrite /usr/lib/python3.11/site-packages
 
-       local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
-
-       emake test EXTRATESTOPTS="-u-network -j${jobs}" \
-               CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
-       local result=$?
-
-       for test in ${skipped_tests}; do
-               mv "${T}/test_${test}.py" "${S}"/Lib/test
-       done
-
-       mv "${T}"/test_freeze.py "${S}"/Lib/test/test_tools/test_freeze.py || 
die
-
-       elog "The following tests have been skipped:"
-       for test in ${skipped_tests}; do
-               elog "test_${test}.py"
-       done
-
-       elog "If you would like to run them, you may:"
-       elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
-       elog "and run the tests separately."
-
-       if [[ ${result} -ne 0 ]]; then
-               die "emake test failed"
-       fi
+       emake test EXTRATESTOPTS="${test_opts[*]}" \
+               CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty || die "emake test failed"
 }
 
 src_install() {
@@ -413,8 +409,13 @@ src_install() {
        if ! use ensurepip; then
                rm -r "${libdir}"/ensurepip || die
        fi
-       use sqlite || rm -r "${libdir}/"sqlite3 || die
-       use tk || rm -r "${ED}/usr/bin/idle${PYVER}" 
"${libdir}/"{idlelib,tkinter,test/test_tk*} || die
+       if ! use sqlite; then
+               rm -r "${libdir}/"sqlite3 || die
+       fi
+       if ! use tk; then
+               rm -r "${ED}/usr/bin/idle${PYVER}" || die
+               rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
+       fi
 
        dodoc Misc/{ACKS,HISTORY,NEWS}
 
@@ -424,9 +425,11 @@ src_install() {
                dodoc -r Tools
        fi
        insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
-       local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' 
| \
-               emake --no-print-directory -s -f - 2>/dev/null)
-       newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
+       local libname=$(
+               printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' |
+               emake --no-print-directory -s -f - 2>/dev/null
+       )
+       newins Tools/gdb/libpython.py "${libname}"-gdb.py
 
        newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
        newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
@@ -442,8 +445,7 @@ src_install() {
        local scriptdir=${D}$(python_get_scriptdir)
        mkdir -p "${scriptdir}" || die
        # python and pythonX
-       ln -s "../../../bin/${abiver}" \
-               "${scriptdir}/python${pymajor}" || die
+       ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die
        ln -s "python${pymajor}" "${scriptdir}/python" || die
        # python-config and pythonX-config
        # note: we need to create a wrapper rather than symlinking it due
@@ -453,17 +455,13 @@ src_install() {
                exec "${abiver}-config" "\${@}"
        EOF
        chmod +x "${scriptdir}/python${pymajor}-config" || die
-       ln -s "python${pymajor}-config" \
-               "${scriptdir}/python-config" || die
+       ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
        # 2to3, pydoc
-       ln -s "../../../bin/2to3-${PYVER}" \
-               "${scriptdir}/2to3" || die
-       ln -s "../../../bin/pydoc${PYVER}" \
-               "${scriptdir}/pydoc" || die
+       ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die
+       ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
        # idle
        if use tk; then
-               ln -s "../../../bin/idle${PYVER}" \
-                       "${scriptdir}/idle" || die
+               ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
        fi
 }
 

Reply via email to