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

* Re: [PR PATCH] [Updated] build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
@ 2023-05-25 14:06 ` ahesford
  2023-05-25 14:11 ` ahesford
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 14:06 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by ahesford 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: 15661 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 1/5] 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}

From 0fba85289e88c1723d7cd237520539c3a153039a Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 10:04:28 -0400
Subject: [PATCH 2/5] squash! build-style/python3-pep517: use a generic glob
 for wheels
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

build-style/python3-pep517: use a generic glob for wheels, refactor

Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
---
 common/build-style/python3-pep517.sh | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index c09b3df4ebc4..ffe52fccf3db 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -9,24 +9,22 @@ do_build() {
 }
 
 do_check() {
-	: ${make_install_target:="dist/*.whl"}
+	if ! python3 -c 'import pytest' >/dev/null 2>&1; then
+		msg_warn "Testing of python3-pep517 templates requires pytest\n"
+		return 0
+	fi
 
 	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 python3 -c 'import xdist' >/dev/null 2>&1; then
+		testjobs="-n $XBPS_MAKEJOBS"
+	fi
 
-		local testdir="${wrksrc}/tmp/$(date +%s)"
-		python3 -m installer --destdir "${testdir}" \
-			${make_install_args} ${make_install_target}
+	local testdir="${wrksrc}/tmp/$(date +%s)"
+	python3 -m installer --destdir "${testdir}" \
+		${make_install_args} ${make_install_target:-dist/*.whl}
 
-		PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
-			${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
-	else
-		msg_warn "Unable to determine tests for PEP517 Python templates\n"
-		return 0
-	fi
+	PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
+		${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
 }
 
 do_install() {

From a881d6b36c83ed9f694ba54f2f9c73690a383b6f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 09:27:35 -0400
Subject: [PATCH 3/5] python3-*: remove unnecessary make_install_target for
 pep517

Now that the wheel glob in do_check and do_install is more generic,
there is no longer a need to override the default behavior.
---
 srcpkgs/python3-PyHamcrest/template        | 1 -
 srcpkgs/python3-Pyphen/template            | 1 -
 srcpkgs/python3-Sphinx/template            | 1 -
 srcpkgs/python3-WeasyPrint/template        | 1 -
 srcpkgs/python3-ansible-lint/template      | 1 -
 srcpkgs/python3-b2sdk/template             | 1 -
 srcpkgs/python3-gnupg/template             | 1 -
 srcpkgs/python3-ipython_ipykernel/template | 1 -
 srcpkgs/python3-logbook/template           | 1 -
 srcpkgs/python3-markdown-it/template       | 1 -
 srcpkgs/python3-mistune2/template          | 1 -
 srcpkgs/python3-quart/template             | 1 -
 srcpkgs/python3-saml2/template             | 1 -
 srcpkgs/python3-ytmusicapi/template        | 1 -
 srcpkgs/rofi-rbw/template                  | 1 -
 srcpkgs/synapse/template                   | 1 -
 16 files changed, 16 deletions(-)

diff --git a/srcpkgs/python3-PyHamcrest/template b/srcpkgs/python3-PyHamcrest/template
index cbba236bc53b..d6b17d61463f 100644
--- a/srcpkgs/python3-PyHamcrest/template
+++ b/srcpkgs/python3-PyHamcrest/template
@@ -3,7 +3,6 @@ pkgname=python3-PyHamcrest
 version=2.0.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/pyhamcrest-${version}-*-*-*.whl"
 hostmakedepends="hatch-vcs"
 depends="python3"
 checkdepends="python3-pytest python3-numpy"
diff --git a/srcpkgs/python3-Pyphen/template b/srcpkgs/python3-Pyphen/template
index a0f9db3ea933..a8d34fb01d9d 100644
--- a/srcpkgs/python3-Pyphen/template
+++ b/srcpkgs/python3-Pyphen/template
@@ -3,7 +3,6 @@ pkgname=python3-Pyphen
 version=0.14.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/pyphen-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core python3-flit_core"
 checkdepends="python3-pytest-isort python3-pytest-cov python3-pytest-flake8
  python3-pytest-xdist"
diff --git a/srcpkgs/python3-Sphinx/template b/srcpkgs/python3-Sphinx/template
index 26b161172705..c49bb438a78b 100644
--- a/srcpkgs/python3-Sphinx/template
+++ b/srcpkgs/python3-Sphinx/template
@@ -3,7 +3,6 @@ pkgname=python3-Sphinx
 version=7.0.1
 revision=1
 build_style=python3-pep517
-make_install_target="dist/sphinx-$version-py3-none-any.whl"
 hostmakedepends="python3-flit_core python3-pyproject-hooks"
 depends="python3-Jinja2 python3-docutils python3-Pygments
  python3-snowballstemmer python3-Babel python3-alabaster python3-imagesize
diff --git a/srcpkgs/python3-WeasyPrint/template b/srcpkgs/python3-WeasyPrint/template
index 8c87d92cbea5..0b0a2040b6c1 100644
--- a/srcpkgs/python3-WeasyPrint/template
+++ b/srcpkgs/python3-WeasyPrint/template
@@ -3,7 +3,6 @@ pkgname=python3-WeasyPrint
 version=59.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/weasyprint-${version}-py3-none-any.whl"
 _runtime_deps="fonttools python3-Pillow python3-cssselect2 python3-html5lib python3-cffi
  python3-Pyphen python3-pydyf glib pango"
 hostmakedepends="python3-poetry-core python3-flit_core ${_runtime_deps}"
diff --git a/srcpkgs/python3-ansible-lint/template b/srcpkgs/python3-ansible-lint/template
index ad75a253c592..f99a3c167dd6 100644
--- a/srcpkgs/python3-ansible-lint/template
+++ b/srcpkgs/python3-ansible-lint/template
@@ -3,7 +3,6 @@ pkgname=python3-ansible-lint
 version=6.14.3
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ansible_lint-*-*-*-*.whl"
 hostmakedepends="python3-wheel python3-setuptools_scm"
 depends="python3-ansible-compat ansible-core black python3-filelock
  python3-jsonschema python3-packaging python3-yaml python3-rich
diff --git a/srcpkgs/python3-b2sdk/template b/srcpkgs/python3-b2sdk/template
index 720dab64afc0..b2db87588bf8 100644
--- a/srcpkgs/python3-b2sdk/template
+++ b/srcpkgs/python3-b2sdk/template
@@ -3,7 +3,6 @@ pkgname=python3-b2sdk
 version=1.20.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/b2sdk-${version}-*-*-*.whl"
 hostmakedepends="python3-setuptools_scm python3-wheel"
 depends="python3-logfury python3-Arrow python3-requests python3-tqdm"
 checkdepends="python3-pytest-lazy-fixture $depends python3-dateutil
diff --git a/srcpkgs/python3-gnupg/template b/srcpkgs/python3-gnupg/template
index 597b6888818b..4b2c42dc299f 100644
--- a/srcpkgs/python3-gnupg/template
+++ b/srcpkgs/python3-gnupg/template
@@ -3,7 +3,6 @@ pkgname=python3-gnupg
 version=0.5.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/python_gnupg-${version}-py2.py3-none-any.whl"
 hostmakedepends="python3-setuptools python3-wheel"
 depends="python3 gnupg"
 checkdepends="${depends} python3-pytest"
diff --git a/srcpkgs/python3-ipython_ipykernel/template b/srcpkgs/python3-ipython_ipykernel/template
index 42020b2dc775..4034b98a6ff5 100644
--- a/srcpkgs/python3-ipython_ipykernel/template
+++ b/srcpkgs/python3-ipython_ipykernel/template
@@ -3,7 +3,6 @@ pkgname=python3-ipython_ipykernel
 version=6.19.2
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ipykernel-${version}-*-*-*.whl"
 hostmakedepends="hatchling python3-jupyter_client python3-jupyter_core
  python3-platformdirs"
 depends="python3-ipython python3-traitlets python3-jupyter_client python3-tornado
diff --git a/srcpkgs/python3-logbook/template b/srcpkgs/python3-logbook/template
index b49bd495ae46..319bb1e19ab5 100644
--- a/srcpkgs/python3-logbook/template
+++ b/srcpkgs/python3-logbook/template
@@ -4,7 +4,6 @@ version=1.5.3
 revision=6
 build_style=python3-pep517
 make_check_args="--ignore=scripts"
-make_install_target="dist/Logbook-${version}-*-*-*_*.whl"
 hostmakedepends="python3-setuptools python3-wheel python3-devel python3-Cython"
 depends="python3"
 checkdepends="python3-execnet python3-pytest python3-pyzmq python3-SQLAlchemy
diff --git a/srcpkgs/python3-markdown-it/template b/srcpkgs/python3-markdown-it/template
index acd48c68a10a..75075530af2a 100644
--- a/srcpkgs/python3-markdown-it/template
+++ b/srcpkgs/python3-markdown-it/template
@@ -3,7 +3,6 @@ pkgname=python3-markdown-it
 version=2.2.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/markdown_it_py-${version}-*-*-*.whl"
 hostmakedepends="python3-flit_core"
 depends="python3-mdurl"
 short_desc="Python port of the JavaScript mardown-it package"
diff --git a/srcpkgs/python3-mistune2/template b/srcpkgs/python3-mistune2/template
index 76bc57ec0b6c..82f19f0bb31c 100644
--- a/srcpkgs/python3-mistune2/template
+++ b/srcpkgs/python3-mistune2/template
@@ -3,7 +3,6 @@ pkgname=python3-mistune2
 version=2.0.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/mistune-${version}-*-*-*.whl"
 hostmakedepends="python3-wheel"
 depends="python3"
 checkdepends="python3-pytest"
diff --git a/srcpkgs/python3-quart/template b/srcpkgs/python3-quart/template
index b032ba6bc283..49f066b717cc 100644
--- a/srcpkgs/python3-quart/template
+++ b/srcpkgs/python3-quart/template
@@ -3,7 +3,6 @@ pkgname=python3-quart
 version=0.18.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/quart-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core"
 depends="python3-aiofiles python3-hypercorn python3-click python3-MarkupSafe
  python3-blinker python3-itsdangerous python3-Jinja2 python3-Werkzeug"
diff --git a/srcpkgs/python3-saml2/template b/srcpkgs/python3-saml2/template
index 0a386d5c2ae1..9583564c1008 100644
--- a/srcpkgs/python3-saml2/template
+++ b/srcpkgs/python3-saml2/template
@@ -6,7 +6,6 @@ build_style=python3-pep517
 make_check_args="--ignore=tests/test_36_mdbcache.py \
  --ignore=tests/test_75_mongodb.py \
  --ignore=tests/test_76_metadata_in_mdb.py"
-make_install_target="dist/pysaml2-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core unzip"
 depends="python3-cryptography python3-openssl python3-dateutil python3-pytz
  python3-requests python3-six python3-defusedxml python3-xmlschema"
diff --git a/srcpkgs/python3-ytmusicapi/template b/srcpkgs/python3-ytmusicapi/template
index 96248893bded..78e59051e530 100644
--- a/srcpkgs/python3-ytmusicapi/template
+++ b/srcpkgs/python3-ytmusicapi/template
@@ -3,7 +3,6 @@ pkgname=python3-ytmusicapi
 version=1.0.2
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ytmusicapi-*.*.*-*-*-*.whl"
 hostmakedepends="python3-setuptools_scm python3-wheel"
 depends="python3-requests"
 checkdepends="$depends python3-coverage"
diff --git a/srcpkgs/rofi-rbw/template b/srcpkgs/rofi-rbw/template
index 164abbeab791..c6d83a812d99 100644
--- a/srcpkgs/rofi-rbw/template
+++ b/srcpkgs/rofi-rbw/template
@@ -3,7 +3,6 @@ pkgname=rofi-rbw
 version=1.2.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/rofi_rbw-${version}-py3-none-any.whl"
 hostmakedepends="python3-poetry-core"
 depends="python3 python3-ConfigArgParse rbw"
 short_desc="Rofi frontend for Bitwarden"
diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template
index a116d321f6bc..2749f0a5c548 100644
--- a/srcpkgs/synapse/template
+++ b/srcpkgs/synapse/template
@@ -5,7 +5,6 @@ revision=1
 build_style=python3-pep517
 build_helper=rust
 make_check_target=tests
-make_install_target="dist/matrix_synapse-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core python3-setuptools-rust cargo"
 depends="python3-jsonschema python3-immutabledict python3-unpaddedbase64
  python3-canonicaljson python3-signedjson python3-pynacl

From 7495296a7470c403d033e2365dc4a03b773ac1b4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 09:38:07 -0400
Subject: [PATCH 4/5] synapse: fix build

---
 srcpkgs/synapse/patches/setuptools-rust.patch | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 srcpkgs/synapse/patches/setuptools-rust.patch

diff --git a/srcpkgs/synapse/patches/setuptools-rust.patch b/srcpkgs/synapse/patches/setuptools-rust.patch
new file mode 100644
index 000000000000..bd44bbe863a6
--- /dev/null
+++ b/srcpkgs/synapse/patches/setuptools-rust.patch
@@ -0,0 +1,13 @@
+The merit of limiting upper version is dubious and breaks the build.
+
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -368,7 +368,7 @@
+ # system changes.
+ # We are happy to raise these upper bounds upon request,
+ # provided we check that it's safe to do so (i.e. that CI passes).
+-requires = ["poetry-core>=1.0.0,<=1.5.0", "setuptools_rust>=1.3,<=1.5.2"]
++requires = ["poetry-core>=1.0.0,<=1.5.0", "setuptools_rust>=1.3"]
+ build-backend = "poetry.core.masonry.api"
+ 
+ 

From 3e8b941f8a3f8520db77aae7aefeeaad2a1026ea Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 09:41:17 -0400
Subject: [PATCH 5/5] python3-xcffib: update to 1.3.0.

---
 srcpkgs/python3-xcffib/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-xcffib/template b/srcpkgs/python3-xcffib/template
index e33b1feed7cc..07fa9f0732c0 100644
--- a/srcpkgs/python3-xcffib/template
+++ b/srcpkgs/python3-xcffib/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-xcffib'
 pkgname=python3-xcffib
-version=0.11.1
-revision=2
+version=1.3.0
+revision=1
 build_style=python3-pep517
 hostmakedepends="python3-setuptools pkg-config cabal-install parallel xcb-proto python3-cffi python3-wheel"
 makedepends="python3-devel libffi-devel libxcb-devel python3-six"
@@ -11,7 +11,7 @@ maintainer="Kai Stian Olstad <void@olstad.com>"
 license="Apache-2.0"
 homepage="https://github.com/tych0/xcffib"
 distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=bd89c1e65cf4773fe10d70209ba069e0e1fe82c37c121501fc404aa9867d0ff3
+checksum=e0819e9cf56d47839a58755728af22eee02cad3b8b57157f8f682f187da96013
 nocross="Cannot yet cross compile with Haskell"
 
 pre_build() {

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

* Re: build-style/python3-pep517: use a generic glob for wheels
  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
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 14:11 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#issuecomment-1562981730

Comment:
I have made a couple of changes:

1. A squash commit refactors `do_check`: a) to short-circuit checks when `pytest` is not installed, avoiding the need to nest the bulk of the function inside a conditional; b) to avoid setting `make_install_target` in `do_check` when it is undefined in the template, deferring the default assignment to `do_install`.
2. Remove the now-superfluous `make_install_target` in all PEP517 templates.
3. Fix the build of `synapse` and (by updating) `pythone3-xcffib`.

Please confirm that you are OK with these changes, and we can squash down my alterations before merge.

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

* Re: build-style/python3-pep517: use a generic glob for wheels
  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
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: icp1994 @ 2023-05-25 14:13 UTC (permalink / raw)
  To: ml

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

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#issuecomment-1562985847

Comment:
For synapse, there is a update PR https://github.com/void-linux/void-packages/pull/43815 which includes the raised setuptools_rust bound from [upstream](https://github.com/matrix-org/synapse/blob/v1.84.0/pyproject.toml#L371)

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

* Re: [PR PATCH] [Updated] build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (2 preceding siblings ...)
  2023-05-25 14:13 ` icp1994
@ 2023-05-25 14:15 ` ahesford
  2023-05-25 14:16 ` ahesford
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 14:15 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by ahesford 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: 14571 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 1/4] 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}

From 0fba85289e88c1723d7cd237520539c3a153039a Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 10:04:28 -0400
Subject: [PATCH 2/4] squash! build-style/python3-pep517: use a generic glob
 for wheels
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

build-style/python3-pep517: use a generic glob for wheels, refactor

Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy>
Co-authored-by: Andrew J. Hesford <ajh@sideband.org>
---
 common/build-style/python3-pep517.sh | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index c09b3df4ebc4..ffe52fccf3db 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -9,24 +9,22 @@ do_build() {
 }
 
 do_check() {
-	: ${make_install_target:="dist/*.whl"}
+	if ! python3 -c 'import pytest' >/dev/null 2>&1; then
+		msg_warn "Testing of python3-pep517 templates requires pytest\n"
+		return 0
+	fi
 
 	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 python3 -c 'import xdist' >/dev/null 2>&1; then
+		testjobs="-n $XBPS_MAKEJOBS"
+	fi
 
-		local testdir="${wrksrc}/tmp/$(date +%s)"
-		python3 -m installer --destdir "${testdir}" \
-			${make_install_args} ${make_install_target}
+	local testdir="${wrksrc}/tmp/$(date +%s)"
+	python3 -m installer --destdir "${testdir}" \
+		${make_install_args} ${make_install_target:-dist/*.whl}
 
-		PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
-			${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
-	else
-		msg_warn "Unable to determine tests for PEP517 Python templates\n"
-		return 0
-	fi
+	PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
+		${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
 }
 
 do_install() {

From a881d6b36c83ed9f694ba54f2f9c73690a383b6f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 09:27:35 -0400
Subject: [PATCH 3/4] python3-*: remove unnecessary make_install_target for
 pep517

Now that the wheel glob in do_check and do_install is more generic,
there is no longer a need to override the default behavior.
---
 srcpkgs/python3-PyHamcrest/template        | 1 -
 srcpkgs/python3-Pyphen/template            | 1 -
 srcpkgs/python3-Sphinx/template            | 1 -
 srcpkgs/python3-WeasyPrint/template        | 1 -
 srcpkgs/python3-ansible-lint/template      | 1 -
 srcpkgs/python3-b2sdk/template             | 1 -
 srcpkgs/python3-gnupg/template             | 1 -
 srcpkgs/python3-ipython_ipykernel/template | 1 -
 srcpkgs/python3-logbook/template           | 1 -
 srcpkgs/python3-markdown-it/template       | 1 -
 srcpkgs/python3-mistune2/template          | 1 -
 srcpkgs/python3-quart/template             | 1 -
 srcpkgs/python3-saml2/template             | 1 -
 srcpkgs/python3-ytmusicapi/template        | 1 -
 srcpkgs/rofi-rbw/template                  | 1 -
 srcpkgs/synapse/template                   | 1 -
 16 files changed, 16 deletions(-)

diff --git a/srcpkgs/python3-PyHamcrest/template b/srcpkgs/python3-PyHamcrest/template
index cbba236bc53b..d6b17d61463f 100644
--- a/srcpkgs/python3-PyHamcrest/template
+++ b/srcpkgs/python3-PyHamcrest/template
@@ -3,7 +3,6 @@ pkgname=python3-PyHamcrest
 version=2.0.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/pyhamcrest-${version}-*-*-*.whl"
 hostmakedepends="hatch-vcs"
 depends="python3"
 checkdepends="python3-pytest python3-numpy"
diff --git a/srcpkgs/python3-Pyphen/template b/srcpkgs/python3-Pyphen/template
index a0f9db3ea933..a8d34fb01d9d 100644
--- a/srcpkgs/python3-Pyphen/template
+++ b/srcpkgs/python3-Pyphen/template
@@ -3,7 +3,6 @@ pkgname=python3-Pyphen
 version=0.14.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/pyphen-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core python3-flit_core"
 checkdepends="python3-pytest-isort python3-pytest-cov python3-pytest-flake8
  python3-pytest-xdist"
diff --git a/srcpkgs/python3-Sphinx/template b/srcpkgs/python3-Sphinx/template
index 26b161172705..c49bb438a78b 100644
--- a/srcpkgs/python3-Sphinx/template
+++ b/srcpkgs/python3-Sphinx/template
@@ -3,7 +3,6 @@ pkgname=python3-Sphinx
 version=7.0.1
 revision=1
 build_style=python3-pep517
-make_install_target="dist/sphinx-$version-py3-none-any.whl"
 hostmakedepends="python3-flit_core python3-pyproject-hooks"
 depends="python3-Jinja2 python3-docutils python3-Pygments
  python3-snowballstemmer python3-Babel python3-alabaster python3-imagesize
diff --git a/srcpkgs/python3-WeasyPrint/template b/srcpkgs/python3-WeasyPrint/template
index 8c87d92cbea5..0b0a2040b6c1 100644
--- a/srcpkgs/python3-WeasyPrint/template
+++ b/srcpkgs/python3-WeasyPrint/template
@@ -3,7 +3,6 @@ pkgname=python3-WeasyPrint
 version=59.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/weasyprint-${version}-py3-none-any.whl"
 _runtime_deps="fonttools python3-Pillow python3-cssselect2 python3-html5lib python3-cffi
  python3-Pyphen python3-pydyf glib pango"
 hostmakedepends="python3-poetry-core python3-flit_core ${_runtime_deps}"
diff --git a/srcpkgs/python3-ansible-lint/template b/srcpkgs/python3-ansible-lint/template
index ad75a253c592..f99a3c167dd6 100644
--- a/srcpkgs/python3-ansible-lint/template
+++ b/srcpkgs/python3-ansible-lint/template
@@ -3,7 +3,6 @@ pkgname=python3-ansible-lint
 version=6.14.3
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ansible_lint-*-*-*-*.whl"
 hostmakedepends="python3-wheel python3-setuptools_scm"
 depends="python3-ansible-compat ansible-core black python3-filelock
  python3-jsonschema python3-packaging python3-yaml python3-rich
diff --git a/srcpkgs/python3-b2sdk/template b/srcpkgs/python3-b2sdk/template
index 720dab64afc0..b2db87588bf8 100644
--- a/srcpkgs/python3-b2sdk/template
+++ b/srcpkgs/python3-b2sdk/template
@@ -3,7 +3,6 @@ pkgname=python3-b2sdk
 version=1.20.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/b2sdk-${version}-*-*-*.whl"
 hostmakedepends="python3-setuptools_scm python3-wheel"
 depends="python3-logfury python3-Arrow python3-requests python3-tqdm"
 checkdepends="python3-pytest-lazy-fixture $depends python3-dateutil
diff --git a/srcpkgs/python3-gnupg/template b/srcpkgs/python3-gnupg/template
index 597b6888818b..4b2c42dc299f 100644
--- a/srcpkgs/python3-gnupg/template
+++ b/srcpkgs/python3-gnupg/template
@@ -3,7 +3,6 @@ pkgname=python3-gnupg
 version=0.5.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/python_gnupg-${version}-py2.py3-none-any.whl"
 hostmakedepends="python3-setuptools python3-wheel"
 depends="python3 gnupg"
 checkdepends="${depends} python3-pytest"
diff --git a/srcpkgs/python3-ipython_ipykernel/template b/srcpkgs/python3-ipython_ipykernel/template
index 42020b2dc775..4034b98a6ff5 100644
--- a/srcpkgs/python3-ipython_ipykernel/template
+++ b/srcpkgs/python3-ipython_ipykernel/template
@@ -3,7 +3,6 @@ pkgname=python3-ipython_ipykernel
 version=6.19.2
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ipykernel-${version}-*-*-*.whl"
 hostmakedepends="hatchling python3-jupyter_client python3-jupyter_core
  python3-platformdirs"
 depends="python3-ipython python3-traitlets python3-jupyter_client python3-tornado
diff --git a/srcpkgs/python3-logbook/template b/srcpkgs/python3-logbook/template
index b49bd495ae46..319bb1e19ab5 100644
--- a/srcpkgs/python3-logbook/template
+++ b/srcpkgs/python3-logbook/template
@@ -4,7 +4,6 @@ version=1.5.3
 revision=6
 build_style=python3-pep517
 make_check_args="--ignore=scripts"
-make_install_target="dist/Logbook-${version}-*-*-*_*.whl"
 hostmakedepends="python3-setuptools python3-wheel python3-devel python3-Cython"
 depends="python3"
 checkdepends="python3-execnet python3-pytest python3-pyzmq python3-SQLAlchemy
diff --git a/srcpkgs/python3-markdown-it/template b/srcpkgs/python3-markdown-it/template
index acd48c68a10a..75075530af2a 100644
--- a/srcpkgs/python3-markdown-it/template
+++ b/srcpkgs/python3-markdown-it/template
@@ -3,7 +3,6 @@ pkgname=python3-markdown-it
 version=2.2.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/markdown_it_py-${version}-*-*-*.whl"
 hostmakedepends="python3-flit_core"
 depends="python3-mdurl"
 short_desc="Python port of the JavaScript mardown-it package"
diff --git a/srcpkgs/python3-mistune2/template b/srcpkgs/python3-mistune2/template
index 76bc57ec0b6c..82f19f0bb31c 100644
--- a/srcpkgs/python3-mistune2/template
+++ b/srcpkgs/python3-mistune2/template
@@ -3,7 +3,6 @@ pkgname=python3-mistune2
 version=2.0.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/mistune-${version}-*-*-*.whl"
 hostmakedepends="python3-wheel"
 depends="python3"
 checkdepends="python3-pytest"
diff --git a/srcpkgs/python3-quart/template b/srcpkgs/python3-quart/template
index b032ba6bc283..49f066b717cc 100644
--- a/srcpkgs/python3-quart/template
+++ b/srcpkgs/python3-quart/template
@@ -3,7 +3,6 @@ pkgname=python3-quart
 version=0.18.4
 revision=1
 build_style=python3-pep517
-make_install_target="dist/quart-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core"
 depends="python3-aiofiles python3-hypercorn python3-click python3-MarkupSafe
  python3-blinker python3-itsdangerous python3-Jinja2 python3-Werkzeug"
diff --git a/srcpkgs/python3-saml2/template b/srcpkgs/python3-saml2/template
index 0a386d5c2ae1..9583564c1008 100644
--- a/srcpkgs/python3-saml2/template
+++ b/srcpkgs/python3-saml2/template
@@ -6,7 +6,6 @@ build_style=python3-pep517
 make_check_args="--ignore=tests/test_36_mdbcache.py \
  --ignore=tests/test_75_mongodb.py \
  --ignore=tests/test_76_metadata_in_mdb.py"
-make_install_target="dist/pysaml2-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core unzip"
 depends="python3-cryptography python3-openssl python3-dateutil python3-pytz
  python3-requests python3-six python3-defusedxml python3-xmlschema"
diff --git a/srcpkgs/python3-ytmusicapi/template b/srcpkgs/python3-ytmusicapi/template
index 96248893bded..78e59051e530 100644
--- a/srcpkgs/python3-ytmusicapi/template
+++ b/srcpkgs/python3-ytmusicapi/template
@@ -3,7 +3,6 @@ pkgname=python3-ytmusicapi
 version=1.0.2
 revision=1
 build_style=python3-pep517
-make_install_target="dist/ytmusicapi-*.*.*-*-*-*.whl"
 hostmakedepends="python3-setuptools_scm python3-wheel"
 depends="python3-requests"
 checkdepends="$depends python3-coverage"
diff --git a/srcpkgs/rofi-rbw/template b/srcpkgs/rofi-rbw/template
index 164abbeab791..c6d83a812d99 100644
--- a/srcpkgs/rofi-rbw/template
+++ b/srcpkgs/rofi-rbw/template
@@ -3,7 +3,6 @@ pkgname=rofi-rbw
 version=1.2.0
 revision=1
 build_style=python3-pep517
-make_install_target="dist/rofi_rbw-${version}-py3-none-any.whl"
 hostmakedepends="python3-poetry-core"
 depends="python3 python3-ConfigArgParse rbw"
 short_desc="Rofi frontend for Bitwarden"
diff --git a/srcpkgs/synapse/template b/srcpkgs/synapse/template
index a116d321f6bc..2749f0a5c548 100644
--- a/srcpkgs/synapse/template
+++ b/srcpkgs/synapse/template
@@ -5,7 +5,6 @@ revision=1
 build_style=python3-pep517
 build_helper=rust
 make_check_target=tests
-make_install_target="dist/matrix_synapse-${version}-*-*-*.whl"
 hostmakedepends="python3-poetry-core python3-setuptools-rust cargo"
 depends="python3-jsonschema python3-immutabledict python3-unpaddedbase64
  python3-canonicaljson python3-signedjson python3-pynacl

From a478518761a3eeea2d2ae015d80a499088bee195 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Thu, 25 May 2023 09:41:17 -0400
Subject: [PATCH 4/4] python3-xcffib: update to 1.3.0.

---
 srcpkgs/python3-xcffib/template | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-xcffib/template b/srcpkgs/python3-xcffib/template
index e33b1feed7cc..07fa9f0732c0 100644
--- a/srcpkgs/python3-xcffib/template
+++ b/srcpkgs/python3-xcffib/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-xcffib'
 pkgname=python3-xcffib
-version=0.11.1
-revision=2
+version=1.3.0
+revision=1
 build_style=python3-pep517
 hostmakedepends="python3-setuptools pkg-config cabal-install parallel xcb-proto python3-cffi python3-wheel"
 makedepends="python3-devel libffi-devel libxcb-devel python3-six"
@@ -11,7 +11,7 @@ maintainer="Kai Stian Olstad <void@olstad.com>"
 license="Apache-2.0"
 homepage="https://github.com/tych0/xcffib"
 distfiles="${homepage}/archive/v${version}.tar.gz"
-checksum=bd89c1e65cf4773fe10d70209ba069e0e1fe82c37c121501fc404aa9867d0ff3
+checksum=e0819e9cf56d47839a58755728af22eee02cad3b8b57157f8f682f187da96013
 nocross="Cannot yet cross compile with Haskell"
 
 pre_build() {

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

* Re: build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (3 preceding siblings ...)
  2023-05-25 14:15 ` [PR PATCH] [Updated] " ahesford
@ 2023-05-25 14:16 ` ahesford
  2023-05-25 14:51 ` [PR REVIEW] " tornaria
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 14:16 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#issuecomment-1562990432

Comment:
Thanks; I dropped the synapse fix.

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

* Re: [PR REVIEW] build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (4 preceding siblings ...)
  2023-05-25 14:16 ` ahesford
@ 2023-05-25 14:51 ` tornaria
  2023-05-25 14:56 ` tornaria
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tornaria @ 2023-05-25 14:51 UTC (permalink / raw)
  To: ml

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

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#discussion_r1205638641

Comment:
```suggestion
	python3 -m installer --destdir ${DESTDIR} \
		${make_install_args} ${make_install_target:-dist/*.whl}
```

Use the same style as above?

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

* Re: build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (5 preceding siblings ...)
  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
  8 siblings, 0 replies; 10+ messages in thread
From: tornaria @ 2023-05-25 14:56 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#issuecomment-1563055680

Comment:
LGTM, thanks! I made a minor suggestion so the style in `do_install()` matches the style in `do_check()`. I prefer the other way (setting default values at the top of the function) since that acts as documentation and makes it much more clear what are default values, etc. and it's a style used throughout.

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

* Re: [PR REVIEW] build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (6 preceding siblings ...)
  2023-05-25 14:56 ` tornaria
@ 2023-05-25 15:25 ` ahesford
  2023-05-25 17:43 ` [PR PATCH] [Closed]: " ahesford
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 15:25 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/44071#discussion_r1205685559

Comment:
 I think it's desirable to have `make_install_target` set, even to a default value, by the time `do_install` is run. This might be useful, *e.g.*, if somebody tries to use it in `post_install` or something (even though I doubt anybody is currently doing so). However, I'd rather not set the variable it in `do_check` because otherwise it potentially change the default behavior based on whether checks are enabled. That could lead to non-obvious bugs if, *e.g.*, somebody tries to change the default value in one place and forgets to change it in another. By making `do_install` the authoritative place for assigning the default (as it is with other build styles), the most we break by using the fallback in `do_check` is the check itself.

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

* Re: [PR PATCH] [Closed]: build-style/python3-pep517: use a generic glob for wheels
  2023-05-24 23:04 [PR PATCH] build-style/python3-pep517: use a generic glob for wheels tornaria
                   ` (7 preceding siblings ...)
  2023-05-25 15:25 ` [PR REVIEW] " ahesford
@ 2023-05-25 17:43 ` ahesford
  8 siblings, 0 replies; 10+ messages in thread
From: ahesford @ 2023-05-25 17:43 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

build-style/python3-pep517: use a generic glob for wheels
https://github.com/void-linux/void-packages/pull/44071

Description:
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
-->


^ 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).