git: 24ccfa446032 - main - devel/py-pip: Convert to USE_PYTHON=pytest

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 21 Jun 2022 16:38:07 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=24ccfa4460328700d4d427efd02c5fa3e246bbf8

commit 24ccfa4460328700d4d427efd02c5fa3e246bbf8
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2022-06-21 16:33:45 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2022-06-21 16:36:30 +0000

    devel/py-pip: Convert to USE_PYTHON=pytest
---
 devel/py-pip/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/devel/py-pip/Makefile b/devel/py-pip/Makefile
index 77b2d47e96f4..fb4bc9dae1f7 100644
--- a/devel/py-pip/Makefile
+++ b/devel/py-pip/Makefile
@@ -20,7 +20,6 @@ LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 # Tests also need bzr, git, otherwise they fail
 TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cryptography>=0:security/py-cryptography@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}freezegun>=0:devel/py-freezegun@${PY_FLAVOR} \
-		${PYTHON_PKGNAMEPREFIX}pytest>=0,1:devel/py-pytest@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pytest-cov>=0:devel/py-pytest-cov@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pytest-rerunfailures>=0:devel/py-pytest-rerunfailures@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}pytest-xdist>=0:devel/py-pytest-xdist@${PY_FLAVOR} \
@@ -36,10 +35,11 @@ TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}cryptography>=0:security/py-cryptography@${
 
 USES=		cpe python:3.7+ shebangfix
 CPE_VENDOR=	pypa
-USE_PYTHON=	autoplist concurrent distutils
+USE_PYTHON=	autoplist concurrent distutils pytest
 
 MAKE_ENV=	PYTHONPATH=${WRKSRC}/src/
 NO_ARCH=	yes
+TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR}
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	pypa
@@ -64,12 +64,11 @@ post-install-DOCS-on:
 	(cd ${WRKSRC}/build/sphinx/html && \
 	${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} "! -name .buildinfo -and ! -name objects.inv")
 
-do-test:
+pre-test:
 	${MKDIR} ${WRKSRC}/tests/data/common_wheels
 	# the tests check for these wheel files, so fetch them and copy them in
 	${CP} ${DISTDIR}/${DIST_SUBDIR}/setuptools-62.1.0-py3-none-any.whl ${WRKSRC}/tests/data/common_wheels
 	${CP} ${DISTDIR}/${DIST_SUBDIR}/wheel-0.37.1-py2.py3-none-any.whl ${WRKSRC}/tests/data/common_wheels
 	${LN} -sf ${LOCALBASE}/bin/pip ${LOCALBASE}/bin/pip3
-	cd ${WRKSRC} && ${SETENV} PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} ${PYTHON_CMD} -m pytest -rs -v
 
 .include <bsd.port.mk>