Skip to content

Commit a2ce3ee

Browse files
authored
python312Packages.{cirq,cirq-core,cirq-google,cirq-rigetti,quil,pyquil}: cleanup & fix (#384232)
2 parents 163c186 + a49631e commit a2ce3ee

File tree

7 files changed

+70
-89
lines changed

7 files changed

+70
-89
lines changed

pkgs/development/python-modules/cirq-core/default.nix

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
{
22
lib,
33
stdenv,
4-
attrs,
5-
autoray ? null,
64
buildPythonPackage,
7-
duet,
85
fetchFromGitHub,
9-
freezegun,
6+
7+
# build-system
8+
setuptools,
9+
10+
# dependencies
11+
attrs,
12+
duet,
1013
matplotlib,
1114
networkx,
1215
numpy,
13-
opt-einsum,
1416
pandas,
15-
ply,
16-
pylatex ? null,
17-
pyquil ? null,
18-
pytest-asyncio,
19-
pytestCheckHook,
20-
pythonOlder,
21-
quimb ? null,
2217
requests,
2318
scipy,
24-
setuptools,
2519
sortedcontainers,
2620
sympy,
2721
tqdm,
2822
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+
2935
withContribRequires ? false,
3036
}:
3137

@@ -34,8 +40,6 @@ buildPythonPackage rec {
3440
version = "1.4.1-unstable-2024-09-21";
3541
pyproject = true;
3642

37-
disabled = pythonOlder "3.10";
38-
3943
src = fetchFromGitHub {
4044
owner = "quantumlib";
4145
repo = "cirq";
@@ -77,9 +81,9 @@ buildPythonPackage rec {
7781
];
7882

7983
nativeCheckInputs = [
80-
pytestCheckHook
81-
pytest-asyncio
8284
freezegun
85+
pytest-asyncio
86+
pytestCheckHook
8387
];
8488

8589
disabledTestPaths = lib.optionals (!withContribRequires) [
@@ -99,12 +103,12 @@ buildPythonPackage rec {
99103
"test_prepare_two_qubit_state_using_sqrt_iswap"
100104
];
101105

102-
meta = with lib; {
106+
meta = {
103107
description = "Framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits";
104108
homepage = "https://github.com/quantumlib/cirq";
105109
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; [
108112
drewrisinger
109113
fab
110114
];

pkgs/development/python-modules/cirq-google/default.nix

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
22
buildPythonPackage,
3+
setuptools,
34
cirq-core,
4-
freezegun,
55
google-api-core,
66
protobuf,
7+
freezegun,
78
pytestCheckHook,
8-
setuptools,
9-
protobuf4,
10-
fetchpatch,
119
}:
1210

1311
buildPythonPackage rec {
@@ -19,16 +17,6 @@ buildPythonPackage rec {
1917

2018
build-system = [ setuptools ];
2119

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-
3220
pythonRelaxDeps = [
3321
"protobuf"
3422
];

pkgs/development/python-modules/cirq-rigetti/default.nix

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
11
{
2-
lib,
32
buildPythonPackage,
43
cirq-core,
5-
fetchpatch2,
4+
setuptools,
65
pyquil,
7-
pytestCheckHook,
8-
pythonOlder,
96
qcs-sdk-python,
10-
setuptools,
7+
pytestCheckHook,
118
}:
129

1310
buildPythonPackage rec {
1411
pname = "cirq-rigetti";
1512
pyproject = true;
1613
inherit (cirq-core) version src;
1714

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-
3015
sourceRoot = "${src.name}/${pname}";
3116

3217
pythonRelaxDeps = [ "pyquil" ];

pkgs/development/python-modules/cirq/default.nix

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
22
buildPythonPackage,
3+
4+
# build-system
5+
setuptools,
6+
7+
# dependencies
38
cirq-aqt,
49
cirq-core,
510
cirq-google,
611
cirq-ionq,
712
cirq-pasqal,
813
cirq-rigetti,
914
cirq-web,
15+
16+
# tests
1017
pytestCheckHook,
11-
setuptools,
1218
}:
1319

14-
buildPythonPackage rec {
20+
buildPythonPackage {
1521
pname = "cirq";
1622
pyproject = true;
1723
inherit (cirq-core) version src meta;
@@ -21,10 +27,10 @@ buildPythonPackage rec {
2127
dependencies = [
2228
cirq-aqt
2329
cirq-core
24-
cirq-ionq
2530
cirq-google
26-
cirq-rigetti
31+
cirq-ionq
2732
cirq-pasqal
33+
cirq-rigetti
2834
cirq-web
2935
];
3036

pkgs/development/python-modules/pyquil/default.nix

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
lib,
33
buildPythonPackage,
4-
deprecated,
54
fetchFromGitHub,
5+
6+
deprecated,
67
ipython,
78
matplotlib-inline,
89
nest-asyncio,
@@ -13,7 +14,6 @@
1314
pytest-asyncio,
1415
pytest-mock,
1516
pytestCheckHook,
16-
pythonOlder,
1717
qcs-sdk-python,
1818
respx,
1919
rpcq,
@@ -25,21 +25,20 @@
2525

2626
buildPythonPackage rec {
2727
pname = "pyquil";
28-
version = "4.15.0";
28+
version = "4.16.0";
2929
pyproject = true;
3030

31-
disabled = pythonOlder "3.9";
32-
3331
src = fetchFromGitHub {
3432
owner = "rigetti";
3533
repo = "pyquil";
3634
tag = "v${version}";
37-
hash = "sha256-zRXIMSgcFlTZQ5Y/1pSC30ZhvKj1Pn1+7SbTetEdzio=";
35+
hash = "sha256-6nJ0eozqbzHDF3e/Q/bVJnng1b+LUL2tsv4X7sWE9/0=";
3836
};
3937

4038
pythonRelaxDeps = [
4139
"lark"
4240
"networkx"
41+
"numpy"
4342
"packaging"
4443
"qcs-sdk-python"
4544
"rpcq"
@@ -75,11 +74,11 @@ buildPythonPackage rec {
7574

7675
pythonImportsCheck = [ "pyquil" ];
7776

78-
meta = with lib; {
77+
meta = {
7978
description = "Python library for creating Quantum Instruction Language (Quil) programs";
8079
homepage = "https://github.com/rigetti/pyquil";
8180
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 ];
8483
};
8584
}

pkgs/development/python-modules/quil/default.nix

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
{
22
lib,
3-
stdenv,
43
buildPythonPackage,
5-
pythonOlder,
4+
pythonAtLeast,
65
fetchFromGitHub,
76
rustPlatform,
87
numpy,
98
pytestCheckHook,
109
syrupy,
11-
libiconv,
1210
}:
1311

1412
buildPythonPackage rec {
1513
pname = "quil";
16-
version = "0.13.2";
14+
version = "0.15.3";
1715
pyproject = true;
1816

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";
2019

2120
src = fetchFromGitHub {
2221
owner = "rigetti";
2322
repo = "quil-rs";
24-
rev = "quil-py/v${version}";
25-
hash = "sha256-Hapj90F5IloyW7MyeTg95rlUfb4JiZdtz1HuJVxlk/c=";
23+
tag = "quil-py/v${version}";
24+
hash = "sha256-55NfQlpeqp0je9MpTeQdVyhZ8C16lZJKM43PTsQY5nc=";
2625
};
2726

2827
cargoDeps = rustPlatform.fetchCargoVendor {
2928
inherit pname version src;
30-
hash = "sha256-yfO1/ChiFYTB/LWCc9CR3lBzU71FEos+jjkHVoJyoeI=";
29+
hash = "sha256-hMvbbJulJaR5Qy7LS4H9CyiAoQWoPMNxxVzmwD9aYTQ=";
3130
};
3231

3332
buildAndTestSubdir = "quil-py";
@@ -37,8 +36,6 @@ buildPythonPackage rec {
3736
rustPlatform.maturinBuildHook
3837
];
3938

40-
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
41-
4239
dependencies = [ numpy ];
4340

4441
pythonImportsCheck = [
@@ -53,13 +50,8 @@ buildPythonPackage rec {
5350
syrupy
5451
];
5552

56-
disabledTests = [
57-
# Syrupy snapshot needs to be regenerated
58-
"test_filter_instructions"
59-
];
60-
6153
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";
6355
description = "Python package for building and parsing Quil programs";
6456
homepage = "https://github.com/rigetti/quil-rs/tree/main/quil-py";
6557
license = lib.licenses.asl20;

pkgs/development/python-modules/stim/default.nix

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
{
22
lib,
33
buildPythonPackage,
4-
cirq-core,
54
fetchFromGitHub,
5+
6+
# build-system
7+
pybind11,
8+
setuptools,
9+
10+
# dependencies
11+
numpy,
12+
13+
# tests
14+
cirq-core,
615
matplotlib,
716
networkx,
8-
numpy,
917
pandas,
10-
pybind11,
1118
pytest-xdist,
1219
pytestCheckHook,
13-
pythonOlder,
1420
scipy,
15-
setuptools,
16-
wheel,
1721
}:
1822

1923
buildPythonPackage rec {
2024
pname = "stim";
2125
version = "1.14.0";
2226
pyproject = true;
2327

24-
disabled = pythonOlder "3.6";
25-
2628
src = fetchFromGitHub {
2729
owner = "quantumlib";
2830
repo = "Stim";
@@ -50,7 +52,6 @@ buildPythonPackage rec {
5052
build-system = [
5153
pybind11
5254
setuptools
53-
wheel
5455
];
5556

5657
dependencies = [ numpy ];
@@ -75,6 +76,12 @@ buildPythonPackage rec {
7576
"glue/cirq"
7677
];
7778

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+
7885
meta = {
7986
description = "Tool for high performance simulation and analysis of quantum stabilizer circuits, especially quantum error correction (QEC) circuits";
8087
mainProgram = "stim";

0 commit comments

Comments
 (0)