Skip to content

Commit

Permalink
misc/py-einops: Improve how tests are run
Browse files Browse the repository at this point in the history
The backends variable is required, and is set now.
  • Loading branch information
yurivict committed Jul 11, 2023
1 parent 6a158e5 commit 3808599
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
18 changes: 15 additions & 3 deletions misc/py-einops/Makefile
@@ -1,7 +1,8 @@
PORTNAME= einops
DISTVERSIONPREFIX= v
DISTVERSION= 0.6.1
CATEGORIES= misc # machine-learning
MASTER_SITES= PYPI
#MASTER_SITES= PYPI # some test files are missing in the PYPI tarball
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}

MAINTAINER= yuri@FreeBSD.org
Expand All @@ -13,11 +14,22 @@ LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}hatchling>=1.10.0:devel/py-hatchling@${PY_FLAVOR}
TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}nbconvert>0:devel/py-nbconvert@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}parameterized>0:devel/py-parameterized@${PY_FLAVOR}
${PYTHON_PKGNAMEPREFIX}parameterized>0:devel/py-parameterized@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pytorch>0:misc/py-pytorch@${PY_FLAVOR}

USES= python
USE_PYTHON= pep517 autoplist pytest # 1 test fails because of missing pytorch
USE_PYTHON= pep517 autoplist pytest # 1 test fails because of some pytorch issues, see https://github.com/arogozhnikov/einops/issues/269

USE_GITHUB= yes
GH_ACCOUNT= arogozhnikov

NO_ARCH= yes

BINARY_ALIAS= python=${PYTHON_CMD}

TEST_ENV= ${MAKE_ENV} EINOPS_TEST_BACKENDS="numpy,torch"

do-test-via-script:
@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} test.py numpy pytorch

.include <bsd.port.mk>
6 changes: 3 additions & 3 deletions misc/py-einops/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1687408166
SHA256 (einops-0.6.1.tar.gz) = f95f8d00f4ded90dbc4b19b6f98b177332614b0357dde66997f3ae5d474dc8c8
SIZE (einops-0.6.1.tar.gz) = 55848
TIMESTAMP = 1689062241
SHA256 (arogozhnikov-einops-v0.6.1_GH0.tar.gz) = 693b2ccf131b4959b8f1487f4aef653e2fb7a00056a85137559aa2f2e02effd0
SIZE (arogozhnikov-einops-v0.6.1_GH0.tar.gz) = 380481

0 comments on commit 3808599

Please sign in to comment.