Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] New package: python3-pytest-xdist and dependencies
@ 2022-05-13  6:13 classabbyamp
  2022-05-13  6:39 ` classabbyamp
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-13  6:13 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages new/python3-pytest-xdist
https://github.com/void-linux/void-packages/pull/37099

New package: python3-pytest-xdist and dependencies
- New package: python3-execnet-1.9.0
- New package: python3-pytest-forked-1.4.0
- New package: python3-pytest-xdist-2.5.0

<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- 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/37099.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-new/python3-pytest-xdist-37099.patch --]
[-- Type: text/x-diff, Size: 4272 bytes --]

From f87e32ab419a1759edd942d9d93149fb66a522fa Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:10:50 -0400
Subject: [PATCH 1/3] New package: python3-execnet-1.9.0

---
 srcpkgs/python3-execnet/template | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/python3-execnet/template

diff --git a/srcpkgs/python3-execnet/template b/srcpkgs/python3-execnet/template
new file mode 100644
index 000000000000..e6634eeded5a
--- /dev/null
+++ b/srcpkgs/python3-execnet/template
@@ -0,0 +1,21 @@
+# Template file for 'python3-execnet'
+pkgname=python3-execnet
+version=1.9.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+checkdepends="python3-pytest"
+short_desc="Distributed Python deployment and communication"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://codespeak.net/execnet/"
+changelog="https://raw.githubusercontent.com/pytest-dev/execnet/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/execnet/archive/refs/tags/v${version}.tar.gz"
+checksum=d53787346558395f2cf8c570f4a9e2457eecde972429bf00c423a40b1f325765
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From f2acfed26d97ff8b3c33e0f57d13b0b7fdab759b Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:12 -0400
Subject: [PATCH 2/3] New package: python3-pytest-forked-1.4.0

---
 srcpkgs/python3-pytest-forked/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-forked/template

diff --git a/srcpkgs/python3-pytest-forked/template b/srcpkgs/python3-pytest-forked/template
new file mode 100644
index 000000000000..d36a05bd46f1
--- /dev/null
+++ b/srcpkgs/python3-pytest-forked/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-forked'
+pkgname=python3-pytest-forked
+version=1.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest"
+short_desc="Run pytest tests in a forked subprocess"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-forked"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-forked/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-forked/archive/refs/tags/v${version}.tar.gz"
+checksum=22f3a65ef24d45fa03c6fec0d4b582f5f02bea4df26966c1b9812d3a64b44ace
+# tests only work inside tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From fc34c7110ede0f812e071d8195ee444e2b22be8f Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:49 -0400
Subject: [PATCH 3/3] New package: python3-pytest-xdist-2.5.0

---
 srcpkgs/python3-pytest-xdist/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-xdist/template

diff --git a/srcpkgs/python3-pytest-xdist/template b/srcpkgs/python3-pytest-xdist/template
new file mode 100644
index 000000000000..3e9bef9bd382
--- /dev/null
+++ b/srcpkgs/python3-pytest-xdist/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-xdist'
+pkgname=python3-pytest-xdist
+version=2.5.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest python3-pytest-forked python3-execnet"
+short_desc="Pytest plugin for distributed testing & loop-on-failures testing modes"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-xdist"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-xdist/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-xdist/archive/refs/tags/v${version}.tar.gz"
+checksum=b0623f7b0e190175f46dbc939cc143ca49af2e5bdc70f2627c083b3ed1109f26
+# tests only work in tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
@ 2022-05-13  6:39 ` classabbyamp
  2022-05-13 16:40 ` classabbyamp
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-13  6:39 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1125707394

Comment:
cc: @abenson 

would this make sense to add to the `python3-{module,pep517}` build styles? maybe as something that could be opt-in or opt-out?

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
  2022-05-13  6:39 ` classabbyamp
@ 2022-05-13 16:40 ` classabbyamp
  2022-05-14 18:58 ` ahesford
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-13 16:40 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1126247483

Comment:
something like this works in my testing
```diff
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -25,9 +25,14 @@ do_build() {
 
 do_check() {
        if python3 -c 'import pytest' >/dev/null 2>&1; then
+               if python3 -c 'import xdist' >/dev/null 2>&1; then
+                       makejobs="-n $XBPS_MAKEJOBS"
+               else
+                       makejobs=
+               fi
                PYTHONPATH="$(cd build/lib* && pwd)" \
                        ${make_check_pre} \
-                       python3 -m pytest ${make_check_args} ${make_check_target}
+                       python3 -m pytest ${makejobs} ${make_check_args} ${make_check_target}
        else
                # Fall back to deprecated setup.py test orchestration without pytest
                if [ -z "$make_check_target" ]; then
```

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
  2022-05-13  6:39 ` classabbyamp
  2022-05-13 16:40 ` classabbyamp
@ 2022-05-14 18:58 ` ahesford
  2022-05-14 19:20 ` classabbyamp
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ahesford @ 2022-05-14 18:58 UTC (permalink / raw)
  To: ml

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

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1126794918

Comment:
Because `makejobs` is special to XBPS, I wouldn't override it in `do_check`. Declare something like
```sh
local testjobs
```
and set that according to the availabilty of `xdist`.

How confident are you that a large number of packages will work as expected by just adding `python3-pytest-xdist` to `checkdepends`? If it can be broadly supported, then adding special consideration to the build styles is worth consideration. If there is more required (*e.g.*, packages have to carefully design their tests to opt into parallel testing), I think we should skip build-style support and just expect templates to add `python3-pytest-xdist` and add a parallel flag to `make_check_args`.

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (2 preceding siblings ...)
  2022-05-14 18:58 ` ahesford
@ 2022-05-14 19:20 ` classabbyamp
  2022-05-14 19:21 ` classabbyamp
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-14 19:20 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1126798112

Comment:
> How confident are you that a large number of packages will work as expected by just adding `python3-pytest-xdist` to `checkdepends`?

Reasonably. By default, it distributes tests randomly between cores. For many packages, that should be enough, but some (that use lots of fixtures &c.) may need an [alternative test distribution method](https://pytest-xdist.readthedocs.io/en/latest/distribution.html) to work well. However, that can be easily done with `make_check_args`.

Also, making it a non-default behaviour should keep from causing too many issues with packages.

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (3 preceding siblings ...)
  2022-05-14 19:20 ` classabbyamp
@ 2022-05-14 19:21 ` classabbyamp
  2022-05-14 19:25 ` [PR PATCH] [Updated] " classabbyamp
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-14 19:21 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1126798112

Comment:
> How confident are you that a large number of packages will work as expected by just adding `python3-pytest-xdist` to `checkdepends`?

Reasonably. By default, it distributes tests randomly between cores. For many packages, that should be enough, but some (that use lots of fixtures &c.) may need an [alternative test distribution method](https://pytest-xdist.readthedocs.io/en/latest/distribution.html) to work well. However, that can be easily done with `make_check_args`.

Also, making it an opt-in behaviour should keep from causing too many issues with packages.

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

* Re: [PR PATCH] [Updated] New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (4 preceding siblings ...)
  2022-05-14 19:21 ` classabbyamp
@ 2022-05-14 19:25 ` classabbyamp
  2022-05-14 20:29 ` tornaria
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-14 19:25 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages new/python3-pytest-xdist
https://github.com/void-linux/void-packages/pull/37099

New package: python3-pytest-xdist and dependencies
- New package: python3-execnet-1.9.0
- New package: python3-pytest-forked-1.4.0
- New package: python3-pytest-xdist-2.5.0

<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- 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/37099.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-new/python3-pytest-xdist-37099.patch --]
[-- Type: text/x-diff, Size: 6198 bytes --]

From f87e32ab419a1759edd942d9d93149fb66a522fa Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:10:50 -0400
Subject: [PATCH 1/4] New package: python3-execnet-1.9.0

---
 srcpkgs/python3-execnet/template | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/python3-execnet/template

diff --git a/srcpkgs/python3-execnet/template b/srcpkgs/python3-execnet/template
new file mode 100644
index 000000000000..e6634eeded5a
--- /dev/null
+++ b/srcpkgs/python3-execnet/template
@@ -0,0 +1,21 @@
+# Template file for 'python3-execnet'
+pkgname=python3-execnet
+version=1.9.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+checkdepends="python3-pytest"
+short_desc="Distributed Python deployment and communication"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://codespeak.net/execnet/"
+changelog="https://raw.githubusercontent.com/pytest-dev/execnet/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/execnet/archive/refs/tags/v${version}.tar.gz"
+checksum=d53787346558395f2cf8c570f4a9e2457eecde972429bf00c423a40b1f325765
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From f2acfed26d97ff8b3c33e0f57d13b0b7fdab759b Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:12 -0400
Subject: [PATCH 2/4] New package: python3-pytest-forked-1.4.0

---
 srcpkgs/python3-pytest-forked/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-forked/template

diff --git a/srcpkgs/python3-pytest-forked/template b/srcpkgs/python3-pytest-forked/template
new file mode 100644
index 000000000000..d36a05bd46f1
--- /dev/null
+++ b/srcpkgs/python3-pytest-forked/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-forked'
+pkgname=python3-pytest-forked
+version=1.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest"
+short_desc="Run pytest tests in a forked subprocess"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-forked"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-forked/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-forked/archive/refs/tags/v${version}.tar.gz"
+checksum=22f3a65ef24d45fa03c6fec0d4b582f5f02bea4df26966c1b9812d3a64b44ace
+# tests only work inside tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From fc34c7110ede0f812e071d8195ee444e2b22be8f Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:49 -0400
Subject: [PATCH 3/4] New package: python3-pytest-xdist-2.5.0

---
 srcpkgs/python3-pytest-xdist/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-xdist/template

diff --git a/srcpkgs/python3-pytest-xdist/template b/srcpkgs/python3-pytest-xdist/template
new file mode 100644
index 000000000000..3e9bef9bd382
--- /dev/null
+++ b/srcpkgs/python3-pytest-xdist/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-xdist'
+pkgname=python3-pytest-xdist
+version=2.5.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest python3-pytest-forked python3-execnet"
+short_desc="Pytest plugin for distributed testing & loop-on-failures testing modes"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-xdist"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-xdist/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-xdist/archive/refs/tags/v${version}.tar.gz"
+checksum=b0623f7b0e190175f46dbc939cc143ca49af2e5bdc70f2627c083b3ed1109f26
+# tests only work in tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From 866c1e371115820e1a953033aea60d596c8ca0f3 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Sat, 14 May 2022 15:23:13 -0400
Subject: [PATCH 4/4] common/build-style/python3-*: add support for
 pytest-xdist

if python3-pytest-xdist is included in checkdepends, use $XBPS_MAKEJOBS
to run tests in parallel.
---
 common/build-style/python3-module.sh | 6 +++++-
 common/build-style/python3-pep517.sh | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index 6ec5225d6aab..a0a694ee4a97 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -24,10 +24,14 @@ do_build() {
 }
 
 do_check() {
+	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
 		PYTHONPATH="$(cd build/lib* && pwd)" \
 			${make_check_pre} \
-			python3 -m pytest ${make_check_args} ${make_check_target}
+			python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
 	else
 		# Fall back to deprecated setup.py test orchestration without pytest
 		if [ -z "$make_check_target" ]; then
diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index a733a521fb3d..97dc7995d58b 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -13,8 +13,12 @@ do_build() {
 }
 
 do_check() {
+	local testjobs
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
-		${make_check_pre} python3 -m pytest ${make_check_args} ${make_check_target}
+		if python3 -c 'import xdist' >/dev/null 2>&1; then
+			testjobs="-n $XBPS_MAKEJOBS"
+		fi
+		${make_check_pre} python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
 	else
 		msg_warn "Unable to determine tests for PEP517 Python templates"
 		return 0

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

* Re: New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (5 preceding siblings ...)
  2022-05-14 19:25 ` [PR PATCH] [Updated] " classabbyamp
@ 2022-05-14 20:29 ` tornaria
  2022-05-17 17:05 ` [PR PATCH] [Updated] " classabbyamp
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2022-05-14 20:29 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#issuecomment-1126806566

Comment:
Maybe relevant: #31811. This makes check stage run in parallel unless `disable_parallel_check` is set in the template (analogue to `disable_parallel_build`).



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

* Re: [PR PATCH] [Updated] New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (6 preceding siblings ...)
  2022-05-14 20:29 ` tornaria
@ 2022-05-17 17:05 ` classabbyamp
  2022-05-17 19:45 ` [PR REVIEW] " basploeger
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-17 17:05 UTC (permalink / raw)
  To: ml

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

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

https://github.com/classabbyamp/void-packages new/python3-pytest-xdist
https://github.com/void-linux/void-packages/pull/37099

New package: python3-pytest-xdist and dependencies
- New package: python3-execnet-1.9.0
- New package: python3-pytest-forked-1.4.0
- New package: python3-pytest-xdist-2.5.0

<!-- Uncomment relevant sections and delete options which are not applicable -->

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

#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements): **YES**

<!-- 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/37099.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-new/python3-pytest-xdist-37099.patch --]
[-- Type: text/x-diff, Size: 6198 bytes --]

From 6b5e4a232f3e35cb11b2d7cbf2007a49fe006fd3 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:10:50 -0400
Subject: [PATCH 1/4] New package: python3-execnet-1.9.0

---
 srcpkgs/python3-execnet/template | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 srcpkgs/python3-execnet/template

diff --git a/srcpkgs/python3-execnet/template b/srcpkgs/python3-execnet/template
new file mode 100644
index 000000000000..e6634eeded5a
--- /dev/null
+++ b/srcpkgs/python3-execnet/template
@@ -0,0 +1,21 @@
+# Template file for 'python3-execnet'
+pkgname=python3-execnet
+version=1.9.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+checkdepends="python3-pytest"
+short_desc="Distributed Python deployment and communication"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://codespeak.net/execnet/"
+changelog="https://raw.githubusercontent.com/pytest-dev/execnet/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/execnet/archive/refs/tags/v${version}.tar.gz"
+checksum=d53787346558395f2cf8c570f4a9e2457eecde972429bf00c423a40b1f325765
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From a812fd8b15b64e7e7bb8f2184d84174687c7e5a4 Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:12 -0400
Subject: [PATCH 2/4] New package: python3-pytest-forked-1.4.0

---
 srcpkgs/python3-pytest-forked/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-forked/template

diff --git a/srcpkgs/python3-pytest-forked/template b/srcpkgs/python3-pytest-forked/template
new file mode 100644
index 000000000000..d36a05bd46f1
--- /dev/null
+++ b/srcpkgs/python3-pytest-forked/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-forked'
+pkgname=python3-pytest-forked
+version=1.4.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest"
+short_desc="Run pytest tests in a forked subprocess"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-forked"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-forked/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-forked/archive/refs/tags/v${version}.tar.gz"
+checksum=22f3a65ef24d45fa03c6fec0d4b582f5f02bea4df26966c1b9812d3a64b44ace
+# tests only work inside tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From 57ff36e7f14d5794ac0aecbb3bc32e995c301b2d Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Fri, 13 May 2022 02:11:49 -0400
Subject: [PATCH 3/4] New package: python3-pytest-xdist-2.5.0

---
 srcpkgs/python3-pytest-xdist/template | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100644 srcpkgs/python3-pytest-xdist/template

diff --git a/srcpkgs/python3-pytest-xdist/template b/srcpkgs/python3-pytest-xdist/template
new file mode 100644
index 000000000000..3e9bef9bd382
--- /dev/null
+++ b/srcpkgs/python3-pytest-xdist/template
@@ -0,0 +1,23 @@
+# Template file for 'python3-pytest-xdist'
+pkgname=python3-pytest-xdist
+version=2.5.0
+revision=1
+wrksrc="${pkgname#python3-}-${version}"
+build_style=python3-module
+hostmakedepends="python3-setuptools python3-setuptools_scm"
+depends="python3-pytest python3-pytest-forked python3-execnet"
+short_desc="Pytest plugin for distributed testing & loop-on-failures testing modes"
+maintainer="classabbyamp <dev@placeviolette.net>"
+license="MIT"
+homepage="https://github.com/pytest-dev/pytest-xdist"
+changelog="https://raw.githubusercontent.com/pytest-dev/pytest-xdist/master/CHANGELOG.rst"
+distfiles="https://github.com/pytest-dev/pytest-xdist/archive/refs/tags/v${version}.tar.gz"
+checksum=b0623f7b0e190175f46dbc939cc143ca49af2e5bdc70f2627c083b3ed1109f26
+# tests only work in tox
+make_check=no
+
+export SETUPTOOLS_SCM_PRETEND_VERSION="$version"
+
+post_install() {
+	vlicense LICENSE
+}

From 24b185122a0c4fb5ecbc269911db4b6b139dbe6f Mon Sep 17 00:00:00 2001
From: classabbyamp <dev@placeviolette.net>
Date: Sat, 14 May 2022 15:23:13 -0400
Subject: [PATCH 4/4] common/build-style/python3-*: add support for
 pytest-xdist

if python3-pytest-xdist is included in checkdepends, use $XBPS_MAKEJOBS
to run tests in parallel.
---
 common/build-style/python3-module.sh | 6 +++++-
 common/build-style/python3-pep517.sh | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/common/build-style/python3-module.sh b/common/build-style/python3-module.sh
index 6ec5225d6aab..a0a694ee4a97 100644
--- a/common/build-style/python3-module.sh
+++ b/common/build-style/python3-module.sh
@@ -24,10 +24,14 @@ do_build() {
 }
 
 do_check() {
+	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
 		PYTHONPATH="$(cd build/lib* && pwd)" \
 			${make_check_pre} \
-			python3 -m pytest ${make_check_args} ${make_check_target}
+			python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
 	else
 		# Fall back to deprecated setup.py test orchestration without pytest
 		if [ -z "$make_check_target" ]; then
diff --git a/common/build-style/python3-pep517.sh b/common/build-style/python3-pep517.sh
index 62cfac7d67d3..1eeb4172492e 100644
--- a/common/build-style/python3-pep517.sh
+++ b/common/build-style/python3-pep517.sh
@@ -13,8 +13,12 @@ do_build() {
 }
 
 do_check() {
+	local testjobs
 	if python3 -c 'import pytest' >/dev/null 2>&1; then
-		${make_check_pre} python3 -m pytest ${make_check_args} ${make_check_target}
+		if python3 -c 'import xdist' >/dev/null 2>&1; then
+			testjobs="-n $XBPS_MAKEJOBS"
+		fi
+		${make_check_pre} python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
 	else
 		msg_warn "Unable to determine tests for PEP517 Python templates"
 		return 0

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

* Re: [PR REVIEW] New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (7 preceding siblings ...)
  2022-05-17 17:05 ` [PR PATCH] [Updated] " classabbyamp
@ 2022-05-17 19:45 ` basploeger
  2022-05-17 19:51 ` basploeger
  2022-05-17 20:35 ` classabbyamp
  10 siblings, 0 replies; 12+ messages in thread
From: basploeger @ 2022-05-17 19:45 UTC (permalink / raw)
  To: ml

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

New review comment by basploeger on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#discussion_r875202292

Comment:
In #37172 checks just worked, despite a warning about tox being deprecated soon.

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

* Re: [PR REVIEW] New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (8 preceding siblings ...)
  2022-05-17 19:45 ` [PR REVIEW] " basploeger
@ 2022-05-17 19:51 ` basploeger
  2022-05-17 20:35 ` classabbyamp
  10 siblings, 0 replies; 12+ messages in thread
From: basploeger @ 2022-05-17 19:51 UTC (permalink / raw)
  To: ml

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

New review comment by basploeger on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#discussion_r875202292

Comment:
In #37172 checks just worked, despite a warning about tox being the only supported tool soon.

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

* Re: [PR REVIEW] New package: python3-pytest-xdist and dependencies
  2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
                   ` (9 preceding siblings ...)
  2022-05-17 19:51 ` basploeger
@ 2022-05-17 20:35 ` classabbyamp
  10 siblings, 0 replies; 12+ messages in thread
From: classabbyamp @ 2022-05-17 20:35 UTC (permalink / raw)
  To: ml

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

New review comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/37099#discussion_r875240148

Comment:
it didn't run any tests, which is expected because the tests in xdist use pytest, which wasn't added to checkdepends: https://github.com/void-linux/void-packages/runs/6477482904?check_suite_focus=true#step:7:107

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

end of thread, other threads:[~2022-05-17 20:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13  6:13 [PR PATCH] New package: python3-pytest-xdist and dependencies classabbyamp
2022-05-13  6:39 ` classabbyamp
2022-05-13 16:40 ` classabbyamp
2022-05-14 18:58 ` ahesford
2022-05-14 19:20 ` classabbyamp
2022-05-14 19:21 ` classabbyamp
2022-05-14 19:25 ` [PR PATCH] [Updated] " classabbyamp
2022-05-14 20:29 ` tornaria
2022-05-17 17:05 ` [PR PATCH] [Updated] " classabbyamp
2022-05-17 19:45 ` [PR REVIEW] " basploeger
2022-05-17 19:51 ` basploeger
2022-05-17 20:35 ` classabbyamp

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