summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/python-modules/cirq-core/default.nix23
-rw-r--r--pkgs/development/python-modules/cirq-ft/default.nix36
-rw-r--r--pkgs/development/python-modules/cirq-google/default.nix7
-rw-r--r--pkgs/development/python-modules/cirq-rigetti/default.nix28
-rw-r--r--pkgs/development/python-modules/cirq/default.nix3
-rw-r--r--pkgs/top-level/python-packages.nix2
6 files changed, 69 insertions, 30 deletions
diff --git a/pkgs/development/python-modules/cirq-core/default.nix b/pkgs/development/python-modules/cirq-core/default.nix
index ce188ce6811..bc3a92fe4ac 100644
--- a/pkgs/development/python-modules/cirq-core/default.nix
+++ b/pkgs/development/python-modules/cirq-core/default.nix
@@ -4,7 +4,6 @@
 , pythonAtLeast
 , pythonOlder
 , fetchFromGitHub
-, fetchpatch
 , duet
 , matplotlib
 , networkx
@@ -32,35 +31,23 @@
 
 buildPythonPackage rec {
   pname = "cirq-core";
-  version = "1.1.0";
+  version = "1.2.0";
   format = "setuptools";
 
-  # Upstream package is broken on Python 3.11 https://github.com/quantumlib/Cirq/issues/6018
-  disabled = pythonOlder "3.7" || pythonAtLeast "3.11";
+  disabled = pythonOlder "3.9";
 
   src = fetchFromGitHub {
     owner = "quantumlib";
     repo = "cirq";
     rev = "refs/tags/v${version}";
-    hash = "sha256-5j4hbG95KRfRQTyyZgoNp/eHIcy0FphyEhbYnzyUMO4=";
+    hash = "sha256-KEei5PJ0ammsduZVmMh2vaW3f58DYI4BCrFCl/SjUoo=";
   };
 
   sourceRoot = "${src.name}/${pname}";
 
-  patches = [
-    # https://github.com/quantumlib/Cirq/pull/5991
-    (fetchpatch {
-      url = "https://build.opensuse.org/public/source/openSUSE:Factory/python-cirq/cirq-pr5991-np1.24.patch?rev=8";
-      stripLen = 1;
-      hash = "sha256-d2FpaxM1PsPWT9ZM9v2gVrnLCy9zmvkkyAVgo85eL3U=";
-    })
-  ];
-
   postPatch = ''
     substituteInPlace requirements.txt \
-      --replace "matplotlib~=3.0" "matplotlib" \
-      --replace "networkx~=2.4" "networkx" \
-      --replace "numpy>=1.16,<1.24" "numpy"
+      --replace "matplotlib~=3.0" "matplotlib"
   '';
 
   propagatedBuildInputs = [
@@ -106,6 +93,8 @@ buildPythonPackage rec {
     "test_json_and_repr_data"
     # Tests for some changed error handling behavior in SymPy 1.12
     "test_custom_value_not_implemented"
+    # Calibration issue
+    "test_xeb_to_calibration_layer"
   ];
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/cirq-ft/default.nix b/pkgs/development/python-modules/cirq-ft/default.nix
new file mode 100644
index 00000000000..83a8392b952
--- /dev/null
+++ b/pkgs/development/python-modules/cirq-ft/default.nix
@@ -0,0 +1,36 @@
+{ attrs
+, buildPythonPackage
+, cachetools
+, cirq-core
+, ipython
+, ipywidgets
+, nbconvert
+, nbformat
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "cirq-ft";
+  inherit (cirq-core) version src meta;
+
+  sourceRoot = "${src.name}/${pname}";
+
+  propagatedBuildInputs = [
+    attrs
+    cachetools
+    cirq-core
+    ipython
+    ipywidgets
+    nbconvert
+    nbformat
+  ];
+
+  nativeCheckInputs = [
+    ipython
+    pytestCheckHook
+  ];
+
+  # cirq's importlib hook doesn't work here
+  #pythonImportsCheck = [ "cirq_ft" ];
+
+}
diff --git a/pkgs/development/python-modules/cirq-google/default.nix b/pkgs/development/python-modules/cirq-google/default.nix
index 491caa5f929..a49eebfce90 100644
--- a/pkgs/development/python-modules/cirq-google/default.nix
+++ b/pkgs/development/python-modules/cirq-google/default.nix
@@ -4,6 +4,7 @@
 , protobuf
 , pytestCheckHook
 , freezegun
+, pythonRelaxDepsHook
 }:
 
 buildPythonPackage rec {
@@ -18,6 +19,10 @@ buildPythonPackage rec {
       --replace "protobuf >= 3.15.0, < 4" "protobuf >= 3.15.0"
   '';
 
+  nativeBuildInputs = [
+    pythonRelaxDepsHook
+  ];
+
   propagatedBuildInputs = [
     cirq-core
     google-api-core
@@ -40,6 +45,8 @@ buildPythonPackage rec {
     # unittest.mock.InvalidSpecError: Cannot autospec attr 'QuantumEngineServiceClient'
     "test_get_engine_sampler_explicit_project_id"
     "test_get_engine_sampler"
+    # Calibration issue
+    "test_xeb_to_calibration_layer"
   ];
 
 }
diff --git a/pkgs/development/python-modules/cirq-rigetti/default.nix b/pkgs/development/python-modules/cirq-rigetti/default.nix
index f09f7ce0453..be0ec040995 100644
--- a/pkgs/development/python-modules/cirq-rigetti/default.nix
+++ b/pkgs/development/python-modules/cirq-rigetti/default.nix
@@ -31,20 +31,22 @@ buildPythonPackage rec {
 
   sourceRoot = "${src.name}/${pname}";
 
+  pythonRelaxDeps = [
+    "attrs"
+    "certifi"
+    "h11"
+    "httpcore"
+    "httpx"
+    "idna"
+    "iso8601"
+    "pydantic"
+    "pyjwt"
+    "pyquil"
+    "qcs-api-client"
+    "rfc3986"
+  ];
+
   postPatch = ''
-    substituteInPlace requirements.txt \
-      --replace "attrs~=20.3.0" "attrs" \
-      --replace "certifi~=2021.5.30" "certifi" \
-      --replace "h11~=0.9.0" "h11" \
-      --replace "httpcore~=0.11.1" "httpcore" \
-      --replace "httpx~=0.15.5" "httpx" \
-      --replace "idna~=2.10" "idna" \
-      --replace "pyjwt~=1.7.1" "pyjwt" \
-      --replace "qcs-api-client~=0.8.0" "qcs-api-client" \
-      --replace "iso8601~=0.1.14" "iso8601" \
-      --replace "rfc3986~=1.5.0" "rfc3986" \
-      --replace "pyquil~=3.0.0" "pyquil" \
-      --replace "pydantic~=1.8.2" "pydantic"
     # Remove outdated test
     rm cirq_rigetti/service_test.py
   '';
diff --git a/pkgs/development/python-modules/cirq/default.nix b/pkgs/development/python-modules/cirq/default.nix
index f7774105244..f53613065fb 100644
--- a/pkgs/development/python-modules/cirq/default.nix
+++ b/pkgs/development/python-modules/cirq/default.nix
@@ -1,6 +1,7 @@
 { buildPythonPackage
 , cirq-aqt
 , cirq-core
+, cirq-ft
 , cirq-google
 , cirq-ionq
 , cirq-pasqal
@@ -16,6 +17,7 @@ buildPythonPackage rec {
   propagatedBuildInputs = [
     cirq-aqt
     cirq-core
+    cirq-ft
     cirq-ionq
     cirq-google
     cirq-rigetti
@@ -32,6 +34,7 @@ buildPythonPackage rec {
   disabledTestPaths = [
     "cirq-aqt"
     "cirq-core"
+    "cirq-ft"
     "cirq-google"
     "cirq-ionq"
     "cirq-pasqal"
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 06d5d17d87b..a335505450e 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1983,6 +1983,8 @@ self: super: with self; {
 
   cirq-core = callPackage ../development/python-modules/cirq-core { };
 
+  cirq-ft = callPackage ../development/python-modules/cirq-ft { };
+
   cirq-ionq = callPackage ../development/python-modules/cirq-ionq { };
 
   cirq-google = callPackage ../development/python-modules/cirq-google { };