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 # asked to relax this in https://github.com/quantumlib/Stim/issues/623
substituteInPlace pyproject.toml \ substituteInPlace pyproject.toml \
--replace-quiet "pybind11~=" "pybind11>=" --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 pybind11
setuptools setuptools
wheel wheel
]; ];
propagatedBuildInputs = [ numpy ]; dependencies = [ numpy ];
nativeCheckInputs = [ nativeCheckInputs = [
cirq-core cirq-core
@ -58,17 +69,18 @@ buildPythonPackage rec {
enableParallelBuilding = true; enableParallelBuilding = true;
disabledTestPaths = [ pytestFlagsArray = [
# Don't test sample # From .github/workflows
"glue/sample/" "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"; description = "Tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits";
mainProgram = "stim"; mainProgram = "stim";
homepage = "https://github.com/quantumlib/stim"; homepage = "https://github.com/quantumlib/stim";
changelog = "https://github.com/quantumlib/Stim/releases/tag/v${version}"; changelog = "https://github.com/quantumlib/Stim/releases/tag/v${version}";
license = licenses.asl20; license = lib.licenses.asl20;
maintainers = with maintainers; [ chrispattison ]; maintainers = with lib.maintainers; [ chrispattison ];
}; };
} }