1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-18 00:10:04 +00:00

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.
This commit is contained in:
Po-Chuan Hsieh 2024-10-14 12:45:08 +08:00
parent dabbe8449f
commit d8f05e1eab
No known key found for this signature in database
GPG Key ID: 9A4BD10F002DD04B
5 changed files with 57 additions and 0 deletions

View File

@ -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

View File

@ -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>

View File

@ -0,0 +1,3 @@
TIMESTAMP = 1728632222
SHA256 (crosshair-tool-0.0.74.tar.gz) = 519be9cc21388686aa1181c3df6b10e58d5f3167eda88d77342d2ccb353eb32d
SIZE (crosshair-tool-0.0.74.tar.gz) = 447341

View File

@ -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",

View File

@ -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.