ocamlPackages.hxd: 0.3.2 -> 0.3.3 (#364231)
[NixPkgs.git] / pkgs / development / python-modules / cirq-core / default.nix
blobc2e85c1f238da81c49870b2c28b497877d81d71d
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,
32 buildPythonPackage rec {
33   pname = "cirq-core";
34   version = "1.4.1";
35   pyproject = true;
37   disabled = pythonOlder "3.10";
39   src = fetchFromGitHub {
40     owner = "quantumlib";
41     repo = "cirq";
42     rev = "refs/tags/v${version}";
43     hash = "sha256-1GcRDVgYF+1igZQFlQbiWZmU1WNIJh4CcOftQe6OP6I=";
44   };
46   sourceRoot = "${src.name}/${pname}";
48   postPatch = ''
49     substituteInPlace requirements.txt \
50       --replace-fail "matplotlib~=3.0" "matplotlib"
51   '';
53   build-system = [ setuptools ];
55   dependencies =
56     [
57       attrs
58       duet
59       matplotlib
60       networkx
61       numpy
62       pandas
63       requests
64       scipy
65       sortedcontainers
66       sympy
67       tqdm
68       typing-extensions
69     ]
70     ++ lib.optionals withContribRequires [
71       autoray
72       opt-einsum
73       ply
74       pylatex
75       pyquil
76       quimb
77     ];
79   nativeCheckInputs = [
80     pytestCheckHook
81     pytest-asyncio
82     freezegun
83   ];
85   disabledTestPaths = lib.optionals (!withContribRequires) [
86     # Requires external (unpackaged) libraries, so untested
87     "cirq/contrib/"
88     # No need to test the version number
89     "cirq/_version_test.py"
90   ];
92   disabledTests =
93     [
94       # Assertion error
95       "test_parameterized_cphase"
96     ]
97     ++ lib.optionals stdenv.hostPlatform.isAarch64 [
98       # https://github.com/quantumlib/Cirq/issues/5924
99       "test_prepare_two_qubit_state_using_sqrt_iswap"
100     ];
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     ];
111   };