at 24.05-pre 2.5 kB view raw
1{ lib 2, buildPythonPackage 3, deprecated 4, fetchFromGitHub 5, importlib-metadata 6, ipython 7, lark 8, networkx 9, numpy 10, poetry-core 11, pytest-asyncio 12, pytest-freezegun 13, pytest-httpx 14, pytest-mock 15, pytestCheckHook 16, pythonAtLeast 17, pythonOlder 18, pythonRelaxDepsHook 19, qcs-api-client 20, respx 21, retry 22, rpcq 23, scipy 24, tenacity 25, types-deprecated 26, types-python-dateutil 27, types-retry 28}: 29 30buildPythonPackage rec { 31 pname = "pyquil"; 32 version = "3.5.4"; 33 format = "pyproject"; 34 35 disabled = pythonOlder "3.7"; 36 37 src = fetchFromGitHub { 38 owner = "rigetti"; 39 repo = pname; 40 rev = "refs/tags/v${version}"; 41 hash = "sha256-GQ7vzuUu0PCeLkqKWUSNJyJ01wseOwNL2jJaVTNGF9s="; 42 }; 43 44 pythonRelaxDeps = [ 45 "lark" 46 "networkx" 47 ]; 48 49 nativeBuildInputs = [ 50 poetry-core 51 pythonRelaxDepsHook 52 ]; 53 54 propagatedBuildInputs = [ 55 deprecated 56 lark 57 networkx 58 numpy 59 qcs-api-client 60 retry 61 rpcq 62 scipy 63 tenacity 64 types-deprecated 65 types-python-dateutil 66 types-retry 67 ] ++ lib.optionals (pythonOlder "3.8") [ 68 importlib-metadata 69 ]; 70 71 nativeCheckInputs = [ 72 pytestCheckHook 73 ]; 74 75 checkInputs = [ 76 pytest-asyncio 77 pytest-freezegun 78 pytest-httpx 79 pytest-mock 80 respx 81 ipython 82 ]; 83 84 disabledTestPaths = [ 85 # Tests require network access 86 "test/e2e/" 87 "test/unit/test_api.py" 88 "test/unit/test_engagement_manager.py" 89 "test/unit/test_operator_estimation.py" 90 "test/unit/test_wavefunction_simulator.py" 91 "test/unit/test_compatibility_v2_operator_estimation.py" 92 "test/unit/test_compatibility_v2_quantum_computer.py" 93 "test/unit/test_compatibility_v2_qvm.py" 94 "test/unit/test_quantum_computer.py" 95 "test/unit/test_qvm.py" 96 "test/unit/test_reference_wavefunction.py" 97 # Out-dated 98 "test/unit/test_qpu_client.py" 99 "test/unit/test_qvm_client.py" 100 "test/unit/test_reference_density.py" 101 ]; 102 103 disabledTests = [ 104 "test_compile_with_quilt_calibrations" 105 "test_sets_timeout_on_requests" 106 # sensitive to lark parser output 107 "test_memory_commands" 108 "test_classical" 109 ]; 110 111 pythonImportsCheck = [ 112 "pyquil" 113 ]; 114 115 meta = with lib; { 116 description = "Python library for creating Quantum Instruction Language (Quil) programs"; 117 homepage = "https://github.com/rigetti/pyquil"; 118 changelog = "https://github.com/rigetti/pyquil/blob/v${version}/CHANGELOG.md"; 119 license = licenses.asl20; 120 maintainers = with maintainers; [ fab ]; 121 }; 122}