From 89c2ba9e35ddf3926d4944124a927ff7a5315c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= Date: Mon, 29 May 2023 22:46:04 -0300 Subject: [PATCH] python3-pytest-cov: update to 4.1.0. --- srcpkgs/python3-pytest-cov/template | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/srcpkgs/python3-pytest-cov/template b/srcpkgs/python3-pytest-cov/template index 47dc36d4401..edc00f201af 100644 --- a/srcpkgs/python3-pytest-cov/template +++ b/srcpkgs/python3-pytest-cov/template @@ -1,20 +1,32 @@ # Template file for 'python3-pytest-cov' pkgname=python3-pytest-cov -version=3.0.0 -revision=2 -build_style=python3-module -hostmakedepends="python3-setuptools" +version=4.1.0 +revision=1 +build_style=python3-pep517 +hostmakedepends="python3-setuptools python3-wheel" depends="python3-pytest python3-coverage" -checkdepends="$depends python3-toml python3-py python3-pluggy python3-packaging - python3-more-itertools python3-attrs python3-six python3-parsing" +checkdepends="$depends python3-fields python3-process-tests + python3-pytest-xdist python3-virtualenv" short_desc="Pytest plugin for measuring coverage" maintainer="Piotr Wójcik " license="MIT" homepage="https://pytest-cov.readthedocs.io/en/latest/" changelog="https://raw.githubusercontent.com/pytest-dev/pytest-cov/master/CHANGELOG.rst" distfiles="${PYPI_SITE}/p/pytest-cov/pytest-cov-${version}.tar.gz" -checksum=e7f0f5b1617d2210a2cabc266dfe2f4c75a8d32fb89eafb7ad9d06f6d076d470 -make_check=no # requires unpackaged xdist, fields, process_tests +checksum=3904b13dfbfec47f003b8e77fd5b589cd11904a21ddf1ab38a64f204d6a10ef6 + +do_check() { + # Running via PYTHONPATH breaks a few tests so we use a venv + local testdir="${wrksrc}/.xbps-testdir/$(date +%s)" + python3 -m venv --system-site-packages --without-pip "${testdir}" + + local testpy="${testdir}/bin/python3" + "${testpy}" -m installer dist/*.whl + # coverage needs to be installed inside venv + # see: https://github.com/pytest-dev/pytest-cov/issues/517 + ln -s /${py3_sitelib}/coverage ${testdir}${py3_sitelib#usr} + PATH="${testdir}/bin:${PATH}" "${testpy}" -m pytest -n ${XBPS_MAKEJOBS} +} post_install() { vlicense LICENSE