python312Packages.{cirq,cirq-core,cirq-google,cirq-rigetti,quil,pyquil}: cleanup & fix (#384232)

authored by Peder Bergebakken Sundt and committed by GitHub a2ce3eeb 163c1868

+70 -89
+24 -20
pkgs/development/python-modules/cirq-core/default.nix
··· 1 1 { 2 2 lib, 3 3 stdenv, 4 + buildPythonPackage, 5 + fetchFromGitHub, 6 + 7 + # build-system 8 + setuptools, 9 + 10 + # dependencies 4 11 attrs, 5 - autoray ? null, 6 - buildPythonPackage, 7 12 duet, 8 - fetchFromGitHub, 9 - freezegun, 10 13 matplotlib, 11 14 networkx, 12 15 numpy, 13 - opt-einsum, 14 16 pandas, 15 - ply, 16 - pylatex ? null, 17 - pyquil ? null, 18 - pytest-asyncio, 19 - pytestCheckHook, 20 - pythonOlder, 21 - quimb ? null, 22 17 requests, 23 18 scipy, 24 - setuptools, 25 19 sortedcontainers, 26 20 sympy, 27 21 tqdm, 28 22 typing-extensions, 23 + autoray ? null, 24 + opt-einsum, 25 + ply, 26 + pylatex ? null, 27 + pyquil ? null, 28 + quimb ? null, 29 + 30 + # tests 31 + freezegun, 32 + pytest-asyncio, 33 + pytestCheckHook, 34 + 29 35 withContribRequires ? false, 30 36 }: 31 37 ··· 34 40 version = "1.4.1-unstable-2024-09-21"; 35 41 pyproject = true; 36 42 37 - disabled = pythonOlder "3.10"; 38 - 39 43 src = fetchFromGitHub { 40 44 owner = "quantumlib"; 41 45 repo = "cirq"; ··· 77 81 ]; 78 82 79 83 nativeCheckInputs = [ 80 - pytestCheckHook 81 - pytest-asyncio 82 84 freezegun 85 + pytest-asyncio 86 + pytestCheckHook 83 87 ]; 84 88 85 89 disabledTestPaths = lib.optionals (!withContribRequires) [ ··· 99 103 "test_prepare_two_qubit_state_using_sqrt_iswap" 100 104 ]; 101 105 102 - meta = with lib; { 106 + meta = { 103 107 description = "Framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits"; 104 108 homepage = "https://github.com/quantumlib/cirq"; 105 109 changelog = "https://github.com/quantumlib/Cirq/releases/tag/v${version}"; 106 - license = licenses.asl20; 107 - maintainers = with maintainers; [ 110 + license = lib.licenses.asl20; 111 + maintainers = with lib.maintainers; [ 108 112 drewrisinger 109 113 fab 110 114 ];
+2 -14
pkgs/development/python-modules/cirq-google/default.nix
··· 1 1 { 2 2 buildPythonPackage, 3 + setuptools, 3 4 cirq-core, 4 - freezegun, 5 5 google-api-core, 6 6 protobuf, 7 + freezegun, 7 8 pytestCheckHook, 8 - setuptools, 9 - protobuf4, 10 - fetchpatch, 11 9 }: 12 10 13 11 buildPythonPackage rec { ··· 18 16 sourceRoot = "${src.name}/${pname}"; 19 17 20 18 build-system = [ setuptools ]; 21 - 22 - patches = [ 23 - # https://github.com/quantumlib/Cirq/pull/6683 Support for protobuf5 24 - (fetchpatch { 25 - url = "https://github.com/quantumlib/Cirq/commit/bae02e4d83aafa29f50aa52073d86eb913ccb2d3.patch"; 26 - hash = "sha256-MqHhKa38BTM6viQtWik0TQjN0OPdrwzCZkkqZsiyF5w="; 27 - includes = [ "cirq_google/serialization/arg_func_langs_test.py" ]; 28 - stripLen = 1; 29 - }) 30 - ]; 31 19 32 20 pythonRelaxDeps = [ 33 21 "protobuf"
+2 -17
pkgs/development/python-modules/cirq-rigetti/default.nix
··· 1 1 { 2 - lib, 3 2 buildPythonPackage, 4 3 cirq-core, 5 - fetchpatch2, 4 + setuptools, 6 5 pyquil, 7 - pytestCheckHook, 8 - pythonOlder, 9 6 qcs-sdk-python, 10 - setuptools, 7 + pytestCheckHook, 11 8 }: 12 9 13 10 buildPythonPackage rec { 14 11 pname = "cirq-rigetti"; 15 12 pyproject = true; 16 13 inherit (cirq-core) version src; 17 - 18 - disabled = pythonOlder "3.10"; 19 - 20 - patches = [ 21 - # https://github.com/quantumlib/Cirq/pull/6734 22 - (fetchpatch2 { 23 - name = "fix-rigetti-check-for-aspen-family-device-kind.patch"; 24 - url = "https://github.com/quantumlib/Cirq/commit/dd395fb71fb7f92cfd34f008bf2a98fc70b57fae.patch"; 25 - stripLen = 1; 26 - hash = "sha256-EWB2CfMS2+M3zNFX5PwFNtEBdgJkNVUVNd+I/E6n9kI="; 27 - }) 28 - ]; 29 14 30 15 sourceRoot = "${src.name}/${pname}"; 31 16
+10 -4
pkgs/development/python-modules/cirq/default.nix
··· 1 1 { 2 2 buildPythonPackage, 3 + 4 + # build-system 5 + setuptools, 6 + 7 + # dependencies 3 8 cirq-aqt, 4 9 cirq-core, 5 10 cirq-google, ··· 7 12 cirq-pasqal, 8 13 cirq-rigetti, 9 14 cirq-web, 15 + 16 + # tests 10 17 pytestCheckHook, 11 - setuptools, 12 18 }: 13 19 14 - buildPythonPackage rec { 20 + buildPythonPackage { 15 21 pname = "cirq"; 16 22 pyproject = true; 17 23 inherit (cirq-core) version src meta; ··· 21 27 dependencies = [ 22 28 cirq-aqt 23 29 cirq-core 24 - cirq-ionq 25 30 cirq-google 26 - cirq-rigetti 31 + cirq-ionq 27 32 cirq-pasqal 33 + cirq-rigetti 28 34 cirq-web 29 35 ]; 30 36
+8 -9
pkgs/development/python-modules/pyquil/default.nix
··· 1 1 { 2 2 lib, 3 3 buildPythonPackage, 4 + fetchFromGitHub, 5 + 4 6 deprecated, 5 - fetchFromGitHub, 6 7 ipython, 7 8 matplotlib-inline, 8 9 nest-asyncio, ··· 13 14 pytest-asyncio, 14 15 pytest-mock, 15 16 pytestCheckHook, 16 - pythonOlder, 17 17 qcs-sdk-python, 18 18 respx, 19 19 rpcq, ··· 25 25 26 26 buildPythonPackage rec { 27 27 pname = "pyquil"; 28 - version = "4.15.0"; 28 + version = "4.16.0"; 29 29 pyproject = true; 30 - 31 - disabled = pythonOlder "3.9"; 32 30 33 31 src = fetchFromGitHub { 34 32 owner = "rigetti"; 35 33 repo = "pyquil"; 36 34 tag = "v${version}"; 37 - hash = "sha256-zRXIMSgcFlTZQ5Y/1pSC30ZhvKj1Pn1+7SbTetEdzio="; 35 + hash = "sha256-6nJ0eozqbzHDF3e/Q/bVJnng1b+LUL2tsv4X7sWE9/0="; 38 36 }; 39 37 40 38 pythonRelaxDeps = [ 41 39 "lark" 42 40 "networkx" 41 + "numpy" 43 42 "packaging" 44 43 "qcs-sdk-python" 45 44 "rpcq" ··· 75 74 76 75 pythonImportsCheck = [ "pyquil" ]; 77 76 78 - meta = with lib; { 77 + meta = { 79 78 description = "Python library for creating Quantum Instruction Language (Quil) programs"; 80 79 homepage = "https://github.com/rigetti/pyquil"; 81 80 changelog = "https://github.com/rigetti/pyquil/blob/v${version}/CHANGELOG.md"; 82 - license = licenses.asl20; 83 - maintainers = with maintainers; [ fab ]; 81 + license = lib.licenses.asl20; 82 + maintainers = with lib.maintainers; [ fab ]; 84 83 }; 85 84 }
+8 -16
pkgs/development/python-modules/quil/default.nix
··· 1 1 { 2 2 lib, 3 - stdenv, 4 3 buildPythonPackage, 5 - pythonOlder, 4 + pythonAtLeast, 6 5 fetchFromGitHub, 7 6 rustPlatform, 8 7 numpy, 9 8 pytestCheckHook, 10 9 syrupy, 11 - libiconv, 12 10 }: 13 11 14 12 buildPythonPackage rec { 15 13 pname = "quil"; 16 - version = "0.13.2"; 14 + version = "0.15.3"; 17 15 pyproject = true; 18 16 19 - disabled = pythonOlder "3.8"; 17 + # error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported version (3.12) 18 + disabled = pythonAtLeast "3.13"; 20 19 21 20 src = fetchFromGitHub { 22 21 owner = "rigetti"; 23 22 repo = "quil-rs"; 24 - rev = "quil-py/v${version}"; 25 - hash = "sha256-Hapj90F5IloyW7MyeTg95rlUfb4JiZdtz1HuJVxlk/c="; 23 + tag = "quil-py/v${version}"; 24 + hash = "sha256-55NfQlpeqp0je9MpTeQdVyhZ8C16lZJKM43PTsQY5nc="; 26 25 }; 27 26 28 27 cargoDeps = rustPlatform.fetchCargoVendor { 29 28 inherit pname version src; 30 - hash = "sha256-yfO1/ChiFYTB/LWCc9CR3lBzU71FEos+jjkHVoJyoeI="; 29 + hash = "sha256-hMvbbJulJaR5Qy7LS4H9CyiAoQWoPMNxxVzmwD9aYTQ="; 31 30 }; 32 31 33 32 buildAndTestSubdir = "quil-py"; ··· 37 36 rustPlatform.maturinBuildHook 38 37 ]; 39 38 40 - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ]; 41 - 42 39 dependencies = [ numpy ]; 43 40 44 41 pythonImportsCheck = [ ··· 53 50 syrupy 54 51 ]; 55 52 56 - disabledTests = [ 57 - # Syrupy snapshot needs to be regenerated 58 - "test_filter_instructions" 59 - ]; 60 - 61 53 meta = { 62 - changelog = "https://github.com/rigetti/quil-rs/blob/${src.rev}/quil-py/CHANGELOG.md"; 54 + changelog = "https://github.com/rigetti/quil-rs/blob/quil-py/v${version}/quil-py/CHANGELOG.md"; 63 55 description = "Python package for building and parsing Quil programs"; 64 56 homepage = "https://github.com/rigetti/quil-rs/tree/main/quil-py"; 65 57 license = lib.licenses.asl20;
+16 -9
pkgs/development/python-modules/stim/default.nix
··· 1 1 { 2 2 lib, 3 3 buildPythonPackage, 4 + fetchFromGitHub, 5 + 6 + # build-system 7 + pybind11, 8 + setuptools, 9 + 10 + # dependencies 11 + numpy, 12 + 13 + # tests 4 14 cirq-core, 5 - fetchFromGitHub, 6 15 matplotlib, 7 16 networkx, 8 - numpy, 9 17 pandas, 10 - pybind11, 11 18 pytest-xdist, 12 19 pytestCheckHook, 13 - pythonOlder, 14 20 scipy, 15 - setuptools, 16 - wheel, 17 21 }: 18 22 19 23 buildPythonPackage rec { 20 24 pname = "stim"; 21 25 version = "1.14.0"; 22 26 pyproject = true; 23 - 24 - disabled = pythonOlder "3.6"; 25 27 26 28 src = fetchFromGitHub { 27 29 owner = "quantumlib"; ··· 50 52 build-system = [ 51 53 pybind11 52 54 setuptools 53 - wheel 54 55 ]; 55 56 56 57 dependencies = [ numpy ]; ··· 73 74 # From .github/workflows 74 75 "src/" 75 76 "glue/cirq" 77 + ]; 78 + 79 + disabledTests = [ 80 + # AssertionError: Sample rate 1.0 is over 5 standard deviations away from 1.0. 81 + "test_frame_simulator_sampling_noisy_gates_agrees_with_cirq_data" 82 + "test_tableau_simulator_sampling_noisy_gates_agrees_with_cirq_data" 76 83 ]; 77 84 78 85 meta = {