git: 26a1cb5d3fd2 - main - devel/py-chai: Easy to use mocking, stubbing and spying framework

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Sun, 20 Aug 2023 16:28:08 UTC
The branch main has been updated by tcberner:

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

commit 26a1cb5d3fd2607de3df220908438efd52d0ce03
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2023-08-20 16:24:47 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2023-08-20 16:26:21 +0000

    devel/py-chai: Easy to use mocking, stubbing and spying framework
    
    Chai provides a very easy to use api for mocking, stubbing and spying
    your python objects, patterned after the Mocha library for Ruby.
    
    This port is required for KDE's CI builders.
---
 devel/Makefile                            |  1 +
 devel/py-chai/Makefile                    | 16 ++++++++++++++++
 devel/py-chai/distinfo                    |  3 +++
 devel/py-chai/files/patch-chai_python2.py |  7 +++++++
 devel/py-chai/pkg-descr                   |  2 ++
 5 files changed, 29 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 26a85209ab18..3f3e42c01892 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4441,6 +4441,7 @@
     SUBDIR += py-cfgv
     SUBDIR += py-cfn-lint
     SUBDIR += py-cftime
+    SUBDIR += py-chai
     SUBDIR += py-chainmap
     SUBDIR += py-characteristic
     SUBDIR += py-check-jsonschema
diff --git a/devel/py-chai/Makefile b/devel/py-chai/Makefile
new file mode 100644
index 000000000000..cef7725a1ad5
--- /dev/null
+++ b/devel/py-chai/Makefile
@@ -0,0 +1,16 @@
+PORTNAME=	chai
+DISTVERSION=	1.1.2
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	tcberner@FreeBSD.org
+COMMENT=	Easy to use mocking, stubbing and spying framework.
+WWW=		https://pypi.org/project/chai/
+
+LICENSE=	BSD
+
+USES=		python
+USE_PYTHON=	autoplist distutils
+
+.include <bsd.port.mk>
diff --git a/devel/py-chai/distinfo b/devel/py-chai/distinfo
new file mode 100644
index 000000000000..462175904a6f
--- /dev/null
+++ b/devel/py-chai/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1692547803
+SHA256 (chai-1.1.2.tar.gz) = ff8d2b6855f660cd23cd5ec79bd10264d39f24f6235773331b48e7fcd637d6cc
+SIZE (chai-1.1.2.tar.gz) = 107807
diff --git a/devel/py-chai/files/patch-chai_python2.py b/devel/py-chai/files/patch-chai_python2.py
new file mode 100644
index 000000000000..f8a931a9a9bd
--- /dev/null
+++ b/devel/py-chai/files/patch-chai_python2.py
@@ -0,0 +1,7 @@
+--- chai/python2.py.orig	2023-08-20 16:18:50 UTC
++++ chai/python2.py
+@@ -1,3 +1,3 @@ def reraise(exc, msg, traceback):
+ 
+ def reraise(exc, msg, traceback):
+-    raise exc, msg, traceback
++    raise(exc, msg, traceback)
diff --git a/devel/py-chai/pkg-descr b/devel/py-chai/pkg-descr
new file mode 100644
index 000000000000..2b2ff05a02f2
--- /dev/null
+++ b/devel/py-chai/pkg-descr
@@ -0,0 +1,2 @@
+Chai provides a very easy to use api for mocking, stubbing and spying your
+python objects, patterned after the Mocha library for Ruby.