Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] build-style/python3-pep517: use a generic glob for wheels
@ 2023-05-24 23:04 tornaria
  2023-05-25 14:06 ` [PR PATCH] [Updated] " ahesford
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: tornaria @ 2023-05-24 23:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2377 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages pep517
https://github.com/void-linux/void-packages/pull/44071

build-style/python3-pep517: use a generic glob for wheels
We replace the current glob of `"dist/${wheelbase//-/_}-${version}-*-*-*.whl"` for a much simpler `dist/*.whl`. The former is inconvenient since `wheelbase="${pkgname#python3-}"` is most of the time correct but often not, and fixing that in a different way seems more complicated than this solution.

Since we only run `python -m build` once, we should have only one wheel, so trying to be more specific doesn't seem useful. Nevertheless, this can still be overriden via `make_install_target` as before but hopefully it won't ever be necessary.

Note that several packages that currently need to set `make_install_target` for this purposes will now work out of the box.

If this is accepted I can have a look at those pkgs and clean up the override once it's no longer necessary.

#### Testing the changes
- I tested the changes in this PR: **YES**

I built all 150 packages that use pep517 as obtained by:
```
$ git grep -l style=.*pep517 srcpkgs/ | cut -d/ -f2 | wc -l
150
```
All of them succeed except for two that fail for unrelated reasons (`python3-xcffib` and `synapse`).


I also included a minor unrelated change: do not compile bytecode in `do_install()` since it will be removed in `post_install()`.


CC: @ahesford @icp1994 

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/44071.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pep517-44071.patch --]
[-- Type: text/x-diff, Size: 1690 bytes --]

From 23fe477915856a0459b556e69b200100909d70b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 24 May 2023 19:51:18 -0300
Subject: [PATCH] build-style/python3-pep517: use a generic glob for wheels

Also: do not compile bytecode in `do_install()` since
it will be removed in `post_install()`.
---
 common/build-style/python3-pep517.sh | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index f13046ea1968..c09b3df4ebc4 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -9,17 +9,14 @@ do_build() {
 }
 
 do_check() {
+	: ${make_install_target:="dist/*.whl"}
+
 	local testjobs
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
 		if python3 -c 'import xdist' >/dev/null 2>&1; then
 			testjobs="-n $XBPS_MAKEJOBS"
 		fi
 
-		if [ -z "${make_install_target}" ]; then
-			local wheelbase="${pkgname#python3-}"
-			make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
-		fi
-
 		local testdir="${wrksrc}/tmp/$(date +%s)"
 		python3 -m installer --destdir "${testdir}" \
 			${make_install_args} ${make_install_target}
@@ -33,11 +30,8 @@ do_check() {
 }
 
 do_install() {
-	if [ -z "${make_install_target}" ]; then
-		# Default wheel name normalizes hyphens to underscores
-		local wheelbase="${pkgname#python3-}"
-		make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
-	fi
+	: ${make_install_args:=--no-compile-bytecode}
+	: ${make_install_target:="dist/*.whl"}
 
 	python3 -m installer --destdir ${DESTDIR} \
 		${make_install_args} ${make_install_target}

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-05-25 17:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
2023-05-25 14:06 ` [PR PATCH] [Updated] " ahesford
2023-05-25 14:11 ` ahesford
2023-05-25 14:13 ` icp1994
2023-05-25 14:15 ` [PR PATCH] [Updated] " ahesford
2023-05-25 14:16 ` ahesford
2023-05-25 14:51 ` [PR REVIEW] " tornaria
2023-05-25 14:56 ` tornaria
2023-05-25 15:25 ` [PR REVIEW] " ahesford
2023-05-25 17:43 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).