git: e2d0db77c456 - main - science/py-pymatgen: switch to USES=pytest and partially fix tests

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Tue, 26 Apr 2022 13:49:15 UTC
The branch main has been updated by amdmi3:

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

commit e2d0db77c456768daab0dfbda11a58852950f614
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-04-26 12:56:57 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-04-26 13:48:41 +0000

    science/py-pymatgen: switch to USES=pytest and partially fix tests
    
    - Set up testing properly so it no longer fails on loading own C
      extensions
    - Add missing test-depend
    
    The tests however still fail being unable to find data files missing
    from the distribution
    
    Reported by:    reprise
    Approved by:    portmgr blanket
---
 science/py-pymatgen/Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/science/py-pymatgen/Makefile b/science/py-pymatgen/Makefile
index 8c7b01806e0c..80d6feb651ba 100644
--- a/science/py-pymatgen/Makefile
+++ b/science/py-pymatgen/Makefile
@@ -28,9 +28,9 @@ RUN_DEPENDS=	${PYNUMPY} \
 		${PYTHON_PKGNAMEPREFIX}tabulate>0:devel/py-tabulate@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}typing-extensions>0:devel/py-typing-extensions@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}uncertainties>=3.1.4:math/py-uncertainties@${PY_FLAVOR}
-TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pybtex>0:textproc/py-pybtex@${PY_FLAVOR}
 
-USES=		compiler:c++11-lang python:3.7+
+USES=		compiler:c++11-lang python:3.7+ pytest
 USE_PYTHON=	distutils cython concurrent autoplist
 
 post-install:
@@ -39,7 +39,8 @@ post-install:
 		optimization/neighbors*.so \
 		util/coord_cython*.so
 
-do-test: # tests fail: https://github.com/materialsproject/pymatgen/issues/2275
-	@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest
+# tests fail: https://github.com/materialsproject/pymatgen/issues/2275
+pre-test:
+	@cd ${WRKSRC} && ${PYTHON_CMD} ${PYSETUP} build_ext --inplace
 
 .include <bsd.port.mk>