Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/
Date: Tue, 02 Aug 2022 18:59:12
Message-Id: 1659466743.7aee81e746ad3da202558201ec980d06c8b51d24.mgorny@gentoo
1 commit: 7aee81e746ad3da202558201ec980d06c8b51d24
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 15:33:56 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 18:59:03 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7aee81e7
7
8 dev-lang/python: Reformat 3.11.0_beta5-r1
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-lang/python/python-3.11.0_beta5-r1.ebuild | 172 +++++++++++++-------------
13 1 file changed, 85 insertions(+), 87 deletions(-)
14
15 diff --git a/dev-lang/python/python-3.11.0_beta5-r1.ebuild b/dev-lang/python/python-3.11.0_beta5-r1.ebuild
16 index cf8d179070ca..1ff2f49f9aa4 100644
17 --- a/dev-lang/python/python-3.11.0_beta5-r1.ebuild
18 +++ b/dev-lang/python/python-3.11.0_beta5-r1.ebuild
19 @@ -4,8 +4,8 @@
20 EAPI="7"
21 WANT_LIBTOOL="none"
22
23 -inherit autotools check-reqs flag-o-matic multiprocessing pax-utils \
24 - python-utils-r1 toolchain-funcs verify-sig
25 +inherit autotools check-reqs flag-o-matic multiprocessing pax-utils
26 +inherit python-utils-r1 toolchain-funcs verify-sig
27
28 MY_PV=${PV/_beta/b}
29 MY_P="Python-${MY_PV%_p*}"
30 @@ -31,7 +31,7 @@ SLOT="${PYVER}"
31 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
32 IUSE="
33 bluetooth build +ensurepip examples gdbm hardened libedit lto
34 - +ncurses pgo +readline +sqlite +ssl test tk wininst
35 + +ncurses pgo +readline +sqlite +ssl test tk
36 "
37 RESTRICT="!test? ( test )"
38
39 @@ -113,10 +113,9 @@ src_unpack() {
40 }
41
42 src_prepare() {
43 - # Ensure that internal copies of expat, libffi and zlib are not used.
44 - rm -fr Modules/expat || die
45 - rm -fr Modules/_ctypes/libffi* || die
46 - rm -fr Modules/zlib || die
47 + # Ensure that internal copies of expat and libffi are not used.
48 + rm -r Modules/expat || die
49 + rm -r Modules/_ctypes/libffi* || die
50
51 local PATCHES=(
52 "${WORKDIR}/${PATCHSET}"
53 @@ -127,9 +126,9 @@ src_prepare() {
54 # https://bugs.gentoo.org/850151
55 sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" setup.py || die
56
57 - # force correct number of jobs
58 + # force the correct number of jobs
59 # https://bugs.gentoo.org/737660
60 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
61 + local jobs=$(makeopts_jobs)
62 sed -i -e "s:-j0:-j${jobs}:" Makefile.pre.in || die
63 sed -i -e "/self\.parallel/s:True:${jobs}:" setup.py || die
64
65 @@ -139,10 +138,11 @@ src_prepare() {
66 src_configure() {
67 local disable
68 # disable automagic bluetooth headers detection
69 - use bluetooth || export ac_cv_header_bluetooth_bluetooth_h=no
70 + if ! use bluetooth; then
71 + local -x ac_cv_header_bluetooth_bluetooth_h=no
72 + fi
73
74 append-flags -fwrapv
75 -
76 filter-flags -malign-double
77
78 # https://bugs.gentoo.org/700012
79 @@ -155,26 +155,41 @@ src_configure() {
80 tc-export CXX PKG_CONFIG
81
82 # Fix implicit declarations on cross and prefix builds. Bug #674070.
83 - use ncurses && append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
84 + if use ncurses; then
85 + append-cppflags -I"${ESYSROOT}"/usr/include/ncursesw
86 + fi
87
88 - local dbmliborder
89 + local dbmliborder=
90 if use gdbm; then
91 dbmliborder+="${dbmliborder:+:}gdbm"
92 fi
93
94 if use pgo; then
95 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
96 - export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb -u-network"
97 -
98 - # All of these seem to occasionally hang for PGO inconsistently
99 - # They'll even hang here but be fine in src_test sometimes.
100 - # bug #828535 (and related: bug #788022)
101 - PROFILE_TASK+=" -x test_socket -x test_asyncio -x test_httpservers -x test_logging -x test_multiprocessing_fork -x test_xmlrpc"
102 + local profile_task_flags=(
103 + -m test
104 + "-j$(makeopts_jobs)"
105 + --pgo-extended
106 + -x test_gdb
107 + -u-network
108 +
109 + # All of these seem to occasionally hang for PGO inconsistently
110 + # They'll even hang here but be fine in src_test sometimes.
111 + # bug #828535 (and related: bug #788022)
112 + -x test_asyncio
113 + -x test_httpservers
114 + -x test_logging
115 + -x test_multiprocessing_fork
116 + -x test_socket
117 + -x test_xmlrpc
118 + )
119
120 if has_version "app-arch/rpm" ; then
121 # Avoid sandbox failure (attempts to write to /var/lib/rpm)
122 - PROFILE_TASK+=" -x test_distutils"
123 + profile_task_flags+=(
124 + -x test_distutils
125 + )
126 fi
127 + local -x PROFILE_TASK="${profile_task_flags[*]}"
128 fi
129
130 local myeconfargs=(
131 @@ -237,19 +252,19 @@ src_configure() {
132
133 # Avoid as many dependencies as possible for the cross build.
134 cat >> Makefile <<-EOF || die
135 - MODULE_NIS_STATE=disabled
136 - MODULE__DBM_STATE=disabled
137 - MODULE__GDBM_STATE=disabled
138 - MODULE__DBM_STATE=disabled
139 - MODULE__SQLITE3_STATE=disabled
140 - MODULE__HASHLIB_STATE=disabled
141 - MODULE__SSL_STATE=disabled
142 - MODULE__CURSES_STATE=disabled
143 - MODULE__CURSES_PANEL_STATE=disabled
144 - MODULE_READLINE_STATE=disabled
145 - MODULE__TKINTER_STATE=disabled
146 - MODULE_PYEXPAT_STATE=disabled
147 - MODULE_ZLIB_STATE=disabled
148 + MODULE_NIS_STATE=disabled
149 + MODULE__DBM_STATE=disabled
150 + MODULE__GDBM_STATE=disabled
151 + MODULE__DBM_STATE=disabled
152 + MODULE__SQLITE3_STATE=disabled
153 + MODULE__HASHLIB_STATE=disabled
154 + MODULE__SSL_STATE=disabled
155 + MODULE__CURSES_STATE=disabled
156 + MODULE__CURSES_PANEL_STATE=disabled
157 + MODULE_READLINE_STATE=disabled
158 + MODULE__TKINTER_STATE=disabled
159 + MODULE_PYEXPAT_STATE=disabled
160 + MODULE_ZLIB_STATE=disabled
161 EOF
162
163 # Unfortunately, we do have to build this immediately, and
164 @@ -269,9 +284,7 @@ src_configure() {
165 fi
166
167 # force-disable modules we don't want built
168 - local disable_modules=(
169 - NIS
170 - )
171 + local disable_modules=( NIS )
172 use gdbm || disable_modules+=( _GDBM _DBM )
173 use sqlite || disable_modules+=( _SQLITE3 )
174 use ssl || disable_modules+=( _HASHLIB _SSL )
175 @@ -332,52 +345,35 @@ src_test() {
176 return
177 fi
178
179 - # Skip failing tests.
180 - local skipped_tests="gdb"
181 + # this just happens to skip test_support.test_freeze that is broken
182 + # without bundled expat
183 + # TODO: get a proper skip for it upstream
184 + local -x LOGNAME=buildbot
185 +
186 + local test_opts=(
187 + -u-network
188 + -j "$(makeopts_jobs)"
189 +
190 + # fails
191 + -x test_gdb
192 + )
193
194 if use sparc ; then
195 # bug #788022
196 - skipped_tests+=" multiprocessing_fork"
197 - skipped_tests+=" multiprocessing_forkserver"
198 + test_opts+=(
199 + -x test_multiprocessing_fork
200 + -x test_multiprocessing_forkserver
201 + )
202 fi
203
204 - for test in ${skipped_tests}; do
205 - mv "${S}"/Lib/test/test_${test}.py "${T}"
206 - done
207 -
208 - # Expects to find skipped tests and fails
209 - mv "${S}"/Lib/test/test_tools/test_freeze.py "${T}" || die
210 -
211 # bug 660358
212 local -x COLUMNS=80
213 local -x PYTHONDONTWRITEBYTECODE=
214 # workaround https://bugs.gentoo.org/775416
215 addwrite /usr/lib/python3.11/site-packages
216
217 - local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")
218 -
219 - emake test EXTRATESTOPTS="-u-network -j${jobs}" \
220 - CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty
221 - local result=$?
222 -
223 - for test in ${skipped_tests}; do
224 - mv "${T}/test_${test}.py" "${S}"/Lib/test
225 - done
226 -
227 - mv "${T}"/test_freeze.py "${S}"/Lib/test/test_tools/test_freeze.py || die
228 -
229 - elog "The following tests have been skipped:"
230 - for test in ${skipped_tests}; do
231 - elog "test_${test}.py"
232 - done
233 -
234 - elog "If you would like to run them, you may:"
235 - elog "cd '${EPREFIX}/usr/lib/python${PYVER}/test'"
236 - elog "and run the tests separately."
237 -
238 - if [[ ${result} -ne 0 ]]; then
239 - die "emake test failed"
240 - fi
241 + emake test EXTRATESTOPTS="${test_opts[*]}" \
242 + CPPFLAGS= CFLAGS= LDFLAGS= < /dev/tty || die "emake test failed"
243 }
244
245 src_install() {
246 @@ -413,8 +409,13 @@ src_install() {
247 if ! use ensurepip; then
248 rm -r "${libdir}"/ensurepip || die
249 fi
250 - use sqlite || rm -r "${libdir}/"sqlite3 || die
251 - use tk || rm -r "${ED}/usr/bin/idle${PYVER}" "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
252 + if ! use sqlite; then
253 + rm -r "${libdir}/"sqlite3 || die
254 + fi
255 + if ! use tk; then
256 + rm -r "${ED}/usr/bin/idle${PYVER}" || die
257 + rm -r "${libdir}/"{idlelib,tkinter,test/test_tk*} || die
258 + fi
259
260 dodoc Misc/{ACKS,HISTORY,NEWS}
261
262 @@ -424,9 +425,11 @@ src_install() {
263 dodoc -r Tools
264 fi
265 insinto /usr/share/gdb/auto-load/usr/$(get_libdir) #443510
266 - local libname=$(printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' | \
267 - emake --no-print-directory -s -f - 2>/dev/null)
268 - newins "${S}"/Tools/gdb/libpython.py "${libname}"-gdb.py
269 + local libname=$(
270 + printf 'e:\n\t@echo $(INSTSONAME)\ninclude Makefile\n' |
271 + emake --no-print-directory -s -f - 2>/dev/null
272 + )
273 + newins Tools/gdb/libpython.py "${libname}"-gdb.py
274
275 newconfd "${FILESDIR}/pydoc.conf" pydoc-${PYVER}
276 newinitd "${FILESDIR}/pydoc.init" pydoc-${PYVER}
277 @@ -442,8 +445,7 @@ src_install() {
278 local scriptdir=${D}$(python_get_scriptdir)
279 mkdir -p "${scriptdir}" || die
280 # python and pythonX
281 - ln -s "../../../bin/${abiver}" \
282 - "${scriptdir}/python${pymajor}" || die
283 + ln -s "../../../bin/${abiver}" "${scriptdir}/python${pymajor}" || die
284 ln -s "python${pymajor}" "${scriptdir}/python" || die
285 # python-config and pythonX-config
286 # note: we need to create a wrapper rather than symlinking it due
287 @@ -453,17 +455,13 @@ src_install() {
288 exec "${abiver}-config" "\${@}"
289 EOF
290 chmod +x "${scriptdir}/python${pymajor}-config" || die
291 - ln -s "python${pymajor}-config" \
292 - "${scriptdir}/python-config" || die
293 + ln -s "python${pymajor}-config" "${scriptdir}/python-config" || die
294 # 2to3, pydoc
295 - ln -s "../../../bin/2to3-${PYVER}" \
296 - "${scriptdir}/2to3" || die
297 - ln -s "../../../bin/pydoc${PYVER}" \
298 - "${scriptdir}/pydoc" || die
299 + ln -s "../../../bin/2to3-${PYVER}" "${scriptdir}/2to3" || die
300 + ln -s "../../../bin/pydoc${PYVER}" "${scriptdir}/pydoc" || die
301 # idle
302 if use tk; then
303 - ln -s "../../../bin/idle${PYVER}" \
304 - "${scriptdir}/idle" || die
305 + ln -s "../../../bin/idle${PYVER}" "${scriptdir}/idle" || die
306 fi
307 }