git: 2d8d281cb5c2 - main - debel/py-nbval: New port: PyTest plugin to validate Jupyter notebooks

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sat, 15 Oct 2022 05:22:38 UTC
The branch main has been updated by yuri:

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

commit 2d8d281cb5c2f3f3c786ccbb1bbd36e7539471c8
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-10-15 05:21:57 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-10-15 05:22:32 +0000

    debel/py-nbval: New port: PyTest plugin to validate Jupyter notebooks
---
 devel/Makefile           |  1 +
 devel/py-nbval/Makefile  | 26 ++++++++++++++++++++++++++
 devel/py-nbval/distinfo  |  3 +++
 devel/py-nbval/pkg-descr | 10 ++++++++++
 4 files changed, 40 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 9652bfd65170..ea19d5c34fba 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4846,6 +4846,7 @@
     SUBDIR += py-nbconvert
     SUBDIR += py-nbdime
     SUBDIR += py-nbformat
+    SUBDIR += py-nbval
     SUBDIR += py-nest-asyncio
     SUBDIR += py-node-semver
     SUBDIR += py-nodeenv
diff --git a/devel/py-nbval/Makefile b/devel/py-nbval/Makefile
new file mode 100644
index 000000000000..f8ed3b4f431e
--- /dev/null
+++ b/devel/py-nbval/Makefile
@@ -0,0 +1,26 @@
+PORTNAME=	nbval
+PORTVERSION=	0.9.6
+CATEGORIES=	devel python
+MASTER_SITES=	CHEESESHOP
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	PyTest plugin to validate Jupyter notebooks
+WWW=		https://github.com/computationalmodelling/nbval
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}coverage>0:devel/py-coverage@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}ipykernel>0:devel/py-ipykernel@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}jupyter-client>0:devel/py-jupyter-client@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}nbformat>0:devel/py-nbformat@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pytest>=2.8:devel/py-pytest@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}six>0:devel/py-six@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	distutils autoplist pytest # many tests fail, see https://github.com/computationalmodelling/nbval/issues/189
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/py-nbval/distinfo b/devel/py-nbval/distinfo
new file mode 100644
index 000000000000..945e84a65a23
--- /dev/null
+++ b/devel/py-nbval/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1665810613
+SHA256 (nbval-0.9.6.tar.gz) = cfefcd2ef66ee2d337d0b252c6bcec4023384eb32e8b9e5fcc3ac80ab8cd7d40
+SIZE (nbval-0.9.6.tar.gz) = 60932
diff --git a/devel/py-nbval/pkg-descr b/devel/py-nbval/pkg-descr
new file mode 100644
index 000000000000..a1d8ef20d6e8
--- /dev/null
+++ b/devel/py-nbval/pkg-descr
@@ -0,0 +1,10 @@
+The plugin adds functionality to py.test to recognise and collect Jupyter
+notebooks. The intended purpose of the tests is to determine whether
+execution of the stored inputs match the stored outputs of the .ipynb file.
+Whilst also ensuring that the notebooks are running without errors.
+
+The tests were designed to ensure that Jupyter notebooks (especially those
+for reference and documentation), are executing consistently.
+
+Each cell is taken as a test, a cell that doesn't reproduce the expected output
+will fail.