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