From 3258e18251bea3d0ca5d97e7448a001af59a7edd Mon Sep 17 00:00:00 2001 From: wxt <3264117476@qq.com> Date: Thu, 14 Nov 2024 19:29:20 +0800 Subject: [PATCH] python3Packages.stim: fix build (cherry picked from commit d2b6df09c9ecb5e84b264e65f79c1d95ae0cf35a) --- .../python-modules/stim/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/stim/default.nix b/pkgs/development/python-modules/stim/default.nix index 1b5ca74cc77b..743f6163cbe5 100644 --- a/pkgs/development/python-modules/stim/default.nix +++ b/pkgs/development/python-modules/stim/default.nix @@ -34,15 +34,26 @@ buildPythonPackage rec { # asked to relax this in https://github.com/quantumlib/Stim/issues/623 substituteInPlace pyproject.toml \ --replace-quiet "pybind11~=" "pybind11>=" + + # Simple workgroud about https://github.com/networkx/networkx/pull/4829 + # https://github.com/quantumlib/Stim/commit/c0dd0b1c8125b2096cd54b6f72884a459e47fe3e + substituteInPlace glue/lattice_surgery/stimzx/_zx_graph_solver.py \ + --replace-fail "networkx.testing.assert_graphs_equal" "assert networkx.utils.edges_equal" + + substituteInPlace glue/lattice_surgery/stimzx/_text_diagram_parsing.py \ + --replace-fail "nx.testing.assert_graphs_equal" "assert nx.utils.edges_equal" + + substituteInPlace glue/lattice_surgery/stimzx/_text_diagram_parsing_test.py \ + --replace-fail "nx.testing.assert_graphs_equal" "assert nx.utils.edges_equal" ''; - nativeBuildInputs = [ + build-system = [ pybind11 setuptools wheel ]; - propagatedBuildInputs = [ numpy ]; + dependencies = [ numpy ]; nativeCheckInputs = [ cirq-core @@ -58,17 +69,18 @@ buildPythonPackage rec { enableParallelBuilding = true; - disabledTestPaths = [ - # Don't test sample - "glue/sample/" + pytestFlagsArray = [ + # From .github/workflows + "src/" + "glue/cirq" ]; - meta = with lib; { + meta = { description = "Tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits"; mainProgram = "stim"; homepage = "https://github.com/quantumlib/stim"; changelog = "https://github.com/quantumlib/Stim/releases/tag/v${version}"; - license = licenses.asl20; - maintainers = with maintainers; [ chrispattison ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ chrispattison ]; }; }