Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Oct 2024 05:27:08 GMT
From:      Po-Chuan Hsieh <sunpoet@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d8f05e1eab20 - main - devel/py-crosshair-tool: Add py-crosshair-tool 0.0.74
Message-ID:  <202410140527.49E5R8b8046612@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by sunpoet:

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

commit d8f05e1eab204fa83d38addc6efb95d87fac1a1d
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2024-10-14 04:45:08 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-10-14 04:45:08 +0000

    devel/py-crosshair-tool: Add py-crosshair-tool 0.0.74
    
    CrossHair is an analysis tool for Python that blurs the line between testing and
    type systems.
    
    If you have a function with type annotations and add a contract in a supported
    syntax, CrossHair will attempt to find counterexamples for you.
    
    CrossHair works by repeatedly calling your functions with symbolic inputs. It
    uses an SMT solver (a kind of theorem prover) to explore viable execution paths
    and find counterexamples for you. This is not a new idea; a Python approach was
    first described in this paper. However, to my knowledge, CrossHair is the most
    complete implementation: it can use symbolic reasoning for the built-in types,
    user-defined classes, and much of the standard library.
---
 devel/Makefile                               |  1 +
 devel/py-crosshair-tool/Makefile             | 30 ++++++++++++++++++++++++++++
 devel/py-crosshair-tool/distinfo             |  3 +++
 devel/py-crosshair-tool/files/patch-setup.py | 11 ++++++++++
 devel/py-crosshair-tool/pkg-descr            | 12 +++++++++++
 5 files changed, 57 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 50615c8cb62f..0ef448281f6d 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -4700,6 +4700,7 @@
     SUBDIR += py-crcmod
     SUBDIR += py-crick
     SUBDIR += py-crontab
+    SUBDIR += py-crosshair-tool
     SUBDIR += py-cson
     SUBDIR += py-csv23
     SUBDIR += py-ctags
diff --git a/devel/py-crosshair-tool/Makefile b/devel/py-crosshair-tool/Makefile
new file mode 100644
index 000000000000..7634bf527d89
--- /dev/null
+++ b/devel/py-crosshair-tool/Makefile
@@ -0,0 +1,30 @@
+PORTNAME=	crosshair-tool
+PORTVERSION=	0.0.74
+CATEGORIES=	devel python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Analyze Python code for correctness using symbolic execution
+WWW=		https://github.com/pschanely/CrossHair
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}wheel>=0:devel/py-wheel@${PY_FLAVOR}
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}importlib-metadata>=4.0.0:devel/py-importlib-metadata@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}packaging>=0:devel/py-packaging@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}pygls>=1.0.0:devel/py-pygls@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typeshed-client>=2.0.5:devel/py-typeshed-client@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.10.0:devel/py-typing-extensions@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}typing-inspect>=0.7.1:devel/py-typing-inspect@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}z3-solver>=4.13.0.0:math/py-z3-solver@${PY_FLAVOR}
+
+USES=		python
+USE_PYTHON=	autoplist concurrent pep517
+
+post-install:
+	${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} +
+
+.include <bsd.port.mk>
diff --git a/devel/py-crosshair-tool/distinfo b/devel/py-crosshair-tool/distinfo
new file mode 100644
index 000000000000..87b9f419aea0
--- /dev/null
+++ b/devel/py-crosshair-tool/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1728632222
+SHA256 (crosshair-tool-0.0.74.tar.gz) = 519be9cc21388686aa1181c3df6b10e58d5f3167eda88d77342d2ccb353eb32d
+SIZE (crosshair-tool-0.0.74.tar.gz) = 447341
diff --git a/devel/py-crosshair-tool/files/patch-setup.py b/devel/py-crosshair-tool/files/patch-setup.py
new file mode 100644
index 000000000000..b4c1c899d061
--- /dev/null
+++ b/devel/py-crosshair-tool/files/patch-setup.py
@@ -0,0 +1,11 @@
+--- setup.py.orig	2024-10-08 03:13:44 UTC
++++ setup.py
+@@ -43,7 +43,7 @@ setup(
+         "packaging",
+         "typing-inspect>=0.7.1",
+         "typing_extensions>=3.10.0",
+-        "z3-solver==4.13.0.0",
++        "z3-solver>=4.13.0.0",
+         "importlib_metadata>=4.0.0",
+         "pygls>=1.0.0",  # For the LSP server
+         "typeshed-client>=2.0.5",
diff --git a/devel/py-crosshair-tool/pkg-descr b/devel/py-crosshair-tool/pkg-descr
new file mode 100644
index 000000000000..543bc2a35027
--- /dev/null
+++ b/devel/py-crosshair-tool/pkg-descr
@@ -0,0 +1,12 @@
+CrossHair is an analysis tool for Python that blurs the line between testing and
+type systems.
+
+If you have a function with type annotations and add a contract in a supported
+syntax, CrossHair will attempt to find counterexamples for you.
+
+CrossHair works by repeatedly calling your functions with symbolic inputs. It
+uses an SMT solver (a kind of theorem prover) to explore viable execution paths
+and find counterexamples for you. This is not a new idea; a Python approach was
+first described in this paper. However, to my knowledge, CrossHair is the most
+complete implementation: it can use symbolic reasoning for the built-in types,
+user-defined classes, and much of the standard library.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410140527.49E5R8b8046612>