Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir
@ 2023-05-19 19:32 icp1994
  2023-05-24 22:40 ` tornaria
                   ` (31 more replies)
  0 siblings, 32 replies; 33+ messages in thread
From: icp1994 @ 2023-05-19 19:32 UTC (permalink / raw)
  To: ml

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

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

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 669db3b3b7a5408fb9f69971c8252c9772267e6b Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 19 May 2023 12:46:35 +0530
Subject: [PATCH 1/2] common/build-style/python3-pep517.sh: ignore tests in
 temp destdir

---
 common/build-style/python3-pep517.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index f13046ea1968..0a9257b7ba7e 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -25,7 +25,8 @@ do_check() {
 			${make_install_args} ${make_install_target}
 
 		PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
-			${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
+			${make_check_pre} pytest3 --ignore="${testdir}" ${testjobs} \
+			${make_check_args} ${make_check_target}
 	else
 		msg_warn "Unable to determine tests for PEP517 Python templates\n"
 		return 0

From 94eeba9d20b895f73cf5c230c7b2fb3e49f5a888 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 2/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
@ 2023-05-24 22:40 ` tornaria
  2023-05-25 14:25 ` [PR PATCH] [Updated] " icp1994
                   ` (30 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-05-24 22:40 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1562016558

Comment:
This PR fixes the first time check is run, but not the second and subsequent runs.

In fact, the wheel will be installed into a different testdir each time (and not removed afterwards) and this only ignores the current one.

Suggestions:
 - use `testdir=$(mktemp -d)` so the testdir is outside the wrksrc tree.
 - use `--ignore=${wrksrc}/tmp` so we ignore all installations.

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
  2023-05-24 22:40 ` tornaria
@ 2023-05-25 14:25 ` icp1994
  2023-05-25 14:27 ` icp1994
                   ` (29 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 14:25 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 8bcfddfa6bb696bfddc4ac5b3817676663f033de Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 19 May 2023 12:46:35 +0530
Subject: [PATCH 1/2] common/build-style/python3-pep517.sh: ignore tests in
 temp destdir

---
 common/build-style/python3-pep517.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index f13046ea1968..4b739b586ec8 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -25,7 +25,8 @@ do_check() {
 			${make_install_args} ${make_install_target}
 
 		PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
-			${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
+			${make_check_pre} pytest3 --ignore="${wrksrc}/tmp" ${testjobs} \
+			${make_check_args} ${make_check_target}
 	else
 		msg_warn "Unable to determine tests for PEP517 Python templates\n"
 		return 0

From 69ed70bb3329d3dc662f3bc1e123d89a5efc15ba Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 2/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
  2023-05-24 22:40 ` tornaria
  2023-05-25 14:25 ` [PR PATCH] [Updated] " icp1994
@ 2023-05-25 14:27 ` icp1994
  2023-05-25 14:59 ` tornaria
                   ` (28 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 14:27 UTC (permalink / raw)
  To: ml

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

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563007986

Comment:
Oh, right.

I'll keep it in wrksrc so that it gets auto-cleaned by `xbps-src`.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (2 preceding siblings ...)
  2023-05-25 14:27 ` icp1994
@ 2023-05-25 14:59 ` tornaria
  2023-05-25 15:11 ` icp1994
                   ` (27 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-05-25 14:59 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563061637

Comment:
LGTM now. Just FTR this  merge confilcts with #44071 but both PR are necessary.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (3 preceding siblings ...)
  2023-05-25 14:59 ` tornaria
@ 2023-05-25 15:11 ` icp1994
  2023-05-25 15:20 ` ahesford
                   ` (26 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 15:11 UTC (permalink / raw)
  To: ml

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

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563080604

Comment:
Yeah I'll rebase once that's merged into master.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (4 preceding siblings ...)
  2023-05-25 15:11 ` icp1994
@ 2023-05-25 15:20 ` ahesford
  2023-05-25 15:36 ` ahesford
                   ` (25 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-25 15:20 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563094338

Comment:
This seems reasonable. Using `mktemp` to create directories outside of `$wrksrc` is undesirable because we might potentially leave artifacts that aren't cleaned up by `xbps-src clean`. Sure, it will be in `/tmp`, but it's still better to be sure it gets cleaned up after the build.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (5 preceding siblings ...)
  2023-05-25 15:20 ` ahesford
@ 2023-05-25 15:36 ` ahesford
  2023-05-25 15:44 ` icp1994
                   ` (24 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-25 15:36 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563117329

Comment:
Hrm, should we just remove the tmpdir after the tests are run?

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (6 preceding siblings ...)
  2023-05-25 15:36 ` ahesford
@ 2023-05-25 15:44 ` icp1994
  2023-05-25 16:15 ` ahesford
                   ` (23 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 15:44 UTC (permalink / raw)
  To: ml

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

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563129296

Comment:
Where would you put the `rm` call though? If the `pytest` call fails, it won't get to that.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (7 preceding siblings ...)
  2023-05-25 15:44 ` icp1994
@ 2023-05-25 16:15 ` ahesford
  2023-05-25 19:13 ` [PR PATCH] [Updated] " icp1994
                   ` (22 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-25 16:15 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563172638

Comment:
That's okay, because failing tests will already abort a build and any subsequent attempt probably ought to start from a clean masterdir for proper behavior anyway. Cleaning up at the end of `do_check` after a successful test should be good enough. Leaving the temporary directory around after a failed test also lets users inspect the installation for defects that might have triggered the error.

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (8 preceding siblings ...)
  2023-05-25 16:15 ` ahesford
@ 2023-05-25 19:13 ` icp1994
  2023-05-25 19:15 ` icp1994
                   ` (21 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 19:13 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 5c47f26e81ebc82907f823e7a1aec855b27c3cc6 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 1/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

From 6905c03263b913b92d268ff1e2cd30ce440582df Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 26 May 2023 00:43:08 +0530
Subject: [PATCH 2/2] common/build-style/python3-pep517.sh: ignore tests in
 temp destdir

---
 common/build-style/python3-pep517.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index ffe52fccf3db..47c4f7bea688 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -24,7 +24,10 @@ do_check() {
 		${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}
+		${make_check_pre} pytest3 --ignore="${wrksrc}/tmp" ${testjobs} \
+		${make_check_args} ${make_check_target}
+
+	rm -r "${wrksrc}/tmp"
 }
 
 do_install() {

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (9 preceding siblings ...)
  2023-05-25 19:13 ` [PR PATCH] [Updated] " icp1994
@ 2023-05-25 19:15 ` icp1994
  2023-05-25 19:19 ` ahesford
                   ` (20 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-05-25 19:15 UTC (permalink / raw)
  To: ml

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

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563390581

Comment:
Oh, okay. I thought the norm was if the build is successful, one should be able to run `./xbps-src check` multiple times on failed tests without running `./xbps-src clean`

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (10 preceding siblings ...)
  2023-05-25 19:15 ` icp1994
@ 2023-05-25 19:19 ` ahesford
  2023-05-31 13:59 ` [PR REVIEW] " ahesford
                   ` (19 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-25 19:19 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1563395974

Comment:
Sure, it's reasonable to repeatedly run `check` to work out test issues, but when it comes time to build and install the final package, I definitely recommend a clean build first.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (11 preceding siblings ...)
  2023-05-25 19:19 ` ahesford
@ 2023-05-31 13:59 ` ahesford
  2023-05-31 14:00 ` ahesford
                   ` (18 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-31 13:59 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1211768371

Comment:
I've been thinking about this some more and believe we should be more targeted in the removal:
```suggestion
	rm -r "${testdir}"
```
Yes, this will leave `tmp` around if we created it, but I suspect that won't cause any problems, and it might avoid a problem where a package actually ships a `tmp` directory.  What do you think?

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (12 preceding siblings ...)
  2023-05-31 13:59 ` [PR REVIEW] " ahesford
@ 2023-05-31 14:00 ` ahesford
  2023-05-31 21:44 ` tornaria
                   ` (17 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-05-31 14:00 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1211769583

Comment:
Alternatively, we could do:
```suggestion
	rm -r "${testdir}"
	rmdir tmp >/dev/null 2>&1 || true
```

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (13 preceding siblings ...)
  2023-05-31 14:00 ` ahesford
@ 2023-05-31 21:44 ` tornaria
  2023-05-31 21:56 ` tornaria
                   ` (16 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-05-31 21:44 UTC (permalink / raw)
  To: ml

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

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1212349960

Comment:
I agree with removing only what was created in this run (i.e. just `${tmpdir}`).

Also, in terms of avoiding conflicts, maybe the tmpdir should be something more "unique". Perhaps `${wrksrc}/.xbps-tmpdir/$(data +%s)` which also has the advantage that pytest will not recurse hidden directories, so the `--ignore ..` doesn't seem to be necessary.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (14 preceding siblings ...)
  2023-05-31 21:44 ` tornaria
@ 2023-05-31 21:56 ` tornaria
  2023-06-01  7:06 ` [PR REVIEW] " icp1994
                   ` (15 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-05-31 21:56 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1571016360

Comment:
While we are at this, I was going to suggest using a venv instead of `--destdir` + `PYTHONPATH` trick. Indeed, I found some packages that fail when `PYTHONPATH` is messed upon.

The gist of it would be something like:
```
local testdir="${wrksrc}/.xbps-tmpdir/$(date +%s)"
python3 -m venv --system-site-packages --without-pip ${testdir}
${testdir}/bin/python3 -m installer ${make_install_args} ${make_install_target:-dist/*.whl}

PATH=${testdir}/bin:$PATH ${make_check_pre} python3 -m \
    pytest ${testjobs} ${make_check_args} ${make_check_target}
```

This is needed to fix check for `python3-coverage`, see: https://github.com/void-linux/void-packages/pull/44160/commits/4366b1ccf70c3dd531416aec2f75f95f5ad5827c.

I also needed it to fix check for `python3-pytest-cov`, however in that case another hack was necessary so I would still need to rewrite `do_check()`. See: https://github.com/void-linux/void-packages/pull/44160/commits/65eb1057479d8dff616e56dcafacf3d587657170.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (15 preceding siblings ...)
  2023-05-31 21:56 ` tornaria
@ 2023-06-01  7:06 ` icp1994
  2023-06-01 13:44 ` tornaria
                   ` (14 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-01  7:06 UTC (permalink / raw)
  To: ml

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

New review comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1212687113

Comment:
I'm a bit confused about the need to remove the `$testdir` after a successful run. What's the issue if we keep it there?

And if we are adding `/.xbps-tmpdir` for uniqueness, I don't see why we also need to include another sub-directory under it. I only added the epoch subdirs for the extremely rare chance if a package actually ships a `/tmp` dirrctory under `$wrksrc`.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (16 preceding siblings ...)
  2023-06-01  7:06 ` [PR REVIEW] " icp1994
@ 2023-06-01 13:44 ` tornaria
  2023-06-01 13:57 ` ahesford
                   ` (13 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-06-01 13:44 UTC (permalink / raw)
  To: ml

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

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1213180452

Comment:
Fine with me in principle. Although I'd be wary about what happens when there is an old testdir lying around from a previous check run. I don' t know if `python -m installer` will do the right thing.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (17 preceding siblings ...)
  2023-06-01 13:44 ` tornaria
@ 2023-06-01 13:57 ` ahesford
  2023-06-01 14:01 ` ahesford
                   ` (12 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-01 13:57 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1213199698

Comment:
I guess this is irrelevant because the wheel was already built before the tmpdir was created, and the installer should really only be unpacking the wheel. I do prefer @tornaria's suggestion to give the directory a hidden, XBPS-specific name that is extremely unlikely to conflict with package contents. Maybe try changing `testdir` to `.xbps-testdir` (which is more meaningful than `.xbps-tempdir`) and see if that solves your problem without needing to ignore tests, and then skip the removal.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (18 preceding siblings ...)
  2023-06-01 13:57 ` ahesford
@ 2023-06-01 14:01 ` ahesford
  2023-06-02 17:16 ` [PR PATCH] [Updated] " icp1994
                   ` (11 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-01 14:01 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1572115466

Comment:
I'm not convinced we should move to a venv for testing. Half of your two test cases require further adjustment (symlinking a package into the venv) anyway. Adjusting the Python path is a supported mechanism, so the failure of those two packages probably reflects some inappropriate assumptions in those packages.

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (19 preceding siblings ...)
  2023-06-01 14:01 ` ahesford
@ 2023-06-02 17:16 ` icp1994
  2023-06-02 17:19 ` [PR REVIEW] " icp1994
                   ` (10 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-02 17:16 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 60ef1bdc9499ee57005e3d692c79a6ad3f5f5cee Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 1/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

From 0712107b9f3381003d02e7bc3ad8041c12b3e31d Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 26 May 2023 00:43:08 +0530
Subject: [PATCH 2/2] common/build-style/python3-pep517.sh: ignore tests in
 temp destdir

---
 common/build-style/python3-pep517.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index ffe52fccf3db..569fce118d82 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -19,7 +19,9 @@ do_check() {
 		testjobs="-n $XBPS_MAKEJOBS"
 	fi
 
-	local testdir="${wrksrc}/tmp/$(date +%s)"
+	local testdir="${wrksrc}/.xbps-testdir"
+	rm -rf "${testdir}"
+
 	python3 -m installer --destdir "${testdir}" \
 		${make_install_args} ${make_install_target:-dist/*.whl}
 

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (20 preceding siblings ...)
  2023-06-02 17:16 ` [PR PATCH] [Updated] " icp1994
@ 2023-06-02 17:19 ` icp1994
  2023-06-05  1:42 ` tornaria
                   ` (9 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-02 17:19 UTC (permalink / raw)
  To: ml

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

New review comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1214629497

Comment:
After some testing, the python installer doesn't override files so moved the deletion logic at top. And removed the now redundant epoch subdir & ignore flag.

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

* Re: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (21 preceding siblings ...)
  2023-06-02 17:19 ` [PR REVIEW] " icp1994
@ 2023-06-05  1:42 ` tornaria
  2023-06-05  3:58 ` [PR REVIEW] " ahesford
                   ` (8 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: tornaria @ 2023-06-05  1:42 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#issuecomment-1575916434

Comment:
This LGTM, let's get this in, we can figure out whether switching or not to testing using a venv later (cf #44268 where I needed a venv). 

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (22 preceding siblings ...)
  2023-06-05  1:42 ` tornaria
@ 2023-06-05  3:58 ` ahesford
  2023-06-05  3:59 ` ahesford
                   ` (7 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-05  3:58 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1217437147

Comment:
The benefit of cleaning up the test directory *after* we've used it is that we (attempt to) restore the source tree to the state it was in when the function was first called.

The benefit of cleaning up the directory before it would normally exist seems dubious. If we agree there is no need to clean up the test after a successful run, I think changing the directory name as you've done is sufficient.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (23 preceding siblings ...)
  2023-06-05  3:58 ` [PR REVIEW] " ahesford
@ 2023-06-05  3:59 ` ahesford
  2023-06-05  3:59 ` ahesford
                   ` (6 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-05  3:59 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1217437147

Comment:
The benefit of cleaning up the test directory *after* we've used it is that we (attempt to) restore the source tree to the state it was in when the function was first called.

The *benefit* of cleaning up the directory before it would normally exist seems dubious. If we agree there is no need to clean up the test after a successful run, I think changing the directory name as you've done is sufficient.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (24 preceding siblings ...)
  2023-06-05  3:59 ` ahesford
@ 2023-06-05  3:59 ` ahesford
  2023-06-05 15:10 ` ahesford
                   ` (5 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-05  3:59 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1217437147

Comment:
The benefit of cleaning up the test directory *after* we've used it is that we (attempt to) restore the source tree to the state it was in when the function was first called.

The benefit of cleaning up the directory *before* it would normally exist seems dubious. If we agree there is no need to clean up the test after a successful run, I think changing the directory name as you've done is sufficient.

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (25 preceding siblings ...)
  2023-06-05  3:59 ` ahesford
@ 2023-06-05 15:10 ` ahesford
  2023-06-05 19:36 ` [PR PATCH] [Updated] " icp1994
                   ` (4 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-05 15:10 UTC (permalink / raw)
  To: ml

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

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1218216356

Comment:
I just ran into the reason for the cleanup: attempting to re-run a check after a failure will cause `python3 -m installer` to fail unless the test directory is clean. Still, I think the idea of purging a (typically nonexistent) directory just to avoid issues with re-running tests is strange. At this point, I guess I'd rather see
```sh
local testdir="${wrksrc}/.xbps-testdir/$(date +s)"
```
and skip cleanup altogether. This should solve the problem of `pytest` trying to traverse into `tmp` without requiring a manual exclude, keeps our tests in a more-likely-unique subdirectory that should not conflict with any package contents, and avoid strange pre-clean steps. As a bonus, if you *do* run multiple tests to correct a failure, you can always do something like
```sh
diff -r .xbps-testdir/<failed> .xbps-testdir/<succeeeded>
```
after the fact to confirm what, if anything, has changed in the installed wheel.

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (26 preceding siblings ...)
  2023-06-05 15:10 ` ahesford
@ 2023-06-05 19:36 ` icp1994
  2023-06-05 19:42 ` icp1994
                   ` (3 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-05 19:36 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 86e76885a1d9f5cfcac96d386bf917df87fced28 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 1/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

From a16895d6ab20851274ce01c3d662f32b09055322 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 26 May 2023 00:43:08 +0530
Subject: [PATCH 2/2] common/build-style/python3-pep517.sh: ignore tests in
 temp destdir

---
 common/build-style/python3-pep517.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index ffe52fccf3db..b524495c0b25 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -19,7 +19,8 @@ do_check() {
 		testjobs="-n $XBPS_MAKEJOBS"
 	fi
 
-	local testdir="${wrksrc}/tmp/$(date +%s)"
+	local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
+
 	python3 -m installer --destdir "${testdir}" \
 		${make_install_args} ${make_install_target:-dist/*.whl}
 

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (27 preceding siblings ...)
  2023-06-05 19:36 ` [PR PATCH] [Updated] " icp1994
@ 2023-06-05 19:42 ` icp1994
  2023-06-05 19:44 ` [PR REVIEW] " icp1994
                   ` (2 subsequent siblings)
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-05 19:42 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 86e76885a1d9f5cfcac96d386bf917df87fced28 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 1/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

From 01717cbc795a7a87e0513786804d4a0514aad691 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 26 May 2023 00:43:08 +0530
Subject: [PATCH 2/2] common/build-style/python3-pep517.sh: extract wheels in
 hidden dirs

This prevents pytest from collecting tests multiple times when
they are bundled in the wheel itself alongside the source tree.
---
 common/build-style/python3-pep517.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index ffe52fccf3db..b524495c0b25 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -19,7 +19,8 @@ do_check() {
 		testjobs="-n $XBPS_MAKEJOBS"
 	fi
 
-	local testdir="${wrksrc}/tmp/$(date +%s)"
+	local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
+
 	python3 -m installer --destdir "${testdir}" \
 		${make_install_args} ${make_install_target:-dist/*.whl}
 

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

* Re: [PR REVIEW] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (28 preceding siblings ...)
  2023-06-05 19:42 ` icp1994
@ 2023-06-05 19:44 ` icp1994
  2023-06-05 19:46 ` [PR PATCH] [Updated] " icp1994
  2023-06-05 20:27 ` [PR PATCH] [Closed]: " ahesford
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-05 19:44 UTC (permalink / raw)
  To: ml

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

New review comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43946#discussion_r1218517888

Comment:
Ayyy, feels like I'm running in circles :laughing: This should be the Final.Final.Final.patch

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

* Re: [PR PATCH] [Updated] common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (29 preceding siblings ...)
  2023-06-05 19:44 ` [PR REVIEW] " icp1994
@ 2023-06-05 19:46 ` icp1994
  2023-06-05 20:27 ` [PR PATCH] [Closed]: " ahesford
  31 siblings, 0 replies; 33+ messages in thread
From: icp1994 @ 2023-06-05 19:46 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by icp1994 against master on the void-packages repository

https://github.com/icp1994/void-packages build-style/python3-pep517
https://github.com/void-linux/void-packages/pull/43946

common/build-style/python3-pep517.sh: ignore tests in temp destdir
#### Testing the changes
- I tested the changes in this PR: **YES**

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

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

From 86e76885a1d9f5cfcac96d386bf917df87fced28 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Thu, 16 Feb 2023 19:39:39 +0530
Subject: [PATCH 1/2] python3-colorama: update to 0.4.6.

---
 srcpkgs/python3-colorama/template | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-colorama/template b/srcpkgs/python3-colorama/template
index 36a3dda2081c..ec542c2b3b4a 100644
--- a/srcpkgs/python3-colorama/template
+++ b/srcpkgs/python3-colorama/template
@@ -1,18 +1,20 @@
 # Template file for 'python3-colorama'
 pkgname=python3-colorama
-version=0.4.5
-revision=2
-build_style=python3-module
-hostmakedepends="unzip python3-setuptools"
+version=0.4.6
+revision=1
+build_style=python3-pep517
+hostmakedepends="hatchling"
 depends="python3"
+checkdepends="python3-pytest"
 short_desc="Cross-platform colored terminal text (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://github.com/tartley/colorama"
 changelog="https://github.com/tartley/colorama/raw/master/CHANGELOG.rst"
 distfiles="${PYPI_SITE}/c/colorama/colorama-${version}.tar.gz"
-checksum=e6c6b4334fc50988a639d9b98aa429a0b57da6e17b9a44f0451f930b6967b7a4
+checksum=08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44
 
 post_install() {
 	vlicense LICENSE.txt
+	rm -r ${DESTDIR}/${py3_sitelib}/colorama/tests
 }

From 62db14935aa32b0b4b94c10e0495a065337d8108 Mon Sep 17 00:00:00 2001
From: icp <pangolin@vivaldi.net>
Date: Fri, 26 May 2023 00:43:08 +0530
Subject: [PATCH 2/2] common/build-style/python3-pep517.sh: extract wheels in
 hidden dirs

This prevents pytest from collecting tests multiple times when
they are bundled in the wheel itself alongside the source tree.
---
 common/build-style/python3-pep517.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index ffe52fccf3db..2d5ff7caf34e 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -19,7 +19,7 @@ do_check() {
 		testjobs="-n $XBPS_MAKEJOBS"
 	fi
 
-	local testdir="${wrksrc}/tmp/$(date +%s)"
+	local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
 	python3 -m installer --destdir "${testdir}" \
 		${make_install_args} ${make_install_target:-dist/*.whl}
 

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

* Re: [PR PATCH] [Closed]: common/build-style/python3-pep517.sh: ignore tests in temp destdir
  2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
                   ` (30 preceding siblings ...)
  2023-06-05 19:46 ` [PR PATCH] [Updated] " icp1994
@ 2023-06-05 20:27 ` ahesford
  31 siblings, 0 replies; 33+ messages in thread
From: ahesford @ 2023-06-05 20:27 UTC (permalink / raw)
  To: ml

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

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

common/build-style/python3-pep517.sh: ignore tests in temp destdir
https://github.com/void-linux/void-packages/pull/43946

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

An edge case I came across today. On rare cases, packages include tests in their built wheel. While testing with these wheels extracted in a temporary directory, it conflicts with the tests in the source tree as pytest cannot run testfiless with same name in different directories (ref: https://github.com/pytest-dev/pytest/issues/3151).

See [this run](https://github.com/void-linux/void-packages/actions/runs/5021644643/jobs/9004230165) as an example. The same package passes checks correctly in this PR.

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

end of thread, other threads:[~2023-06-05 20:27 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-19 19:32 [PR PATCH] common/build-style/python3-pep517.sh: ignore tests in temp destdir icp1994
2023-05-24 22:40 ` tornaria
2023-05-25 14:25 ` [PR PATCH] [Updated] " icp1994
2023-05-25 14:27 ` icp1994
2023-05-25 14:59 ` tornaria
2023-05-25 15:11 ` icp1994
2023-05-25 15:20 ` ahesford
2023-05-25 15:36 ` ahesford
2023-05-25 15:44 ` icp1994
2023-05-25 16:15 ` ahesford
2023-05-25 19:13 ` [PR PATCH] [Updated] " icp1994
2023-05-25 19:15 ` icp1994
2023-05-25 19:19 ` ahesford
2023-05-31 13:59 ` [PR REVIEW] " ahesford
2023-05-31 14:00 ` ahesford
2023-05-31 21:44 ` tornaria
2023-05-31 21:56 ` tornaria
2023-06-01  7:06 ` [PR REVIEW] " icp1994
2023-06-01 13:44 ` tornaria
2023-06-01 13:57 ` ahesford
2023-06-01 14:01 ` ahesford
2023-06-02 17:16 ` [PR PATCH] [Updated] " icp1994
2023-06-02 17:19 ` [PR REVIEW] " icp1994
2023-06-05  1:42 ` tornaria
2023-06-05  3:58 ` [PR REVIEW] " ahesford
2023-06-05  3:59 ` ahesford
2023-06-05  3:59 ` ahesford
2023-06-05 15:10 ` ahesford
2023-06-05 19:36 ` [PR PATCH] [Updated] " icp1994
2023-06-05 19:42 ` icp1994
2023-06-05 19:44 ` [PR REVIEW] " icp1994
2023-06-05 19:46 ` [PR PATCH] [Updated] " icp1994
2023-06-05 20:27 ` [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).