diff --git a/science/py-OpenFermion/Makefile b/science/py-OpenFermion/Makefile index caadb69162c4..c5898f3e1833 100644 --- a/science/py-OpenFermion/Makefile +++ b/science/py-OpenFermion/Makefile @@ -1,38 +1,50 @@ PORTNAME= OpenFermion DISTVERSIONPREFIX= v -DISTVERSION= 1.8.0 +DISTVERSION= 1.8.1 CATEGORIES= science python # quantum-computing PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= yuri@FreeBSD.org COMMENT= Electronic structure package for quantum computers WWW= https://github.com/quantumlib/OpenFermion LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cirq-core>=1.6.0:science/py-cirq-core@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}cirq-google>=0.15.0:science/py-cirq-google@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}deprecation>0:devel/py-deprecation@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}h5py>0:science/py-h5py@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}networkx>0:math/py-networkx@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}numpy>0:math/py-numpy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}PubChemPy>0:science/py-PubChemPy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}scipy>0:science/py-scipy@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}sympy>0:math/py-sympy@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}nbformat>0:devel/py-nbformat@${PY_FLAVOR} USES= python USE_PYTHON= distutils autoplist pytest # 1 tests fails, see https://github.com/quantumlib/OpenFermion/issues/879 USE_GITHUB= yes GH_ACCOUNT= quantumlib NO_ARCH= yes BINARY_ALIAS= python3=${PYTHON_CMD} # only for tests -# tests as of 1.7.1: 2 failed, 2157 passed, 60 skipped, 218 warnings in 3296.13s (0:54:56) +# tests hang wihout these ignores/deselects: +TEST_ARGS= --ignore=src/openfermion/testing/performance_benchmarks_test.py \ + --ignore=src/openfermion/testing/lih_integration_test.py \ + --ignore=src/openfermion/linalg/davidson_test.py \ + --ignore=src/openfermion/linalg/linear_qubit_operator_test.py \ + --ignore=src/openfermion/hamiltonians/jellium_test.py \ + --ignore=src/openfermion/hamiltonians/plane_wave_hamiltonian_test.py \ + --ignore=src/openfermion/chem/pubchem_test.py \ + --deselect=src/openfermion/ops/representations/doci_hamiltonian_test.py::IntegralTransformsTest::test_fermionic_hamiltonian_from_integrals \ + --deselect=src/openfermion/transforms/opconversions/remove_symmetry_qubits_test.py::ReduceSymmetryQubitsTest::test_energy_reduce_symmetry_qubits \ + --deselect=src/openfermion/transforms/opconversions/verstraete_cirac_test.py::VerstraeteCirac2dSquareGroundStateTest::test_ground_energy + +# tests as of 1.8.1: 2112 passed, 60 skipped, 3 deselected, 17 warnings in 1499.31s (0:24:59) .include diff --git a/science/py-OpenFermion/distinfo b/science/py-OpenFermion/distinfo index 3f607337eaac..07724404c86e 100644 --- a/science/py-OpenFermion/distinfo +++ b/science/py-OpenFermion/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1784098492 -SHA256 (quantumlib-OpenFermion-v1.8.0_GH0.tar.gz) = bdc49e2f37a4580d2af58bfecdf672e046b22c83f5c770d363b1cac4256dacd5 -SIZE (quantumlib-OpenFermion-v1.8.0_GH0.tar.gz) = 45505341 +TIMESTAMP = 1784748576 +SHA256 (quantumlib-OpenFermion-v1.8.1_GH0.tar.gz) = d03703c309df12046e9285bbd1f1d434e3774e56248a5b860a1779c9d3b291cb +SIZE (quantumlib-OpenFermion-v1.8.1_GH0.tar.gz) = 45506202 diff --git a/science/py-OpenFermion/files/patch-conftest.py b/science/py-OpenFermion/files/patch-conftest.py new file mode 100644 index 000000000000..04936589bbf4 --- /dev/null +++ b/science/py-OpenFermion/files/patch-conftest.py @@ -0,0 +1,17 @@ +--- conftest.py.orig 2026-07-22 21:48:17 UTC ++++ conftest.py +@@ -14,6 +14,14 @@ import sys + import os + import sys + ++# The deprecated pynvml package installs a meta path finder whose ++# find_spec() signature is incompatible with Python 3.12 and breaks ++# cirq import when pynvml happens to be present in the test environment. ++for _finder in sys.meta_path[:]: ++ if type(_finder).__name__ == "PynvmlFinder": ++ sys.meta_path.remove(_finder) ++del _finder ++ + # Ensure src/ is in sys.path so that the OpenFermion utils module can be + # imported at Pytest startup time. + sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "src")))