python3Packages.stim: fix build

(cherry picked from commit d2b6df09c9)
This commit is contained in:
wxt 2024-11-14 19:29:20 +08:00 committed by github-actions[bot]
parent 7937932921
commit 3258e18251

View File

@ -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 ];
};
}