From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1424621-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 38382158003
	for <garchives@archives.gentoo.org>; Tue,  2 Aug 2022 18:59:12 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1D477E1074;
	Tue,  2 Aug 2022 18:59:11 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id CAF8AE1072
	for <gentoo-commits@lists.gentoo.org>; Tue,  2 Aug 2022 18:59:10 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E208F340AB2
	for <gentoo-commits@lists.gentoo.org>; Tue,  2 Aug 2022 18:59:09 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 74C7B1E
	for <gentoo-commits@lists.gentoo.org>; Tue,  2 Aug 2022 18:59:08 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1659466743.7aee81e746ad3da202558201ec980d06c8b51d24.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lang/python/python-3.11.0_beta5-r1.ebuild
X-VCS-Directories: dev-lang/python/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: 7aee81e746ad3da202558201ec980d06c8b51d24
X-VCS-Branch: master
Date: Tue,  2 Aug 2022 18:59:08 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 10c6e263-bb6e-465e-b1a3-66e21cae085d
X-Archives-Hash: f2df5fb6ecdeaf2c4d8ba5b146ce5112

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
 }