Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 117 lines 2.3 kB view raw
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 38buildPythonPackage rec { 39 pname = "cirq-core"; 40 version = "1.5.0"; 41 pyproject = true; 42 43 src = fetchFromGitHub { 44 owner = "quantumlib"; 45 repo = "cirq"; 46 tag = "v${version}"; 47 hash = "sha256-4FgXX4ox7BkjmLecxsvg0/JpcrHPn6hlFw5rk4bn9Cc="; 48 }; 49 50 sourceRoot = "${src.name}/${pname}"; 51 52 pythonRelaxDeps = [ "matplotlib" ]; 53 54 build-system = [ setuptools ]; 55 56 dependencies = 57 [ 58 attrs 59 duet 60 matplotlib 61 networkx 62 numpy 63 pandas 64 requests 65 scipy 66 sortedcontainers 67 sympy 68 tqdm 69 typing-extensions 70 ] 71 ++ lib.optionals withContribRequires [ 72 autoray 73 opt-einsum 74 ply 75 pylatex 76 pyquil 77 quimb 78 ]; 79 80 nativeCheckInputs = [ 81 freezegun 82 pytest-asyncio 83 pytestCheckHook 84 ]; 85 86 disabledTestPaths = lib.optionals (!withContribRequires) [ 87 # Requires external (unpackaged) libraries, so untested 88 "cirq/contrib/" 89 # No need to test the version number 90 "cirq/_version_test.py" 91 ]; 92 93 disabledTests = 94 [ 95 # Assertion error 96 "test_parameterized_cphase" 97 ] 98 ++ lib.optionals stdenv.hostPlatform.isAarch64 [ 99 # https://github.com/quantumlib/Cirq/issues/5924 100 "test_prepare_two_qubit_state_using_sqrt_iswap" 101 ] 102 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 103 # test_scalar_division[scalar9-terms9-terms_expected9] result differs in the final digit 104 "test_scalar_division" 105 ]; 106 107 meta = { 108 description = "Framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits"; 109 homepage = "https://github.com/quantumlib/cirq"; 110 changelog = "https://github.com/quantumlib/Cirq/releases/tag/v${version}"; 111 license = lib.licenses.asl20; 112 maintainers = with lib.maintainers; [ 113 drewrisinger 114 fab 115 ]; 116 }; 117}